Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/staging

* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/staging:
hwmon: (lm85) extend to support EMC6D103 chips
MAINTAINERS: Remove stale hwmon quilt tree
hwmon: (k10temp) add support for AMD Family 12h/14h CPUs
hwmon: (jc42) do not allow writing to locked registers
hwmon: (jc42) more helpful documentation
hwmon: (jc42) fix type mismatch

+86 -26
+15 -6
Documentation/hwmon/jc42
··· 51 * JEDEC JC 42.4 compliant temperature sensor chips 52 Prefix: 'jc42' 53 Addresses scanned: I2C 0x18 - 0x1f 54 - Datasheet: - 55 56 Author: 57 Guenter Roeck <guenter.roeck@ericsson.com> ··· 61 Description 62 ----------- 63 64 - This driver implements support for JEDEC JC 42.4 compliant temperature sensors. 65 The driver auto-detects the chips listed above, but can be manually instantiated 66 to support other JC 42.4 compliant chips. 67 ··· 86 which applies to all limits. This register can be written by writing into 87 temp1_crit_hyst. Other hysteresis attributes are read-only. 88 89 Sysfs entries 90 ------------- 91 92 temp1_input Temperature (RO) 93 - temp1_min Minimum temperature (RW) 94 - temp1_max Maximum temperature (RW) 95 - temp1_crit Critical high temperature (RW) 96 97 - temp1_crit_hyst Critical hysteresis temperature (RW) 98 temp1_max_hyst Maximum hysteresis temperature (RO) 99 100 temp1_min_alarm Temperature low alarm
··· 51 * JEDEC JC 42.4 compliant temperature sensor chips 52 Prefix: 'jc42' 53 Addresses scanned: I2C 0x18 - 0x1f 54 + Datasheet: 55 + http://www.jedec.org/sites/default/files/docs/4_01_04R19.pdf 56 57 Author: 58 Guenter Roeck <guenter.roeck@ericsson.com> ··· 60 Description 61 ----------- 62 63 + This driver implements support for JEDEC JC 42.4 compliant temperature sensors, 64 + which are used on many DDR3 memory modules for mobile devices and servers. Some 65 + systems use the sensor to prevent memory overheating by automatically throttling 66 + the memory controller. 67 + 68 The driver auto-detects the chips listed above, but can be manually instantiated 69 to support other JC 42.4 compliant chips. 70 ··· 81 which applies to all limits. This register can be written by writing into 82 temp1_crit_hyst. Other hysteresis attributes are read-only. 83 84 + If the BIOS has configured the sensor for automatic temperature management, it 85 + is likely that it has locked the registers, i.e., that the temperature limits 86 + cannot be changed. 87 + 88 Sysfs entries 89 ------------- 90 91 temp1_input Temperature (RO) 92 + temp1_min Minimum temperature (RO or RW) 93 + temp1_max Maximum temperature (RO or RW) 94 + temp1_crit Critical high temperature (RO or RW) 95 96 + temp1_crit_hyst Critical hysteresis temperature (RO or RW) 97 temp1_max_hyst Maximum hysteresis temperature (RO) 98 99 temp1_min_alarm Temperature low alarm
+7 -1
Documentation/hwmon/k10temp
··· 9 Socket S1G3: Athlon II, Sempron, Turion II 10 * AMD Family 11h processors: 11 Socket S1G2: Athlon (X2), Sempron (X2), Turion X2 (Ultra) 12 13 Prefix: 'k10temp' 14 Addresses scanned: PCI space ··· 19 http://support.amd.com/us/Processor_TechDocs/31116.pdf 20 BIOS and Kernel Developer's Guide (BKDG) for AMD Family 11h Processors: 21 http://support.amd.com/us/Processor_TechDocs/41256.pdf 22 Revision Guide for AMD Family 10h Processors: 23 http://support.amd.com/us/Processor_TechDocs/41322.pdf 24 Revision Guide for AMD Family 11h Processors: 25 http://support.amd.com/us/Processor_TechDocs/41788.pdf 26 AMD Family 11h Processor Power and Thermal Data Sheet for Notebooks: 27 http://support.amd.com/us/Processor_TechDocs/43373.pdf 28 AMD Family 10h Server and Workstation Processor Power and Thermal Data Sheet: ··· 40 ----------- 41 42 This driver permits reading of the internal temperature sensor of AMD 43 - Family 10h and 11h processors. 44 45 All these processors have a sensor, but on those for Socket F or AM2+, 46 the sensor may return inconsistent values (erratum 319). The driver
··· 9 Socket S1G3: Athlon II, Sempron, Turion II 10 * AMD Family 11h processors: 11 Socket S1G2: Athlon (X2), Sempron (X2), Turion X2 (Ultra) 12 + * AMD Family 12h processors: "Llano" 13 + * AMD Family 14h processors: "Brazos" (C/E/G-Series) 14 15 Prefix: 'k10temp' 16 Addresses scanned: PCI space ··· 17 http://support.amd.com/us/Processor_TechDocs/31116.pdf 18 BIOS and Kernel Developer's Guide (BKDG) for AMD Family 11h Processors: 19 http://support.amd.com/us/Processor_TechDocs/41256.pdf 20 + BIOS and Kernel Developer's Guide (BKDG) for AMD Family 14h Models 00h-0Fh Processors: 21 + http://support.amd.com/us/Processor_TechDocs/43170.pdf 22 Revision Guide for AMD Family 10h Processors: 23 http://support.amd.com/us/Processor_TechDocs/41322.pdf 24 Revision Guide for AMD Family 11h Processors: 25 http://support.amd.com/us/Processor_TechDocs/41788.pdf 26 + Revision Guide for AMD Family 14h Models 00h-0Fh Processors: 27 + http://support.amd.com/us/Processor_TechDocs/47534.pdf 28 AMD Family 11h Processor Power and Thermal Data Sheet for Notebooks: 29 http://support.amd.com/us/Processor_TechDocs/43373.pdf 30 AMD Family 10h Server and Workstation Processor Power and Thermal Data Sheet: ··· 34 ----------- 35 36 This driver permits reading of the internal temperature sensor of AMD 37 + Family 10h/11h/12h/14h processors. 38 39 All these processors have a sensor, but on those for Socket F or AM2+, 40 the sensor may return inconsistent values (erratum 319). The driver
-1
MAINTAINERS
··· 2873 L: lm-sensors@lm-sensors.org 2874 W: http://www.lm-sensors.org/ 2875 T: quilt kernel.org/pub/linux/kernel/people/jdelvare/linux-2.6/jdelvare-hwmon/ 2876 - T: quilt kernel.org/pub/linux/kernel/people/groeck/linux-staging/ 2877 T: git git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git 2878 S: Maintained 2879 F: Documentation/hwmon/
··· 2873 L: lm-sensors@lm-sensors.org 2874 W: http://www.lm-sensors.org/ 2875 T: quilt kernel.org/pub/linux/kernel/people/jdelvare/linux-2.6/jdelvare-hwmon/ 2876 T: git git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git 2877 S: Maintained 2878 F: Documentation/hwmon/
+10 -9
drivers/hwmon/Kconfig
··· 238 will be called k8temp. 239 240 config SENSORS_K10TEMP 241 - tristate "AMD Phenom/Sempron/Turion/Opteron temperature sensor" 242 depends on X86 && PCI 243 help 244 If you say yes here you get support for the temperature 245 sensor(s) inside your CPU. Supported are later revisions of 246 - the AMD Family 10h and all revisions of the AMD Family 11h 247 - microarchitectures. 248 249 This driver can also be built as a module. If so, the module 250 will be called k10temp. ··· 455 called jz4740-hwmon. 456 457 config SENSORS_JC42 458 - tristate "JEDEC JC42.4 compliant temperature sensors" 459 depends on I2C 460 help 461 - If you say yes here you get support for Jedec JC42.4 compliant 462 - temperature sensors. Support will include, but not be limited to, 463 - ADT7408, CAT34TS02,, CAT6095, MAX6604, MCP9805, MCP98242, MCP98243, 464 - MCP9843, SE97, SE98, STTS424, TSE2002B3, and TS3000B3. 465 466 This driver can also be built as a module. If so, the module 467 will be called jc42. ··· 575 help 576 If you say yes here you get support for National Semiconductor LM85 577 sensor chips and clones: ADM1027, ADT7463, ADT7468, EMC6D100, 578 - EMC6D101 and EMC6D102. 579 580 This driver can also be built as a module. If so, the module 581 will be called lm85.
··· 238 will be called k8temp. 239 240 config SENSORS_K10TEMP 241 + tristate "AMD Family 10h/11h/12h/14h temperature sensor" 242 depends on X86 && PCI 243 help 244 If you say yes here you get support for the temperature 245 sensor(s) inside your CPU. Supported are later revisions of 246 + the AMD Family 10h and all revisions of the AMD Family 11h, 247 + 12h (Llano), and 14h (Brazos) microarchitectures. 248 249 This driver can also be built as a module. If so, the module 250 will be called k10temp. ··· 455 called jz4740-hwmon. 456 457 config SENSORS_JC42 458 + tristate "JEDEC JC42.4 compliant memory module temperature sensors" 459 depends on I2C 460 help 461 + If you say yes here, you get support for JEDEC JC42.4 compliant 462 + temperature sensors, which are used on many DDR3 memory modules for 463 + mobile devices and servers. Support will include, but not be limited 464 + to, ADT7408, CAT34TS02, CAT6095, MAX6604, MCP9805, MCP98242, MCP98243, 465 + MCP9843, SE97, SE98, STTS424(E), TSE2002B3, and TS3000B3. 466 467 This driver can also be built as a module. If so, the module 468 will be called jc42. ··· 574 help 575 If you say yes here you get support for National Semiconductor LM85 576 sensor chips and clones: ADM1027, ADT7463, ADT7468, EMC6D100, 577 + EMC6D101, EMC6D102, and EMC6D103. 578 579 This driver can also be built as a module. If so, the module 580 will be called lm85.
+30 -5
drivers/hwmon/jc42.c
··· 53 54 /* Configuration register defines */ 55 #define JC42_CFG_CRIT_ONLY (1 << 2) 56 #define JC42_CFG_SHUTDOWN (1 << 8) 57 #define JC42_CFG_HYST_SHIFT 9 58 #define JC42_CFG_HYST_MASK 0x03 ··· 334 { 335 struct i2c_client *client = to_i2c_client(dev); 336 struct jc42_data *data = i2c_get_clientdata(client); 337 - long val; 338 int diff, hyst; 339 int err; 340 int ret = count; ··· 382 383 static DEVICE_ATTR(temp1_input, S_IRUGO, 384 show_temp_input, NULL); 385 - static DEVICE_ATTR(temp1_crit, S_IWUSR | S_IRUGO, 386 show_temp_crit, set_temp_crit); 387 - static DEVICE_ATTR(temp1_min, S_IWUSR | S_IRUGO, 388 show_temp_min, set_temp_min); 389 - static DEVICE_ATTR(temp1_max, S_IWUSR | S_IRUGO, 390 show_temp_max, set_temp_max); 391 392 - static DEVICE_ATTR(temp1_crit_hyst, S_IWUSR | S_IRUGO, 393 show_temp_crit_hyst, set_temp_crit_hyst); 394 static DEVICE_ATTR(temp1_max_hyst, S_IRUGO, 395 show_temp_max_hyst, NULL); ··· 414 NULL 415 }; 416 417 static const struct attribute_group jc42_group = { 418 .attrs = jc42_attributes, 419 }; 420 421 /* Return 0 if detection is successful, -ENODEV otherwise */
··· 53 54 /* Configuration register defines */ 55 #define JC42_CFG_CRIT_ONLY (1 << 2) 56 + #define JC42_CFG_TCRIT_LOCK (1 << 6) 57 + #define JC42_CFG_EVENT_LOCK (1 << 7) 58 #define JC42_CFG_SHUTDOWN (1 << 8) 59 #define JC42_CFG_HYST_SHIFT 9 60 #define JC42_CFG_HYST_MASK 0x03 ··· 332 { 333 struct i2c_client *client = to_i2c_client(dev); 334 struct jc42_data *data = i2c_get_clientdata(client); 335 + unsigned long val; 336 int diff, hyst; 337 int err; 338 int ret = count; ··· 380 381 static DEVICE_ATTR(temp1_input, S_IRUGO, 382 show_temp_input, NULL); 383 + static DEVICE_ATTR(temp1_crit, S_IRUGO, 384 show_temp_crit, set_temp_crit); 385 + static DEVICE_ATTR(temp1_min, S_IRUGO, 386 show_temp_min, set_temp_min); 387 + static DEVICE_ATTR(temp1_max, S_IRUGO, 388 show_temp_max, set_temp_max); 389 390 + static DEVICE_ATTR(temp1_crit_hyst, S_IRUGO, 391 show_temp_crit_hyst, set_temp_crit_hyst); 392 static DEVICE_ATTR(temp1_max_hyst, S_IRUGO, 393 show_temp_max_hyst, NULL); ··· 412 NULL 413 }; 414 415 + static mode_t jc42_attribute_mode(struct kobject *kobj, 416 + struct attribute *attr, int index) 417 + { 418 + struct device *dev = container_of(kobj, struct device, kobj); 419 + struct i2c_client *client = to_i2c_client(dev); 420 + struct jc42_data *data = i2c_get_clientdata(client); 421 + unsigned int config = data->config; 422 + bool readonly; 423 + 424 + if (attr == &dev_attr_temp1_crit.attr) 425 + readonly = config & JC42_CFG_TCRIT_LOCK; 426 + else if (attr == &dev_attr_temp1_min.attr || 427 + attr == &dev_attr_temp1_max.attr) 428 + readonly = config & JC42_CFG_EVENT_LOCK; 429 + else if (attr == &dev_attr_temp1_crit_hyst.attr) 430 + readonly = config & (JC42_CFG_EVENT_LOCK | JC42_CFG_TCRIT_LOCK); 431 + else 432 + readonly = true; 433 + 434 + return S_IRUGO | (readonly ? 0 : S_IWUSR); 435 + } 436 + 437 static const struct attribute_group jc42_group = { 438 .attrs = jc42_attributes, 439 + .is_visible = jc42_attribute_mode, 440 }; 441 442 /* Return 0 if detection is successful, -ENODEV otherwise */
+3 -2
drivers/hwmon/k10temp.c
··· 1 /* 2 - * k10temp.c - AMD Family 10h/11h processor hardware monitoring 3 * 4 * Copyright (c) 2009 Clemens Ladisch <clemens@ladisch.de> 5 * ··· 25 #include <linux/pci.h> 26 #include <asm/processor.h> 27 28 - MODULE_DESCRIPTION("AMD Family 10h/11h CPU core temperature monitor"); 29 MODULE_AUTHOR("Clemens Ladisch <clemens@ladisch.de>"); 30 MODULE_LICENSE("GPL"); 31 ··· 208 static const struct pci_device_id k10temp_id_table[] = { 209 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_10H_NB_MISC) }, 210 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_11H_NB_MISC) }, 211 {} 212 }; 213 MODULE_DEVICE_TABLE(pci, k10temp_id_table);
··· 1 /* 2 + * k10temp.c - AMD Family 10h/11h/12h/14h processor hardware monitoring 3 * 4 * Copyright (c) 2009 Clemens Ladisch <clemens@ladisch.de> 5 * ··· 25 #include <linux/pci.h> 26 #include <asm/processor.h> 27 28 + MODULE_DESCRIPTION("AMD Family 10h/11h/12h/14h CPU core temperature monitor"); 29 MODULE_AUTHOR("Clemens Ladisch <clemens@ladisch.de>"); 30 MODULE_LICENSE("GPL"); 31 ··· 208 static const struct pci_device_id k10temp_id_table[] = { 209 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_10H_NB_MISC) }, 210 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_11H_NB_MISC) }, 211 + { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_CNB17H_F3) }, 212 {} 213 }; 214 MODULE_DEVICE_TABLE(pci, k10temp_id_table);
+21 -2
drivers/hwmon/lm85.c
··· 41 enum chips { 42 any_chip, lm85b, lm85c, 43 adm1027, adt7463, adt7468, 44 - emc6d100, emc6d102 45 }; 46 47 /* The LM85 registers */ ··· 90 #define LM85_VERSTEP_EMC6D100_A0 0x60 91 #define LM85_VERSTEP_EMC6D100_A1 0x61 92 #define LM85_VERSTEP_EMC6D102 0x65 93 94 #define LM85_REG_CONFIG 0x40 95 ··· 351 { "emc6d100", emc6d100 }, 352 { "emc6d101", emc6d100 }, 353 { "emc6d102", emc6d102 }, 354 { } 355 }; 356 MODULE_DEVICE_TABLE(i2c, lm85_id); ··· 1254 case LM85_VERSTEP_EMC6D102: 1255 type_name = "emc6d102"; 1256 break; 1257 } 1258 } else { 1259 dev_dbg(&adapter->dev, ··· 1301 case adt7468: 1302 case emc6d100: 1303 case emc6d102: 1304 data->freq_map = adm1027_freq_map; 1305 break; 1306 default: ··· 1487 /* More alarm bits */ 1488 data->alarms |= lm85_read_value(client, 1489 EMC6D100_REG_ALARM3) << 16; 1490 - } else if (data->type == emc6d102) { 1491 /* Have to read LSB bits after the MSB ones because 1492 the reading of the MSB bits has frozen the 1493 LSBs (backward from the ADM1027).
··· 41 enum chips { 42 any_chip, lm85b, lm85c, 43 adm1027, adt7463, adt7468, 44 + emc6d100, emc6d102, emc6d103 45 }; 46 47 /* The LM85 registers */ ··· 90 #define LM85_VERSTEP_EMC6D100_A0 0x60 91 #define LM85_VERSTEP_EMC6D100_A1 0x61 92 #define LM85_VERSTEP_EMC6D102 0x65 93 + #define LM85_VERSTEP_EMC6D103_A0 0x68 94 + #define LM85_VERSTEP_EMC6D103_A1 0x69 95 + #define LM85_VERSTEP_EMC6D103S 0x6A /* Also known as EMC6D103:A2 */ 96 97 #define LM85_REG_CONFIG 0x40 98 ··· 348 { "emc6d100", emc6d100 }, 349 { "emc6d101", emc6d100 }, 350 { "emc6d102", emc6d102 }, 351 + { "emc6d103", emc6d103 }, 352 { } 353 }; 354 MODULE_DEVICE_TABLE(i2c, lm85_id); ··· 1250 case LM85_VERSTEP_EMC6D102: 1251 type_name = "emc6d102"; 1252 break; 1253 + case LM85_VERSTEP_EMC6D103_A0: 1254 + case LM85_VERSTEP_EMC6D103_A1: 1255 + type_name = "emc6d103"; 1256 + break; 1257 + /* 1258 + * Registers apparently missing in EMC6D103S/EMC6D103:A2 1259 + * compared to EMC6D103:A0, EMC6D103:A1, and EMC6D102 1260 + * (according to the data sheets), but used unconditionally 1261 + * in the driver: 62[5:7], 6D[0:7], and 6E[0:7]. 1262 + * So skip EMC6D103S for now. 1263 + case LM85_VERSTEP_EMC6D103S: 1264 + type_name = "emc6d103s"; 1265 + break; 1266 + */ 1267 } 1268 } else { 1269 dev_dbg(&adapter->dev, ··· 1283 case adt7468: 1284 case emc6d100: 1285 case emc6d102: 1286 + case emc6d103: 1287 data->freq_map = adm1027_freq_map; 1288 break; 1289 default: ··· 1468 /* More alarm bits */ 1469 data->alarms |= lm85_read_value(client, 1470 EMC6D100_REG_ALARM3) << 16; 1471 + } else if (data->type == emc6d102 || data->type == emc6d103) { 1472 /* Have to read LSB bits after the MSB ones because 1473 the reading of the MSB bits has frozen the 1474 LSBs (backward from the ADM1027).