aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/chips/asb100.c
diff options
context:
space:
mode:
authorYani Ioannou <yani.ioannou@gmail.com>2005-05-17 06:41:35 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-06-20 18:15:33 -0400
commit30f74292e50d6c4ae438dbee5cb45d77bf774351 (patch)
tree4bfa1b6715ecd597e196a9f448c825ef0c12d8e3 /drivers/i2c/chips/asb100.c
parent74880c063b06efd103c924abfe19d9d8fa4864c4 (diff)
[PATCH] Driver Core: drivers/i2c/chips/adm1031.c - lm75.c: update device attribute callbacks
Signed-off-by: Yani Ioannou <yani.ioannou@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/i2c/chips/asb100.c')
-rw-r--r--drivers/i2c/chips/asb100.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/drivers/i2c/chips/asb100.c b/drivers/i2c/chips/asb100.c
index 7f899002bc54..4a47b4493e34 100644
--- a/drivers/i2c/chips/asb100.c
+++ b/drivers/i2c/chips/asb100.c
@@ -260,28 +260,28 @@ set_in_reg(MAX, max)
260 260
261#define sysfs_in(offset) \ 261#define sysfs_in(offset) \
262static ssize_t \ 262static ssize_t \
263 show_in##offset (struct device *dev, char *buf) \ 263 show_in##offset (struct device *dev, struct device_attribute *attr, char *buf) \
264{ \ 264{ \
265 return show_in(dev, buf, offset); \ 265 return show_in(dev, buf, offset); \
266} \ 266} \
267static DEVICE_ATTR(in##offset##_input, S_IRUGO, \ 267static DEVICE_ATTR(in##offset##_input, S_IRUGO, \
268 show_in##offset, NULL); \ 268 show_in##offset, NULL); \
269static ssize_t \ 269static ssize_t \
270 show_in##offset##_min (struct device *dev, char *buf) \ 270 show_in##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \
271{ \ 271{ \
272 return show_in_min(dev, buf, offset); \ 272 return show_in_min(dev, buf, offset); \
273} \ 273} \
274static ssize_t \ 274static ssize_t \
275 show_in##offset##_max (struct device *dev, char *buf) \ 275 show_in##offset##_max (struct device *dev, struct device_attribute *attr, char *buf) \
276{ \ 276{ \
277 return show_in_max(dev, buf, offset); \ 277 return show_in_max(dev, buf, offset); \
278} \ 278} \
279static ssize_t set_in##offset##_min (struct device *dev, \ 279static ssize_t set_in##offset##_min (struct device *dev, struct device_attribute *attr, \
280 const char *buf, size_t count) \ 280 const char *buf, size_t count) \
281{ \ 281{ \
282 return set_in_min(dev, buf, count, offset); \ 282 return set_in_min(dev, buf, count, offset); \
283} \ 283} \
284static ssize_t set_in##offset##_max (struct device *dev, \ 284static ssize_t set_in##offset##_max (struct device *dev, struct device_attribute *attr, \
285 const char *buf, size_t count) \ 285 const char *buf, size_t count) \
286{ \ 286{ \
287 return set_in_max(dev, buf, count, offset); \ 287 return set_in_max(dev, buf, count, offset); \
@@ -389,24 +389,24 @@ static ssize_t set_fan_div(struct device *dev, const char *buf,
389} 389}
390 390
391#define sysfs_fan(offset) \ 391#define sysfs_fan(offset) \
392static ssize_t show_fan##offset(struct device *dev, char *buf) \ 392static ssize_t show_fan##offset(struct device *dev, struct device_attribute *attr, char *buf) \
393{ \ 393{ \
394 return show_fan(dev, buf, offset - 1); \ 394 return show_fan(dev, buf, offset - 1); \
395} \ 395} \
396static ssize_t show_fan##offset##_min(struct device *dev, char *buf) \ 396static ssize_t show_fan##offset##_min(struct device *dev, struct device_attribute *attr, char *buf) \
397{ \ 397{ \
398 return show_fan_min(dev, buf, offset - 1); \ 398 return show_fan_min(dev, buf, offset - 1); \
399} \ 399} \
400static ssize_t show_fan##offset##_div(struct device *dev, char *buf) \ 400static ssize_t show_fan##offset##_div(struct device *dev, struct device_attribute *attr, char *buf) \
401{ \ 401{ \
402 return show_fan_div(dev, buf, offset - 1); \ 402 return show_fan_div(dev, buf, offset - 1); \
403} \ 403} \
404static ssize_t set_fan##offset##_min(struct device *dev, const char *buf, \ 404static ssize_t set_fan##offset##_min(struct device *dev, struct device_attribute *attr, const char *buf, \
405 size_t count) \ 405 size_t count) \
406{ \ 406{ \
407 return set_fan_min(dev, buf, count, offset - 1); \ 407 return set_fan_min(dev, buf, count, offset - 1); \
408} \ 408} \
409static ssize_t set_fan##offset##_div(struct device *dev, const char *buf, \ 409static ssize_t set_fan##offset##_div(struct device *dev, struct device_attribute *attr, const char *buf, \
410 size_t count) \ 410 size_t count) \
411{ \ 411{ \
412 return set_fan_div(dev, buf, count, offset - 1); \ 412 return set_fan_div(dev, buf, count, offset - 1); \
@@ -482,27 +482,27 @@ set_temp_reg(MAX, temp_max);
482set_temp_reg(HYST, temp_hyst); 482set_temp_reg(HYST, temp_hyst);
483 483
484#define sysfs_temp(num) \ 484#define sysfs_temp(num) \
485static ssize_t show_temp##num(struct device *dev, char *buf) \ 485static ssize_t show_temp##num(struct device *dev, struct device_attribute *attr, char *buf) \
486{ \ 486{ \
487 return show_temp(dev, buf, num-1); \ 487 return show_temp(dev, buf, num-1); \
488} \ 488} \
489static DEVICE_ATTR(temp##num##_input, S_IRUGO, show_temp##num, NULL); \ 489static DEVICE_ATTR(temp##num##_input, S_IRUGO, show_temp##num, NULL); \
490static ssize_t show_temp_max##num(struct device *dev, char *buf) \ 490static ssize_t show_temp_max##num(struct device *dev, struct device_attribute *attr, char *buf) \
491{ \ 491{ \
492 return show_temp_max(dev, buf, num-1); \ 492 return show_temp_max(dev, buf, num-1); \
493} \ 493} \
494static ssize_t set_temp_max##num(struct device *dev, const char *buf, \ 494static ssize_t set_temp_max##num(struct device *dev, struct device_attribute *attr, const char *buf, \
495 size_t count) \ 495 size_t count) \
496{ \ 496{ \
497 return set_temp_max(dev, buf, count, num-1); \ 497 return set_temp_max(dev, buf, count, num-1); \
498} \ 498} \
499static DEVICE_ATTR(temp##num##_max, S_IRUGO | S_IWUSR, \ 499static DEVICE_ATTR(temp##num##_max, S_IRUGO | S_IWUSR, \
500 show_temp_max##num, set_temp_max##num); \ 500 show_temp_max##num, set_temp_max##num); \
501static ssize_t show_temp_hyst##num(struct device *dev, char *buf) \ 501static ssize_t show_temp_hyst##num(struct device *dev, struct device_attribute *attr, char *buf) \
502{ \ 502{ \
503 return show_temp_hyst(dev, buf, num-1); \ 503 return show_temp_hyst(dev, buf, num-1); \
504} \ 504} \
505static ssize_t set_temp_hyst##num(struct device *dev, const char *buf, \ 505static ssize_t set_temp_hyst##num(struct device *dev, struct device_attribute *attr, const char *buf, \
506 size_t count) \ 506 size_t count) \
507{ \ 507{ \
508 return set_temp_hyst(dev, buf, count, num-1); \ 508 return set_temp_hyst(dev, buf, count, num-1); \
@@ -522,7 +522,7 @@ sysfs_temp(4);
522 device_create_file(&client->dev, &dev_attr_temp##num##_max_hyst); \ 522 device_create_file(&client->dev, &dev_attr_temp##num##_max_hyst); \
523} while (0) 523} while (0)
524 524
525static ssize_t show_vid(struct device *dev, char *buf) 525static ssize_t show_vid(struct device *dev, struct device_attribute *attr, char *buf)
526{ 526{
527 struct asb100_data *data = asb100_update_device(dev); 527 struct asb100_data *data = asb100_update_device(dev);
528 return sprintf(buf, "%d\n", vid_from_reg(data->vid, data->vrm)); 528 return sprintf(buf, "%d\n", vid_from_reg(data->vid, data->vrm));
@@ -533,13 +533,13 @@ static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid, NULL);
533device_create_file(&client->dev, &dev_attr_cpu0_vid) 533device_create_file(&client->dev, &dev_attr_cpu0_vid)
534 534
535/* VRM */ 535/* VRM */
536static ssize_t show_vrm(struct device *dev, char *buf) 536static ssize_t show_vrm(struct device *dev, struct device_attribute *attr, char *buf)
537{ 537{
538 struct asb100_data *data = asb100_update_device(dev); 538 struct asb100_data *data = asb100_update_device(dev);
539 return sprintf(buf, "%d\n", data->vrm); 539 return sprintf(buf, "%d\n", data->vrm);
540} 540}
541 541
542static ssize_t set_vrm(struct device *dev, const char *buf, size_t count) 542static ssize_t set_vrm(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
543{ 543{
544 struct i2c_client *client = to_i2c_client(dev); 544 struct i2c_client *client = to_i2c_client(dev);
545 struct asb100_data *data = i2c_get_clientdata(client); 545 struct asb100_data *data = i2c_get_clientdata(client);
@@ -553,7 +553,7 @@ static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm, set_vrm);
553#define device_create_file_vrm(client) \ 553#define device_create_file_vrm(client) \
554device_create_file(&client->dev, &dev_attr_vrm); 554device_create_file(&client->dev, &dev_attr_vrm);
555 555
556static ssize_t show_alarms(struct device *dev, char *buf) 556static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf)
557{ 557{
558 struct asb100_data *data = asb100_update_device(dev); 558 struct asb100_data *data = asb100_update_device(dev);
559 return sprintf(buf, "%d\n", ALARMS_FROM_REG(data->alarms)); 559 return sprintf(buf, "%d\n", ALARMS_FROM_REG(data->alarms));
@@ -564,13 +564,13 @@ static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL);
564device_create_file(&client->dev, &dev_attr_alarms) 564device_create_file(&client->dev, &dev_attr_alarms)
565 565
566/* 1 PWM */ 566/* 1 PWM */
567static ssize_t show_pwm1(struct device *dev, char *buf) 567static ssize_t show_pwm1(struct device *dev, struct device_attribute *attr, char *buf)
568{ 568{
569 struct asb100_data *data = asb100_update_device(dev); 569 struct asb100_data *data = asb100_update_device(dev);
570 return sprintf(buf, "%d\n", ASB100_PWM_FROM_REG(data->pwm & 0x0f)); 570 return sprintf(buf, "%d\n", ASB100_PWM_FROM_REG(data->pwm & 0x0f));
571} 571}
572 572
573static ssize_t set_pwm1(struct device *dev, const char *buf, size_t count) 573static ssize_t set_pwm1(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
574{ 574{
575 struct i2c_client *client = to_i2c_client(dev); 575 struct i2c_client *client = to_i2c_client(dev);
576 struct asb100_data *data = i2c_get_clientdata(client); 576 struct asb100_data *data = i2c_get_clientdata(client);
@@ -584,13 +584,13 @@ static ssize_t set_pwm1(struct device *dev, const char *buf, size_t count)
584 return count; 584 return count;
585} 585}
586 586
587static ssize_t show_pwm_enable1(struct device *dev, char *buf) 587static ssize_t show_pwm_enable1(struct device *dev, struct device_attribute *attr, char *buf)
588{ 588{
589 struct asb100_data *data = asb100_update_device(dev); 589 struct asb100_data *data = asb100_update_device(dev);
590 return sprintf(buf, "%d\n", (data->pwm & 0x80) ? 1 : 0); 590 return sprintf(buf, "%d\n", (data->pwm & 0x80) ? 1 : 0);
591} 591}
592 592
593static ssize_t set_pwm_enable1(struct device *dev, const char *buf, 593static ssize_t set_pwm_enable1(struct device *dev, struct device_attribute *attr, const char *buf,
594 size_t count) 594 size_t count)
595{ 595{
596 struct i2c_client *client = to_i2c_client(dev); 596 struct i2c_client *client = to_i2c_client(dev);