Skip to content

Commit ae544f6

Browse files
groeckJean Delvare
authored andcommitted
hwmon: (lm90) Add support for GMT G781
GMT G781 is a ADM1032-compatible temperature sensor chip. Add support to the LM90 driver. Cc: Mike Gorchak <lestat@i.com.ua> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Jean Delvare <khali@linux-fr.org>
1 parent f36ffea commit ae544f6

3 files changed

Lines changed: 24 additions & 2 deletions

File tree

‎Documentation/hwmon/lm90‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ Supported chips:
118118
Addresses scanned: I2C 0x48 through 0x4F
119119
Datasheet: Publicly available at NXP website
120120
http://ics.nxp.com/products/interface/datasheet/sa56004x.pdf
121+
* GMT G781
122+
Prefix: 'g781'
123+
Addresses scanned: I2C 0x4c, 0x4d
124+
Datasheet: Not publicly available from GMT
121125

122126
Author: Jean Delvare <khali@linux-fr.org>
123127

‎drivers/hwmon/Kconfig‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,8 @@ config SENSORS_LM90
648648
LM86, LM89 and LM99, Analog Devices ADM1032, ADT7461, and ADT7461A,
649649
Maxim MAX6646, MAX6647, MAX6648, MAX6649, MAX6657, MAX6658, MAX6659,
650650
MAX6680, MAX6681, MAX6692, MAX6695, MAX6696, ON Semiconductor NCT1008,
651-
Winbond/Nuvoton W83L771W/G/AWG/ASG and Philips SA56004 sensor chips.
651+
Winbond/Nuvoton W83L771W/G/AWG/ASG, Philips SA56004, and GMT G781
652+
sensor chips.
652653

653654
This driver can also be built as a module. If so, the module
654655
will be called lm90.

‎drivers/hwmon/lm90.c‎

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@
5757
* This driver also supports the SA56004 from Philips. This device is
5858
* pin-compatible with the LM86, the ED/EDP parts are also address-compatible.
5959
*
60+
* This driver also supports the G781 from GMT. This device is compatible
61+
* with the ADM1032.
62+
*
6063
* Since the LM90 was the first chipset supported by this driver, most
6164
* comments will refer to this chipset, but are actually general and
6265
* concern all supported chipsets, unless mentioned otherwise.
@@ -107,7 +110,7 @@ static const unsigned short normal_i2c[] = {
107110
0x4d, 0x4e, 0x4f, I2C_CLIENT_END };
108111

109112
enum chips { lm90, adm1032, lm99, lm86, max6657, max6659, adt7461, max6680,
110-
max6646, w83l771, max6696, sa56004 };
113+
max6646, w83l771, max6696, sa56004, g781 };
111114

112115
/*
113116
* The LM90 registers
@@ -184,6 +187,7 @@ static const struct i2c_device_id lm90_id[] = {
184187
{ "adm1032", adm1032 },
185188
{ "adt7461", adt7461 },
186189
{ "adt7461a", adt7461 },
190+
{ "g781", g781 },
187191
{ "lm90", lm90 },
188192
{ "lm86", lm86 },
189193
{ "lm89", lm86 },
@@ -229,6 +233,12 @@ static const struct lm90_params lm90_params[] = {
229233
.alert_alarms = 0x7c,
230234
.max_convrate = 10,
231235
},
236+
[g781] = {
237+
.flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT
238+
| LM90_HAVE_BROKEN_ALERT,
239+
.alert_alarms = 0x7c,
240+
.max_convrate = 8,
241+
},
232242
[lm86] = {
233243
.flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT,
234244
.alert_alarms = 0x7b,
@@ -1289,6 +1299,13 @@ static int lm90_detect(struct i2c_client *client,
12891299
&& convrate <= 0x09) {
12901300
name = "sa56004";
12911301
}
1302+
} else
1303+
if ((address == 0x4C || address == 0x4D)
1304+
&& man_id == 0x47) { /* GMT */
1305+
if (chip_id == 0x01 /* G781 */
1306+
&& (config1 & 0x3F) == 0x00
1307+
&& convrate <= 0x08)
1308+
name = "g781";
12921309
}
12931310

12941311
if (!name) { /* identification failed */

0 commit comments

Comments
 (0)