Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

hwmon: (lm70) Add support for TI TMP122/124

Add support for Texas Instruments TMP122/124 which are nearly identical to
their TMP121/123 except that they also support programmable temperature
thresholds.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>

authored by

Florian Fainelli and committed by
Guenter Roeck
68f0c8c9 e8295146

+15 -3
+1
Documentation/devicetree/bindings/hwmon/lm70.txt
··· 4 4 - compatible: one of 5 5 "ti,lm70" 6 6 "ti,tmp121" 7 + "ti,tmp122" 7 8 "ti,lm71" 8 9 "ti,lm74" 9 10
+6 -2
Documentation/hwmon/lm70
··· 6 6 Datasheet: http://www.national.com/pf/LM/LM70.html 7 7 * Texas Instruments TMP121/TMP123 8 8 Information: http://focus.ti.com/docs/prod/folders/print/tmp121.html 9 + * Texas Instruments TMP122/TMP124 10 + Information: http://www.ti.com/product/tmp122 9 11 * National Semiconductor LM71 10 12 Datasheet: http://www.ti.com/product/LM71 11 13 * National Semiconductor LM74 ··· 37 35 with a "SPI master controller driver", see drivers/spi/spi_lm70llp.c 38 36 and its associated documentation. 39 37 40 - The LM74 and TMP121/TMP123 are very similar; main difference is 13-bit 41 - temperature data (0.0625 degrees celsius resolution). 38 + The LM74 and TMP121/TMP122/TMP123/TMP124 are very similar; main difference is 39 + 13-bit temperature data (0.0625 degrees celsius resolution). 40 + 41 + The TMP122/TMP124 also feature configurable temperature thresholds. 42 42 43 43 The LM71 is also very similar; main difference is 14-bit temperature 44 44 data (0.03125 degrees celsius resolution).
+8 -1
drivers/hwmon/lm70.c
··· 46 46 #define LM70_CHIP_TMP121 1 /* TI TMP121/TMP123 */ 47 47 #define LM70_CHIP_LM71 2 /* NS LM71 */ 48 48 #define LM70_CHIP_LM74 3 /* NS LM74 */ 49 + #define LM70_CHIP_TMP122 4 /* TI TMP122/TMP124 */ 49 50 50 51 struct lm70 { 51 52 struct spi_device *spi; ··· 93 92 * Celsius. 94 93 * So it's equivalent to multiplying by 0.25 * 1000 = 250. 95 94 * 96 - * LM74 and TMP121/TMP123: 95 + * LM74 and TMP121/TMP122/TMP123/TMP124: 97 96 * 13 bits of 2's complement data, discard LSB 3 bits, 98 97 * resolution 0.0625 degrees celsius. 99 98 * ··· 107 106 break; 108 107 109 108 case LM70_CHIP_TMP121: 109 + case LM70_CHIP_TMP122: 110 110 case LM70_CHIP_LM74: 111 111 val = ((int)raw / 8) * 625 / 10; 112 112 break; ··· 143 141 { 144 142 .compatible = "ti,tmp121", 145 143 .data = (void *) LM70_CHIP_TMP121, 144 + }, 145 + { 146 + .compatible = "ti,tmp122", 147 + .data = (void *) LM70_CHIP_TMP122, 146 148 }, 147 149 { 148 150 .compatible = "ti,lm71", ··· 197 191 static const struct spi_device_id lm70_ids[] = { 198 192 { "lm70", LM70_CHIP_LM70 }, 199 193 { "tmp121", LM70_CHIP_TMP121 }, 194 + { "tmp122", LM70_CHIP_TMP122 }, 200 195 { "lm71", LM70_CHIP_LM71 }, 201 196 { "lm74", LM70_CHIP_LM74 }, 202 197 { },