aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-04-04 12:03:41 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-04-04 12:03:41 -0400
commit20d9d9a0544436b1b8c94689c01d746d6bd5525c (patch)
tree3a6db09d7855c77b1bc70d46fa6263ffaeef10c1
parent7114a72ff850ac6f8f5336c510a5a874c9eadf42 (diff)
parente16de9137c8beab02d78fb4fa82bb96e9f3d0ac3 (diff)
Merge tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
Pull hwmon patches from Guenter Roeck: - Fix crash in ad7314 driver - Add support for AMD Trinity CPUs to k10temp driver - Fix __initdata/__initconst mixup in w83627ehf driver - Fix runtime warnings in acpi_power_meter and max6639 drivers - Fix build warnings in adm1031, f75375s, sht15, and gpio-fan drivers * tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: hwmon: (ad7314) Adds missing spi_dev initialization hwmon: (k10temp) Add support for AMD Trinity CPUs hwmon: (w83627ehf) mark const init data with __initconst instead of __initdata hwmon: (acpi_power_meter) fix lockdep spew due to non-static lock class hwmon: (adm1031) Fix compiler warning hwmon: (f75375s) Fix warning message seen in some configurations hwmon: (max6639) Convert to dev_pm_ops hwmon: (sht15) Fix Kconfig dependencies hwmon: (gpio-fan) Fix Kconfig dependencies
-rw-r--r--Documentation/hwmon/k10temp2
-rw-r--r--drivers/hwmon/Kconfig7
-rw-r--r--drivers/hwmon/acpi_power_meter.c2
-rw-r--r--drivers/hwmon/ad7314.c1
-rw-r--r--drivers/hwmon/adm1031.c20
-rw-r--r--drivers/hwmon/f75375s.c2
-rw-r--r--drivers/hwmon/k10temp.c4
-rw-r--r--drivers/hwmon/max6639.c15
-rw-r--r--drivers/hwmon/w83627ehf.c18
9 files changed, 42 insertions, 29 deletions
diff --git a/Documentation/hwmon/k10temp b/Documentation/hwmon/k10temp
index a10f73624ad3..90956b618025 100644
--- a/Documentation/hwmon/k10temp
+++ b/Documentation/hwmon/k10temp
@@ -11,7 +11,7 @@ Supported chips:
11 Socket S1G2: Athlon (X2), Sempron (X2), Turion X2 (Ultra) 11 Socket S1G2: Athlon (X2), Sempron (X2), Turion X2 (Ultra)
12* AMD Family 12h processors: "Llano" (E2/A4/A6/A8-Series) 12* AMD Family 12h processors: "Llano" (E2/A4/A6/A8-Series)
13* AMD Family 14h processors: "Brazos" (C/E/G/Z-Series) 13* AMD Family 14h processors: "Brazos" (C/E/G/Z-Series)
14* AMD Family 15h processors: "Bulldozer" 14* AMD Family 15h processors: "Bulldozer" (FX-Series), "Trinity"
15 15
16 Prefix: 'k10temp' 16 Prefix: 'k10temp'
17 Addresses scanned: PCI space 17 Addresses scanned: PCI space
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
index 5b32d56dbb4d..8deedc1b9840 100644
--- a/drivers/hwmon/Kconfig
+++ b/drivers/hwmon/Kconfig
@@ -253,7 +253,8 @@ config SENSORS_K10TEMP
253 If you say yes here you get support for the temperature 253 If you say yes here you get support for the temperature
254 sensor(s) inside your CPU. Supported are later revisions of 254 sensor(s) inside your CPU. Supported are later revisions of
255 the AMD Family 10h and all revisions of the AMD Family 11h, 255 the AMD Family 10h and all revisions of the AMD Family 11h,
256 12h (Llano), 14h (Brazos) and 15h (Bulldozer) microarchitectures. 256 12h (Llano), 14h (Brazos) and 15h (Bulldozer/Trinity)
257 microarchitectures.
257 258
258 This driver can also be built as a module. If so, the module 259 This driver can also be built as a module. If so, the module
259 will be called k10temp. 260 will be called k10temp.
@@ -425,7 +426,7 @@ config SENSORS_GL520SM
425 426
426config SENSORS_GPIO_FAN 427config SENSORS_GPIO_FAN
427 tristate "GPIO fan" 428 tristate "GPIO fan"
428 depends on GENERIC_GPIO 429 depends on GPIOLIB
429 help 430 help
430 If you say yes here you get support for fans connected to GPIO lines. 431 If you say yes here you get support for fans connected to GPIO lines.
431 432
@@ -883,7 +884,7 @@ source drivers/hwmon/pmbus/Kconfig
883 884
884config SENSORS_SHT15 885config SENSORS_SHT15
885 tristate "Sensiron humidity and temperature sensors. SHT15 and compat." 886 tristate "Sensiron humidity and temperature sensors. SHT15 and compat."
886 depends on GENERIC_GPIO 887 depends on GPIOLIB
887 help 888 help
888 If you say yes here you get support for the Sensiron SHT10, SHT11, 889 If you say yes here you get support for the Sensiron SHT10, SHT11,
889 SHT15, SHT71, SHT75 humidity and temperature sensors. 890 SHT15, SHT71, SHT75 humidity and temperature sensors.
diff --git a/drivers/hwmon/acpi_power_meter.c b/drivers/hwmon/acpi_power_meter.c
index 554f046bcf20..145f13580ff0 100644
--- a/drivers/hwmon/acpi_power_meter.c
+++ b/drivers/hwmon/acpi_power_meter.c
@@ -632,6 +632,7 @@ static int register_ro_attrs(struct acpi_power_meter_resource *resource,
632 sensors->dev_attr.show = ro->show; 632 sensors->dev_attr.show = ro->show;
633 sensors->index = ro->index; 633 sensors->index = ro->index;
634 634
635 sysfs_attr_init(&sensors->dev_attr.attr);
635 res = device_create_file(dev, &sensors->dev_attr); 636 res = device_create_file(dev, &sensors->dev_attr);
636 if (res) { 637 if (res) {
637 sensors->dev_attr.attr.name = NULL; 638 sensors->dev_attr.attr.name = NULL;
@@ -661,6 +662,7 @@ static int register_rw_attrs(struct acpi_power_meter_resource *resource,
661 sensors->dev_attr.store = rw->set; 662 sensors->dev_attr.store = rw->set;
662 sensors->index = rw->index; 663 sensors->index = rw->index;
663 664
665 sysfs_attr_init(&sensors->dev_attr.attr);
664 res = device_create_file(dev, &sensors->dev_attr); 666 res = device_create_file(dev, &sensors->dev_attr);
665 if (res) { 667 if (res) {
666 sensors->dev_attr.attr.name = NULL; 668 sensors->dev_attr.attr.name = NULL;
diff --git a/drivers/hwmon/ad7314.c b/drivers/hwmon/ad7314.c
index 0e0cfcc36f8d..ce43642ef03e 100644
--- a/drivers/hwmon/ad7314.c
+++ b/drivers/hwmon/ad7314.c
@@ -128,6 +128,7 @@ static int __devinit ad7314_probe(struct spi_device *spi_dev)
128 ret = PTR_ERR(chip->hwmon_dev); 128 ret = PTR_ERR(chip->hwmon_dev);
129 goto error_remove_group; 129 goto error_remove_group;
130 } 130 }
131 chip->spi_dev = spi_dev;
131 132
132 return 0; 133 return 0;
133error_remove_group: 134error_remove_group:
diff --git a/drivers/hwmon/adm1031.c b/drivers/hwmon/adm1031.c
index ff37363ea5bc..44e1fd7f3d81 100644
--- a/drivers/hwmon/adm1031.c
+++ b/drivers/hwmon/adm1031.c
@@ -233,18 +233,15 @@ static const auto_chan_table_t auto_channel_select_table_adm1030 = {
233 * nearest match if no exact match where found. 233 * nearest match if no exact match where found.
234 */ 234 */
235static int 235static int
236get_fan_auto_nearest(struct adm1031_data *data, 236get_fan_auto_nearest(struct adm1031_data *data, int chan, u8 val, u8 reg)
237 int chan, u8 val, u8 reg, u8 *new_reg)
238{ 237{
239 int i; 238 int i;
240 int first_match = -1, exact_match = -1; 239 int first_match = -1, exact_match = -1;
241 u8 other_reg_val = 240 u8 other_reg_val =
242 (*data->chan_select_table)[FAN_CHAN_FROM_REG(reg)][chan ? 0 : 1]; 241 (*data->chan_select_table)[FAN_CHAN_FROM_REG(reg)][chan ? 0 : 1];
243 242
244 if (val == 0) { 243 if (val == 0)
245 *new_reg = 0;
246 return 0; 244 return 0;
247 }
248 245
249 for (i = 0; i < 8; i++) { 246 for (i = 0; i < 8; i++) {
250 if ((val == (*data->chan_select_table)[i][chan]) && 247 if ((val == (*data->chan_select_table)[i][chan]) &&
@@ -264,13 +261,11 @@ get_fan_auto_nearest(struct adm1031_data *data,
264 } 261 }
265 262
266 if (exact_match >= 0) 263 if (exact_match >= 0)
267 *new_reg = exact_match; 264 return exact_match;
268 else if (first_match >= 0) 265 else if (first_match >= 0)
269 *new_reg = first_match; 266 return first_match;
270 else
271 return -EINVAL;
272 267
273 return 0; 268 return -EINVAL;
274} 269}
275 270
276static ssize_t show_fan_auto_channel(struct device *dev, 271static ssize_t show_fan_auto_channel(struct device *dev,
@@ -301,11 +296,12 @@ set_fan_auto_channel(struct device *dev, struct device_attribute *attr,
301 296
302 mutex_lock(&data->update_lock); 297 mutex_lock(&data->update_lock);
303 298
304 ret = get_fan_auto_nearest(data, nr, val, data->conf1, &reg); 299 ret = get_fan_auto_nearest(data, nr, val, data->conf1);
305 if (ret) { 300 if (ret < 0) {
306 mutex_unlock(&data->update_lock); 301 mutex_unlock(&data->update_lock);
307 return ret; 302 return ret;
308 } 303 }
304 reg = ret;
309 data->conf1 = FAN_CHAN_TO_REG(reg, data->conf1); 305 data->conf1 = FAN_CHAN_TO_REG(reg, data->conf1);
310 if ((data->conf1 & ADM1031_CONF1_AUTO_MODE) ^ 306 if ((data->conf1 & ADM1031_CONF1_AUTO_MODE) ^
311 (old_fan_mode & ADM1031_CONF1_AUTO_MODE)) { 307 (old_fan_mode & ADM1031_CONF1_AUTO_MODE)) {
diff --git a/drivers/hwmon/f75375s.c b/drivers/hwmon/f75375s.c
index 729499e75210..ece4159bd453 100644
--- a/drivers/hwmon/f75375s.c
+++ b/drivers/hwmon/f75375s.c
@@ -276,6 +276,7 @@ static bool duty_mode_enabled(u8 pwm_enable)
276 return false; 276 return false;
277 default: 277 default:
278 BUG(); 278 BUG();
279 return true;
279 } 280 }
280} 281}
281 282
@@ -291,6 +292,7 @@ static bool auto_mode_enabled(u8 pwm_enable)
291 return true; 292 return true;
292 default: 293 default:
293 BUG(); 294 BUG();
295 return false;
294 } 296 }
295} 297}
296 298
diff --git a/drivers/hwmon/k10temp.c b/drivers/hwmon/k10temp.c
index aba29d63f195..307bb325dde9 100644
--- a/drivers/hwmon/k10temp.c
+++ b/drivers/hwmon/k10temp.c
@@ -33,6 +33,9 @@ static bool force;
33module_param(force, bool, 0444); 33module_param(force, bool, 0444);
34MODULE_PARM_DESC(force, "force loading on processors with erratum 319"); 34MODULE_PARM_DESC(force, "force loading on processors with erratum 319");
35 35
36/* PCI-IDs for Northbridge devices not used anywhere else */
37#define PCI_DEVICE_ID_AMD_15H_M10H_NB_F3 0x1403
38
36/* CPUID function 0x80000001, ebx */ 39/* CPUID function 0x80000001, ebx */
37#define CPUID_PKGTYPE_MASK 0xf0000000 40#define CPUID_PKGTYPE_MASK 0xf0000000
38#define CPUID_PKGTYPE_F 0x00000000 41#define CPUID_PKGTYPE_F 0x00000000
@@ -210,6 +213,7 @@ static DEFINE_PCI_DEVICE_TABLE(k10temp_id_table) = {
210 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_11H_NB_MISC) }, 213 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_11H_NB_MISC) },
211 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_CNB17H_F3) }, 214 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_CNB17H_F3) },
212 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_NB_F3) }, 215 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_NB_F3) },
216 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_M10H_NB_F3) },
213 {} 217 {}
214}; 218};
215MODULE_DEVICE_TABLE(pci, k10temp_id_table); 219MODULE_DEVICE_TABLE(pci, k10temp_id_table);
diff --git a/drivers/hwmon/max6639.c b/drivers/hwmon/max6639.c
index 193067e27b6f..de8f7adaccbd 100644
--- a/drivers/hwmon/max6639.c
+++ b/drivers/hwmon/max6639.c
@@ -596,8 +596,10 @@ static int max6639_remove(struct i2c_client *client)
596 return 0; 596 return 0;
597} 597}
598 598
599static int max6639_suspend(struct i2c_client *client, pm_message_t mesg) 599#ifdef CONFIG_PM_SLEEP
600static int max6639_suspend(struct device *dev)
600{ 601{
602 struct i2c_client *client = to_i2c_client(dev);
601 int data = i2c_smbus_read_byte_data(client, MAX6639_REG_GCONFIG); 603 int data = i2c_smbus_read_byte_data(client, MAX6639_REG_GCONFIG);
602 if (data < 0) 604 if (data < 0)
603 return data; 605 return data;
@@ -606,8 +608,9 @@ static int max6639_suspend(struct i2c_client *client, pm_message_t mesg)
606 MAX6639_REG_GCONFIG, data | MAX6639_GCONFIG_STANDBY); 608 MAX6639_REG_GCONFIG, data | MAX6639_GCONFIG_STANDBY);
607} 609}
608 610
609static int max6639_resume(struct i2c_client *client) 611static int max6639_resume(struct device *dev)
610{ 612{
613 struct i2c_client *client = to_i2c_client(dev);
611 int data = i2c_smbus_read_byte_data(client, MAX6639_REG_GCONFIG); 614 int data = i2c_smbus_read_byte_data(client, MAX6639_REG_GCONFIG);
612 if (data < 0) 615 if (data < 0)
613 return data; 616 return data;
@@ -615,6 +618,7 @@ static int max6639_resume(struct i2c_client *client)
615 return i2c_smbus_write_byte_data(client, 618 return i2c_smbus_write_byte_data(client,
616 MAX6639_REG_GCONFIG, data & ~MAX6639_GCONFIG_STANDBY); 619 MAX6639_REG_GCONFIG, data & ~MAX6639_GCONFIG_STANDBY);
617} 620}
621#endif /* CONFIG_PM_SLEEP */
618 622
619static const struct i2c_device_id max6639_id[] = { 623static const struct i2c_device_id max6639_id[] = {
620 {"max6639", 0}, 624 {"max6639", 0},
@@ -623,15 +627,18 @@ static const struct i2c_device_id max6639_id[] = {
623 627
624MODULE_DEVICE_TABLE(i2c, max6639_id); 628MODULE_DEVICE_TABLE(i2c, max6639_id);
625 629
630static const struct dev_pm_ops max6639_pm_ops = {
631 SET_SYSTEM_SLEEP_PM_OPS(max6639_suspend, max6639_resume)
632};
633
626static struct i2c_driver max6639_driver = { 634static struct i2c_driver max6639_driver = {
627 .class = I2C_CLASS_HWMON, 635 .class = I2C_CLASS_HWMON,
628 .driver = { 636 .driver = {
629 .name = "max6639", 637 .name = "max6639",
638 .pm = &max6639_pm_ops,
630 }, 639 },
631 .probe = max6639_probe, 640 .probe = max6639_probe,
632 .remove = max6639_remove, 641 .remove = max6639_remove,
633 .suspend = max6639_suspend,
634 .resume = max6639_resume,
635 .id_table = max6639_id, 642 .id_table = max6639_id,
636 .detect = max6639_detect, 643 .detect = max6639_detect,
637 .address_list = normal_i2c, 644 .address_list = normal_i2c,
diff --git a/drivers/hwmon/w83627ehf.c b/drivers/hwmon/w83627ehf.c
index a25350cf9554..54922ed12978 100644
--- a/drivers/hwmon/w83627ehf.c
+++ b/drivers/hwmon/w83627ehf.c
@@ -2619,15 +2619,15 @@ static struct platform_driver w83627ehf_driver = {
2619static int __init w83627ehf_find(int sioaddr, unsigned short *addr, 2619static int __init w83627ehf_find(int sioaddr, unsigned short *addr,
2620 struct w83627ehf_sio_data *sio_data) 2620 struct w83627ehf_sio_data *sio_data)
2621{ 2621{
2622 static const char __initdata sio_name_W83627EHF[] = "W83627EHF"; 2622 static const char sio_name_W83627EHF[] __initconst = "W83627EHF";
2623 static const char __initdata sio_name_W83627EHG[] = "W83627EHG"; 2623 static const char sio_name_W83627EHG[] __initconst = "W83627EHG";
2624 static const char __initdata sio_name_W83627DHG[] = "W83627DHG"; 2624 static const char sio_name_W83627DHG[] __initconst = "W83627DHG";
2625 static const char __initdata sio_name_W83627DHG_P[] = "W83627DHG-P"; 2625 static const char sio_name_W83627DHG_P[] __initconst = "W83627DHG-P";
2626 static const char __initdata sio_name_W83627UHG[] = "W83627UHG"; 2626 static const char sio_name_W83627UHG[] __initconst = "W83627UHG";
2627 static const char __initdata sio_name_W83667HG[] = "W83667HG"; 2627 static const char sio_name_W83667HG[] __initconst = "W83667HG";
2628 static const char __initdata sio_name_W83667HG_B[] = "W83667HG-B"; 2628 static const char sio_name_W83667HG_B[] __initconst = "W83667HG-B";
2629 static const char __initdata sio_name_NCT6775[] = "NCT6775F"; 2629 static const char sio_name_NCT6775[] __initconst = "NCT6775F";
2630 static const char __initdata sio_name_NCT6776[] = "NCT6776F"; 2630 static const char sio_name_NCT6776[] __initconst = "NCT6776F";
2631 2631
2632 u16 val; 2632 u16 val;
2633 const char *sio_name; 2633 const char *sio_name;