diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-15 20:13:39 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-15 20:13:39 -0400 |
commit | 538e7e96fd028e628d79f27c05a9a61ff9d01c7c (patch) | |
tree | fb0451b8eb7dbbf54b2d15bf8e2e1fb06f645543 /drivers | |
parent | 0c48ca8512ec099059fc532de57dbc6ffbccfb86 (diff) | |
parent | fecfb64422d91a9621a3f96ab75c3a5f13e80b58 (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.
* tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
hwmon: (zl6100) Enable interval between chip accesses for all chips
hwmon: (w83627ehf) Describe undocumented pwm attributes
hwmon: (w83627ehf) Fix temp2 source for W83627UHG
hwmon: (w83627ehf) Fix memory leak in probe function
hwmon: (w83627ehf) Fix writing into fan_stop_time for NCT6775F/NCT6776F
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/hwmon/pmbus/zl6100.c | 12 | ||||
-rw-r--r-- | drivers/hwmon/w83627ehf.c | 17 |
2 files changed, 11 insertions, 18 deletions
diff --git a/drivers/hwmon/pmbus/zl6100.c b/drivers/hwmon/pmbus/zl6100.c index 880b90cf4d32..e3e8420b7b81 100644 --- a/drivers/hwmon/pmbus/zl6100.c +++ b/drivers/hwmon/pmbus/zl6100.c | |||
@@ -200,17 +200,11 @@ static int zl6100_probe(struct i2c_client *client, | |||
200 | data->id = mid->driver_data; | 200 | data->id = mid->driver_data; |
201 | 201 | ||
202 | /* | 202 | /* |
203 | * ZL2005, ZL2008, ZL2105, and ZL6100 are known to require a wait time | 203 | * According to information from the chip vendor, all currently |
204 | * between I2C accesses. ZL2004 and ZL6105 are known to be safe. | 204 | * supported chips are known to require a wait time between I2C |
205 | * Other chips have not yet been tested. | 205 | * accesses. |
206 | * | ||
207 | * Only clear the wait time for chips known to be safe. The wait time | ||
208 | * can be cleared later for additional chips if tests show that it | ||
209 | * is not needed (in other words, better be safe than sorry). | ||
210 | */ | 206 | */ |
211 | data->delay = delay; | 207 | data->delay = delay; |
212 | if (data->id == zl2004 || data->id == zl6105) | ||
213 | data->delay = 0; | ||
214 | 208 | ||
215 | /* | 209 | /* |
216 | * Since there was a direct I2C device access above, wait before | 210 | * Since there was a direct I2C device access above, wait before |
diff --git a/drivers/hwmon/w83627ehf.c b/drivers/hwmon/w83627ehf.c index 5276d1933dbc..a658d62c5e10 100644 --- a/drivers/hwmon/w83627ehf.c +++ b/drivers/hwmon/w83627ehf.c | |||
@@ -39,7 +39,7 @@ | |||
39 | 0x8860 0xa1 | 39 | 0x8860 0xa1 |
40 | w83627dhg 9 5 4 3 0xa020 0xc1 0x5ca3 | 40 | w83627dhg 9 5 4 3 0xa020 0xc1 0x5ca3 |
41 | w83627dhg-p 9 5 4 3 0xb070 0xc1 0x5ca3 | 41 | w83627dhg-p 9 5 4 3 0xb070 0xc1 0x5ca3 |
42 | w83627uhg 8 2 2 2 0xa230 0xc1 0x5ca3 | 42 | w83627uhg 8 2 2 3 0xa230 0xc1 0x5ca3 |
43 | w83667hg 9 5 3 3 0xa510 0xc1 0x5ca3 | 43 | w83667hg 9 5 3 3 0xa510 0xc1 0x5ca3 |
44 | w83667hg-b 9 5 3 4 0xb350 0xc1 0x5ca3 | 44 | w83667hg-b 9 5 3 4 0xb350 0xc1 0x5ca3 |
45 | nct6775f 9 4 3 9 0xb470 0xc1 0x5ca3 | 45 | nct6775f 9 4 3 9 0xb470 0xc1 0x5ca3 |
@@ -1607,7 +1607,7 @@ store_##reg(struct device *dev, struct device_attribute *attr, \ | |||
1607 | val = step_time_to_reg(val, data->pwm_mode[nr]); \ | 1607 | val = step_time_to_reg(val, data->pwm_mode[nr]); \ |
1608 | mutex_lock(&data->update_lock); \ | 1608 | mutex_lock(&data->update_lock); \ |
1609 | data->reg[nr] = val; \ | 1609 | data->reg[nr] = val; \ |
1610 | w83627ehf_write_value(data, W83627EHF_REG_##REG[nr], val); \ | 1610 | w83627ehf_write_value(data, data->REG_##REG[nr], val); \ |
1611 | mutex_unlock(&data->update_lock); \ | 1611 | mutex_unlock(&data->update_lock); \ |
1612 | return count; \ | 1612 | return count; \ |
1613 | } \ | 1613 | } \ |
@@ -2004,7 +2004,8 @@ static int __devinit w83627ehf_probe(struct platform_device *pdev) | |||
2004 | goto exit; | 2004 | goto exit; |
2005 | } | 2005 | } |
2006 | 2006 | ||
2007 | data = kzalloc(sizeof(struct w83627ehf_data), GFP_KERNEL); | 2007 | data = devm_kzalloc(&pdev->dev, sizeof(struct w83627ehf_data), |
2008 | GFP_KERNEL); | ||
2008 | if (!data) { | 2009 | if (!data) { |
2009 | err = -ENOMEM; | 2010 | err = -ENOMEM; |
2010 | goto exit_release; | 2011 | goto exit_release; |
@@ -2157,16 +2158,16 @@ static int __devinit w83627ehf_probe(struct platform_device *pdev) | |||
2157 | w83627ehf_set_temp_reg_ehf(data, 3); | 2158 | w83627ehf_set_temp_reg_ehf(data, 3); |
2158 | 2159 | ||
2159 | /* | 2160 | /* |
2160 | * Temperature sources for temp1 and temp2 are selected with | 2161 | * Temperature sources for temp2 and temp3 are selected with |
2161 | * bank 0, registers 0x49 and 0x4a. | 2162 | * bank 0, registers 0x49 and 0x4a. |
2162 | */ | 2163 | */ |
2163 | data->temp_src[0] = 0; /* SYSTIN */ | 2164 | data->temp_src[0] = 0; /* SYSTIN */ |
2164 | reg = w83627ehf_read_value(data, 0x49) & 0x07; | 2165 | reg = w83627ehf_read_value(data, 0x49) & 0x07; |
2165 | /* Adjust to have the same mapping as other source registers */ | 2166 | /* Adjust to have the same mapping as other source registers */ |
2166 | if (reg == 0) | 2167 | if (reg == 0) |
2167 | data->temp_src[1]++; | 2168 | data->temp_src[1] = 1; |
2168 | else if (reg >= 2 && reg <= 5) | 2169 | else if (reg >= 2 && reg <= 5) |
2169 | data->temp_src[1] += 2; | 2170 | data->temp_src[1] = reg + 2; |
2170 | else /* should never happen */ | 2171 | else /* should never happen */ |
2171 | data->have_temp &= ~(1 << 1); | 2172 | data->have_temp &= ~(1 << 1); |
2172 | reg = w83627ehf_read_value(data, 0x4a); | 2173 | reg = w83627ehf_read_value(data, 0x4a); |
@@ -2493,9 +2494,8 @@ static int __devinit w83627ehf_probe(struct platform_device *pdev) | |||
2493 | 2494 | ||
2494 | exit_remove: | 2495 | exit_remove: |
2495 | w83627ehf_device_remove_files(dev); | 2496 | w83627ehf_device_remove_files(dev); |
2496 | kfree(data); | ||
2497 | platform_set_drvdata(pdev, NULL); | ||
2498 | exit_release: | 2497 | exit_release: |
2498 | platform_set_drvdata(pdev, NULL); | ||
2499 | release_region(res->start, IOREGION_LENGTH); | 2499 | release_region(res->start, IOREGION_LENGTH); |
2500 | exit: | 2500 | exit: |
2501 | return err; | 2501 | return err; |
@@ -2509,7 +2509,6 @@ static int __devexit w83627ehf_remove(struct platform_device *pdev) | |||
2509 | w83627ehf_device_remove_files(&pdev->dev); | 2509 | w83627ehf_device_remove_files(&pdev->dev); |
2510 | release_region(data->addr, IOREGION_LENGTH); | 2510 | release_region(data->addr, IOREGION_LENGTH); |
2511 | platform_set_drvdata(pdev, NULL); | 2511 | platform_set_drvdata(pdev, NULL); |
2512 | kfree(data); | ||
2513 | 2512 | ||
2514 | return 0; | 2513 | return 0; |
2515 | } | 2514 | } |