aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/chips/w83627hf.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/i2c/chips/w83627hf.c')
-rw-r--r--drivers/i2c/chips/w83627hf.c56
1 files changed, 28 insertions, 28 deletions
diff --git a/drivers/i2c/chips/w83627hf.c b/drivers/i2c/chips/w83627hf.c
index b1da5ed696d3..4f1bff572c1c 100644
--- a/drivers/i2c/chips/w83627hf.c
+++ b/drivers/i2c/chips/w83627hf.c
@@ -368,19 +368,19 @@ store_in_reg(MAX, max)
368 368
369#define sysfs_in_offset(offset) \ 369#define sysfs_in_offset(offset) \
370static ssize_t \ 370static ssize_t \
371show_regs_in_##offset (struct device *dev, char *buf) \ 371show_regs_in_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
372{ \ 372{ \
373 return show_in(dev, buf, offset); \ 373 return show_in(dev, buf, offset); \
374} \ 374} \
375static DEVICE_ATTR(in##offset##_input, S_IRUGO, show_regs_in_##offset, NULL); 375static DEVICE_ATTR(in##offset##_input, S_IRUGO, show_regs_in_##offset, NULL);
376 376
377#define sysfs_in_reg_offset(reg, offset) \ 377#define sysfs_in_reg_offset(reg, offset) \
378static ssize_t show_regs_in_##reg##offset (struct device *dev, char *buf) \ 378static ssize_t show_regs_in_##reg##offset (struct device *dev, struct device_attribute *attr, char *buf) \
379{ \ 379{ \
380 return show_in_##reg (dev, buf, offset); \ 380 return show_in_##reg (dev, buf, offset); \
381} \ 381} \
382static ssize_t \ 382static ssize_t \
383store_regs_in_##reg##offset (struct device *dev, \ 383store_regs_in_##reg##offset (struct device *dev, struct device_attribute *attr, \
384 const char *buf, size_t count) \ 384 const char *buf, size_t count) \
385{ \ 385{ \
386 return store_in_##reg (dev, buf, count, offset); \ 386 return store_in_##reg (dev, buf, count, offset); \
@@ -419,25 +419,25 @@ static ssize_t show_in_0(struct w83627hf_data *data, char *buf, u8 reg)
419 return sprintf(buf,"%ld\n", in0); 419 return sprintf(buf,"%ld\n", in0);
420} 420}
421 421
422static ssize_t show_regs_in_0(struct device *dev, char *buf) 422static ssize_t show_regs_in_0(struct device *dev, struct device_attribute *attr, char *buf)
423{ 423{
424 struct w83627hf_data *data = w83627hf_update_device(dev); 424 struct w83627hf_data *data = w83627hf_update_device(dev);
425 return show_in_0(data, buf, data->in[0]); 425 return show_in_0(data, buf, data->in[0]);
426} 426}
427 427
428static ssize_t show_regs_in_min0(struct device *dev, char *buf) 428static ssize_t show_regs_in_min0(struct device *dev, struct device_attribute *attr, char *buf)
429{ 429{
430 struct w83627hf_data *data = w83627hf_update_device(dev); 430 struct w83627hf_data *data = w83627hf_update_device(dev);
431 return show_in_0(data, buf, data->in_min[0]); 431 return show_in_0(data, buf, data->in_min[0]);
432} 432}
433 433
434static ssize_t show_regs_in_max0(struct device *dev, char *buf) 434static ssize_t show_regs_in_max0(struct device *dev, struct device_attribute *attr, char *buf)
435{ 435{
436 struct w83627hf_data *data = w83627hf_update_device(dev); 436 struct w83627hf_data *data = w83627hf_update_device(dev);
437 return show_in_0(data, buf, data->in_max[0]); 437 return show_in_0(data, buf, data->in_max[0]);
438} 438}
439 439
440static ssize_t store_regs_in_min0(struct device *dev, 440static ssize_t store_regs_in_min0(struct device *dev, struct device_attribute *attr,
441 const char *buf, size_t count) 441 const char *buf, size_t count)
442{ 442{
443 struct i2c_client *client = to_i2c_client(dev); 443 struct i2c_client *client = to_i2c_client(dev);
@@ -462,7 +462,7 @@ static ssize_t store_regs_in_min0(struct device *dev,
462 return count; 462 return count;
463} 463}
464 464
465static ssize_t store_regs_in_max0(struct device *dev, 465static ssize_t store_regs_in_max0(struct device *dev, struct device_attribute *attr,
466 const char *buf, size_t count) 466 const char *buf, size_t count)
467{ 467{
468 struct i2c_client *client = to_i2c_client(dev); 468 struct i2c_client *client = to_i2c_client(dev);
@@ -531,19 +531,19 @@ store_fan_min(struct device *dev, const char *buf, size_t count, int nr)
531} 531}
532 532
533#define sysfs_fan_offset(offset) \ 533#define sysfs_fan_offset(offset) \
534static ssize_t show_regs_fan_##offset (struct device *dev, char *buf) \ 534static ssize_t show_regs_fan_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
535{ \ 535{ \
536 return show_fan(dev, buf, offset); \ 536 return show_fan(dev, buf, offset); \
537} \ 537} \
538static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_regs_fan_##offset, NULL); 538static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_regs_fan_##offset, NULL);
539 539
540#define sysfs_fan_min_offset(offset) \ 540#define sysfs_fan_min_offset(offset) \
541static ssize_t show_regs_fan_min##offset (struct device *dev, char *buf) \ 541static ssize_t show_regs_fan_min##offset (struct device *dev, struct device_attribute *attr, char *buf) \
542{ \ 542{ \
543 return show_fan_min(dev, buf, offset); \ 543 return show_fan_min(dev, buf, offset); \
544} \ 544} \
545static ssize_t \ 545static ssize_t \
546store_regs_fan_min##offset (struct device *dev, const char *buf, size_t count) \ 546store_regs_fan_min##offset (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \
547{ \ 547{ \
548 return store_fan_min(dev, buf, count, offset); \ 548 return store_fan_min(dev, buf, count, offset); \
549} \ 549} \
@@ -608,19 +608,19 @@ store_temp_reg(HYST, max_hyst);
608 608
609#define sysfs_temp_offset(offset) \ 609#define sysfs_temp_offset(offset) \
610static ssize_t \ 610static ssize_t \
611show_regs_temp_##offset (struct device *dev, char *buf) \ 611show_regs_temp_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
612{ \ 612{ \
613 return show_temp(dev, buf, offset); \ 613 return show_temp(dev, buf, offset); \
614} \ 614} \
615static DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_regs_temp_##offset, NULL); 615static DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_regs_temp_##offset, NULL);
616 616
617#define sysfs_temp_reg_offset(reg, offset) \ 617#define sysfs_temp_reg_offset(reg, offset) \
618static ssize_t show_regs_temp_##reg##offset (struct device *dev, char *buf) \ 618static ssize_t show_regs_temp_##reg##offset (struct device *dev, struct device_attribute *attr, char *buf) \
619{ \ 619{ \
620 return show_temp_##reg (dev, buf, offset); \ 620 return show_temp_##reg (dev, buf, offset); \
621} \ 621} \
622static ssize_t \ 622static ssize_t \
623store_regs_temp_##reg##offset (struct device *dev, \ 623store_regs_temp_##reg##offset (struct device *dev, struct device_attribute *attr, \
624 const char *buf, size_t count) \ 624 const char *buf, size_t count) \
625{ \ 625{ \
626 return store_temp_##reg (dev, buf, count, offset); \ 626 return store_temp_##reg (dev, buf, count, offset); \
@@ -645,7 +645,7 @@ device_create_file(&client->dev, &dev_attr_temp##offset##_max_hyst); \
645} while (0) 645} while (0)
646 646
647static ssize_t 647static ssize_t
648show_vid_reg(struct device *dev, char *buf) 648show_vid_reg(struct device *dev, struct device_attribute *attr, char *buf)
649{ 649{
650 struct w83627hf_data *data = w83627hf_update_device(dev); 650 struct w83627hf_data *data = w83627hf_update_device(dev);
651 return sprintf(buf, "%ld\n", (long) vid_from_reg(data->vid, data->vrm)); 651 return sprintf(buf, "%ld\n", (long) vid_from_reg(data->vid, data->vrm));
@@ -655,13 +655,13 @@ static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid_reg, NULL);
655device_create_file(&client->dev, &dev_attr_cpu0_vid) 655device_create_file(&client->dev, &dev_attr_cpu0_vid)
656 656
657static ssize_t 657static ssize_t
658show_vrm_reg(struct device *dev, char *buf) 658show_vrm_reg(struct device *dev, struct device_attribute *attr, char *buf)
659{ 659{
660 struct w83627hf_data *data = w83627hf_update_device(dev); 660 struct w83627hf_data *data = w83627hf_update_device(dev);
661 return sprintf(buf, "%ld\n", (long) data->vrm); 661 return sprintf(buf, "%ld\n", (long) data->vrm);
662} 662}
663static ssize_t 663static ssize_t
664store_vrm_reg(struct device *dev, const char *buf, size_t count) 664store_vrm_reg(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
665{ 665{
666 struct i2c_client *client = to_i2c_client(dev); 666 struct i2c_client *client = to_i2c_client(dev);
667 struct w83627hf_data *data = i2c_get_clientdata(client); 667 struct w83627hf_data *data = i2c_get_clientdata(client);
@@ -677,7 +677,7 @@ static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm_reg, store_vrm_reg);
677device_create_file(&client->dev, &dev_attr_vrm) 677device_create_file(&client->dev, &dev_attr_vrm)
678 678
679static ssize_t 679static ssize_t
680show_alarms_reg(struct device *dev, char *buf) 680show_alarms_reg(struct device *dev, struct device_attribute *attr, char *buf)
681{ 681{
682 struct w83627hf_data *data = w83627hf_update_device(dev); 682 struct w83627hf_data *data = w83627hf_update_device(dev);
683 return sprintf(buf, "%ld\n", (long) data->alarms); 683 return sprintf(buf, "%ld\n", (long) data->alarms);
@@ -687,7 +687,7 @@ static DEVICE_ATTR(alarms, S_IRUGO, show_alarms_reg, NULL);
687device_create_file(&client->dev, &dev_attr_alarms) 687device_create_file(&client->dev, &dev_attr_alarms)
688 688
689#define show_beep_reg(REG, reg) \ 689#define show_beep_reg(REG, reg) \
690static ssize_t show_beep_##reg (struct device *dev, char *buf) \ 690static ssize_t show_beep_##reg (struct device *dev, struct device_attribute *attr, char *buf) \
691{ \ 691{ \
692 struct w83627hf_data *data = w83627hf_update_device(dev); \ 692 struct w83627hf_data *data = w83627hf_update_device(dev); \
693 return sprintf(buf,"%ld\n", \ 693 return sprintf(buf,"%ld\n", \
@@ -732,12 +732,12 @@ store_beep_reg(struct device *dev, const char *buf, size_t count,
732} 732}
733 733
734#define sysfs_beep(REG, reg) \ 734#define sysfs_beep(REG, reg) \
735static ssize_t show_regs_beep_##reg (struct device *dev, char *buf) \ 735static ssize_t show_regs_beep_##reg (struct device *dev, struct device_attribute *attr, char *buf) \
736{ \ 736{ \
737 return show_beep_##reg(dev, buf); \ 737 return show_beep_##reg(dev, attr, buf); \
738} \ 738} \
739static ssize_t \ 739static ssize_t \
740store_regs_beep_##reg (struct device *dev, const char *buf, size_t count) \ 740store_regs_beep_##reg (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \
741{ \ 741{ \
742 return store_beep_reg(dev, buf, count, BEEP_##REG); \ 742 return store_beep_reg(dev, buf, count, BEEP_##REG); \
743} \ 743} \
@@ -801,12 +801,12 @@ store_fan_div_reg(struct device *dev, const char *buf, size_t count, int nr)
801} 801}
802 802
803#define sysfs_fan_div(offset) \ 803#define sysfs_fan_div(offset) \
804static ssize_t show_regs_fan_div_##offset (struct device *dev, char *buf) \ 804static ssize_t show_regs_fan_div_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
805{ \ 805{ \
806 return show_fan_div_reg(dev, buf, offset); \ 806 return show_fan_div_reg(dev, buf, offset); \
807} \ 807} \
808static ssize_t \ 808static ssize_t \
809store_regs_fan_div_##offset (struct device *dev, \ 809store_regs_fan_div_##offset (struct device *dev, struct device_attribute *attr, \
810 const char *buf, size_t count) \ 810 const char *buf, size_t count) \
811{ \ 811{ \
812 return store_fan_div_reg(dev, buf, count, offset - 1); \ 812 return store_fan_div_reg(dev, buf, count, offset - 1); \
@@ -861,12 +861,12 @@ store_pwm_reg(struct device *dev, const char *buf, size_t count, int nr)
861} 861}
862 862
863#define sysfs_pwm(offset) \ 863#define sysfs_pwm(offset) \
864static ssize_t show_regs_pwm_##offset (struct device *dev, char *buf) \ 864static ssize_t show_regs_pwm_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
865{ \ 865{ \
866 return show_pwm_reg(dev, buf, offset); \ 866 return show_pwm_reg(dev, buf, offset); \
867} \ 867} \
868static ssize_t \ 868static ssize_t \
869store_regs_pwm_##offset (struct device *dev, const char *buf, size_t count) \ 869store_regs_pwm_##offset (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \
870{ \ 870{ \
871 return store_pwm_reg(dev, buf, count, offset); \ 871 return store_pwm_reg(dev, buf, count, offset); \
872} \ 872} \
@@ -937,12 +937,12 @@ store_sensor_reg(struct device *dev, const char *buf, size_t count, int nr)
937} 937}
938 938
939#define sysfs_sensor(offset) \ 939#define sysfs_sensor(offset) \
940static ssize_t show_regs_sensor_##offset (struct device *dev, char *buf) \ 940static ssize_t show_regs_sensor_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
941{ \ 941{ \
942 return show_sensor_reg(dev, buf, offset); \ 942 return show_sensor_reg(dev, buf, offset); \
943} \ 943} \
944static ssize_t \ 944static ssize_t \
945store_regs_sensor_##offset (struct device *dev, const char *buf, size_t count) \ 945store_regs_sensor_##offset (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \
946{ \ 946{ \
947 return store_sensor_reg(dev, buf, count, offset); \ 947 return store_sensor_reg(dev, buf, count, offset); \
948} \ 948} \