aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-11-22 13:49:14 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-11-22 13:49:14 -0500
commit0032cdefff0f4ff5bd9464036d510a5441ec8b83 (patch)
treeb76effcbf3b21b19db94d7efd6ae35c85d8dba6b
parentd2c2ad54c485e7ebca5c0b7e4a7b2c56103fda38 (diff)
parent3a4cbc190643d0c6f7ca36a84af8367947f558c7 (diff)
Merge tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
Pull hwmon fixes from Guenter Roeck: - acpi_power_meter: Fix return value check from call to acpi_bus_get_device - nct6775: Fix/improve NCT6791 support - lm75: Add support for GMT G751 * tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: hwmon: (acpi_power_meter) Fix acpi_bus_get_device() return value check hwmon: (nct6775) NCT6791 supports weight control only for CPUFAN hwmon: (nct6775) Monitor additional temperature registers hwmon: (lm75) Add support for GMT G751 chip
-rw-r--r--Documentation/devicetree/bindings/i2c/trivial-devices.txt1
-rw-r--r--drivers/hwmon/Kconfig1
-rw-r--r--drivers/hwmon/acpi_power_meter.c5
-rw-r--r--drivers/hwmon/lm75.c3
-rw-r--r--drivers/hwmon/nct6775.c91
5 files changed, 88 insertions, 13 deletions
diff --git a/Documentation/devicetree/bindings/i2c/trivial-devices.txt b/Documentation/devicetree/bindings/i2c/trivial-devices.txt
index f1fb26eed0e9..b1cb3415e6f1 100644
--- a/Documentation/devicetree/bindings/i2c/trivial-devices.txt
+++ b/Documentation/devicetree/bindings/i2c/trivial-devices.txt
@@ -36,6 +36,7 @@ fsl,mc13892 MC13892: Power Management Integrated Circuit (PMIC) for i.MX35/51
36fsl,mma8450 MMA8450Q: Xtrinsic Low-power, 3-axis Xtrinsic Accelerometer 36fsl,mma8450 MMA8450Q: Xtrinsic Low-power, 3-axis Xtrinsic Accelerometer
37fsl,mpr121 MPR121: Proximity Capacitive Touch Sensor Controller 37fsl,mpr121 MPR121: Proximity Capacitive Touch Sensor Controller
38fsl,sgtl5000 SGTL5000: Ultra Low-Power Audio Codec 38fsl,sgtl5000 SGTL5000: Ultra Low-Power Audio Codec
39gmt,g751 G751: Digital Temperature Sensor and Thermal Watchdog with Two-Wire Interface
39infineon,slb9635tt Infineon SLB9635 (Soft-) I2C TPM (old protocol, max 100khz) 40infineon,slb9635tt Infineon SLB9635 (Soft-) I2C TPM (old protocol, max 100khz)
40infineon,slb9645tt Infineon SLB9645 I2C TPM (new protocol, max 400khz) 41infineon,slb9645tt Infineon SLB9645 I2C TPM (new protocol, max 400khz)
41maxim,ds1050 5 Bit Programmable, Pulse-Width Modulator 42maxim,ds1050 5 Bit Programmable, Pulse-Width Modulator
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
index b3ab9d43bb3e..52d548f1dc1d 100644
--- a/drivers/hwmon/Kconfig
+++ b/drivers/hwmon/Kconfig
@@ -656,6 +656,7 @@ config SENSORS_LM75
656 656
657 - Analog Devices ADT75 657 - Analog Devices ADT75
658 - Dallas Semiconductor DS75, DS1775 and DS7505 658 - Dallas Semiconductor DS75, DS1775 and DS7505
659 - Global Mixed-mode Technology (GMT) G751
659 - Maxim MAX6625 and MAX6626 660 - Maxim MAX6625 and MAX6626
660 - Microchip MCP980x 661 - Microchip MCP980x
661 - National Semiconductor LM75, LM75A 662 - National Semiconductor LM75, LM75A
diff --git a/drivers/hwmon/acpi_power_meter.c b/drivers/hwmon/acpi_power_meter.c
index 8d40da314a8e..6a34f7f48eb9 100644
--- a/drivers/hwmon/acpi_power_meter.c
+++ b/drivers/hwmon/acpi_power_meter.c
@@ -602,9 +602,8 @@ static int read_domain_devices(struct acpi_power_meter_resource *resource)
602 602
603 /* Create a symlink to domain objects */ 603 /* Create a symlink to domain objects */
604 resource->domain_devices[i] = NULL; 604 resource->domain_devices[i] = NULL;
605 status = acpi_bus_get_device(element->reference.handle, 605 if (acpi_bus_get_device(element->reference.handle,
606 &resource->domain_devices[i]); 606 &resource->domain_devices[i]))
607 if (ACPI_FAILURE(status))
608 continue; 607 continue;
609 608
610 obj = resource->domain_devices[i]; 609 obj = resource->domain_devices[i];
diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c
index c03b490bba81..7e3ef134f1d2 100644
--- a/drivers/hwmon/lm75.c
+++ b/drivers/hwmon/lm75.c
@@ -39,6 +39,7 @@ enum lm75_type { /* keep sorted in alphabetical order */
39 ds1775, 39 ds1775,
40 ds75, 40 ds75,
41 ds7505, 41 ds7505,
42 g751,
42 lm75, 43 lm75,
43 lm75a, 44 lm75a,
44 max6625, 45 max6625,
@@ -208,6 +209,7 @@ lm75_probe(struct i2c_client *client, const struct i2c_device_id *id)
208 data->resolution = 12; 209 data->resolution = 12;
209 data->sample_time = HZ / 4; 210 data->sample_time = HZ / 4;
210 break; 211 break;
212 case g751:
211 case lm75: 213 case lm75:
212 case lm75a: 214 case lm75a:
213 data->resolution = 9; 215 data->resolution = 9;
@@ -296,6 +298,7 @@ static const struct i2c_device_id lm75_ids[] = {
296 { "ds1775", ds1775, }, 298 { "ds1775", ds1775, },
297 { "ds75", ds75, }, 299 { "ds75", ds75, },
298 { "ds7505", ds7505, }, 300 { "ds7505", ds7505, },
301 { "g751", g751, },
299 { "lm75", lm75, }, 302 { "lm75", lm75, },
300 { "lm75a", lm75a, }, 303 { "lm75a", lm75a, },
301 { "max6625", max6625, }, 304 { "max6625", max6625, },
diff --git a/drivers/hwmon/nct6775.c b/drivers/hwmon/nct6775.c
index d17325db0ea3..cf811c1a1475 100644
--- a/drivers/hwmon/nct6775.c
+++ b/drivers/hwmon/nct6775.c
@@ -274,6 +274,8 @@ static const u16 NCT6775_FAN_PULSE_SHIFT[] = { 0, 0, 0, 0, 0, 0 };
274static const u16 NCT6775_REG_TEMP[] = { 274static const u16 NCT6775_REG_TEMP[] = {
275 0x27, 0x150, 0x250, 0x62b, 0x62c, 0x62d }; 275 0x27, 0x150, 0x250, 0x62b, 0x62c, 0x62d };
276 276
277static const u16 NCT6775_REG_TEMP_MON[] = { 0x73, 0x75, 0x77 };
278
277static const u16 NCT6775_REG_TEMP_CONFIG[ARRAY_SIZE(NCT6775_REG_TEMP)] = { 279static const u16 NCT6775_REG_TEMP_CONFIG[ARRAY_SIZE(NCT6775_REG_TEMP)] = {
278 0, 0x152, 0x252, 0x628, 0x629, 0x62A }; 280 0, 0x152, 0x252, 0x628, 0x629, 0x62A };
279static const u16 NCT6775_REG_TEMP_HYST[ARRAY_SIZE(NCT6775_REG_TEMP)] = { 281static const u16 NCT6775_REG_TEMP_HYST[ARRAY_SIZE(NCT6775_REG_TEMP)] = {
@@ -454,6 +456,7 @@ static const u16 NCT6779_REG_CRITICAL_PWM[] = {
454 0x137, 0x237, 0x337, 0x837, 0x937, 0xa37 }; 456 0x137, 0x237, 0x337, 0x837, 0x937, 0xa37 };
455 457
456static const u16 NCT6779_REG_TEMP[] = { 0x27, 0x150 }; 458static const u16 NCT6779_REG_TEMP[] = { 0x27, 0x150 };
459static const u16 NCT6779_REG_TEMP_MON[] = { 0x73, 0x75, 0x77, 0x79, 0x7b };
457static const u16 NCT6779_REG_TEMP_CONFIG[ARRAY_SIZE(NCT6779_REG_TEMP)] = { 460static const u16 NCT6779_REG_TEMP_CONFIG[ARRAY_SIZE(NCT6779_REG_TEMP)] = {
458 0x18, 0x152 }; 461 0x18, 0x152 };
459static const u16 NCT6779_REG_TEMP_HYST[ARRAY_SIZE(NCT6779_REG_TEMP)] = { 462static const u16 NCT6779_REG_TEMP_HYST[ARRAY_SIZE(NCT6779_REG_TEMP)] = {
@@ -507,6 +510,13 @@ static const u16 NCT6779_REG_TEMP_CRIT[ARRAY_SIZE(nct6779_temp_label) - 1]
507 510
508#define NCT6791_REG_HM_IO_SPACE_LOCK_ENABLE 0x28 511#define NCT6791_REG_HM_IO_SPACE_LOCK_ENABLE 0x28
509 512
513static const u16 NCT6791_REG_WEIGHT_TEMP_SEL[6] = { 0, 0x239 };
514static const u16 NCT6791_REG_WEIGHT_TEMP_STEP[6] = { 0, 0x23a };
515static const u16 NCT6791_REG_WEIGHT_TEMP_STEP_TOL[6] = { 0, 0x23b };
516static const u16 NCT6791_REG_WEIGHT_DUTY_STEP[6] = { 0, 0x23c };
517static const u16 NCT6791_REG_WEIGHT_TEMP_BASE[6] = { 0, 0x23d };
518static const u16 NCT6791_REG_WEIGHT_DUTY_BASE[6] = { 0, 0x23e };
519
510static const u16 NCT6791_REG_ALARM[NUM_REG_ALARM] = { 520static const u16 NCT6791_REG_ALARM[NUM_REG_ALARM] = {
511 0x459, 0x45A, 0x45B, 0x568, 0x45D }; 521 0x459, 0x45A, 0x45B, 0x568, 0x45D };
512 522
@@ -534,6 +544,7 @@ static const u16 NCT6106_REG_IN[] = {
534 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x07, 0x08, 0x09 }; 544 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x07, 0x08, 0x09 };
535 545
536static const u16 NCT6106_REG_TEMP[] = { 0x10, 0x11, 0x12, 0x13, 0x14, 0x15 }; 546static const u16 NCT6106_REG_TEMP[] = { 0x10, 0x11, 0x12, 0x13, 0x14, 0x15 };
547static const u16 NCT6106_REG_TEMP_MON[] = { 0x18, 0x19, 0x1a };
537static const u16 NCT6106_REG_TEMP_HYST[] = { 548static const u16 NCT6106_REG_TEMP_HYST[] = {
538 0xc3, 0xc7, 0xcb, 0xcf, 0xd3, 0xd7 }; 549 0xc3, 0xc7, 0xcb, 0xcf, 0xd3, 0xd7 };
539static const u16 NCT6106_REG_TEMP_OVER[] = { 550static const u16 NCT6106_REG_TEMP_OVER[] = {
@@ -1307,6 +1318,9 @@ static void nct6775_update_pwm(struct device *dev)
1307 if (reg & 0x80) 1318 if (reg & 0x80)
1308 data->pwm[2][i] = 0; 1319 data->pwm[2][i] = 0;
1309 1320
1321 if (!data->REG_WEIGHT_TEMP_SEL[i])
1322 continue;
1323
1310 reg = nct6775_read_value(data, data->REG_WEIGHT_TEMP_SEL[i]); 1324 reg = nct6775_read_value(data, data->REG_WEIGHT_TEMP_SEL[i]);
1311 data->pwm_weight_temp_sel[i] = reg & 0x1f; 1325 data->pwm_weight_temp_sel[i] = reg & 0x1f;
1312 /* If weight is disabled, report weight source as 0 */ 1326 /* If weight is disabled, report weight source as 0 */
@@ -2852,6 +2866,9 @@ static umode_t nct6775_pwm_is_visible(struct kobject *kobj,
2852 if (!(data->has_pwm & (1 << pwm))) 2866 if (!(data->has_pwm & (1 << pwm)))
2853 return 0; 2867 return 0;
2854 2868
2869 if ((nr >= 14 && nr <= 18) || nr == 21) /* weight */
2870 if (!data->REG_WEIGHT_TEMP_SEL[pwm])
2871 return 0;
2855 if (nr == 19 && data->REG_PWM[3] == NULL) /* pwm_max */ 2872 if (nr == 19 && data->REG_PWM[3] == NULL) /* pwm_max */
2856 return 0; 2873 return 0;
2857 if (nr == 20 && data->REG_PWM[4] == NULL) /* pwm_step */ 2874 if (nr == 20 && data->REG_PWM[4] == NULL) /* pwm_step */
@@ -2945,11 +2962,11 @@ static struct sensor_device_template *nct6775_attributes_pwm_template[] = {
2945 &sensor_dev_template_pwm_step_down_time, 2962 &sensor_dev_template_pwm_step_down_time,
2946 &sensor_dev_template_pwm_start, 2963 &sensor_dev_template_pwm_start,
2947 &sensor_dev_template_pwm_floor, 2964 &sensor_dev_template_pwm_floor,
2948 &sensor_dev_template_pwm_weight_temp_sel, 2965 &sensor_dev_template_pwm_weight_temp_sel, /* 14 */
2949 &sensor_dev_template_pwm_weight_temp_step, 2966 &sensor_dev_template_pwm_weight_temp_step,
2950 &sensor_dev_template_pwm_weight_temp_step_tol, 2967 &sensor_dev_template_pwm_weight_temp_step_tol,
2951 &sensor_dev_template_pwm_weight_temp_step_base, 2968 &sensor_dev_template_pwm_weight_temp_step_base,
2952 &sensor_dev_template_pwm_weight_duty_step, 2969 &sensor_dev_template_pwm_weight_duty_step, /* 18 */
2953 &sensor_dev_template_pwm_max, /* 19 */ 2970 &sensor_dev_template_pwm_max, /* 19 */
2954 &sensor_dev_template_pwm_step, /* 20 */ 2971 &sensor_dev_template_pwm_step, /* 20 */
2955 &sensor_dev_template_pwm_weight_duty_base, /* 21 */ 2972 &sensor_dev_template_pwm_weight_duty_base, /* 21 */
@@ -3253,9 +3270,9 @@ static int nct6775_probe(struct platform_device *pdev)
3253 int i, s, err = 0; 3270 int i, s, err = 0;
3254 int src, mask, available; 3271 int src, mask, available;
3255 const u16 *reg_temp, *reg_temp_over, *reg_temp_hyst, *reg_temp_config; 3272 const u16 *reg_temp, *reg_temp_over, *reg_temp_hyst, *reg_temp_config;
3256 const u16 *reg_temp_alternate, *reg_temp_crit;