Skip to contentSkip to conversation

hwmon: (lm95245) Add support for LM95235

PATCH In review Guenter Roeck 2 participants 3 messages Nov 30, 2014 – Dec 2, 2014

Subsystems (2)
lore
Share & tools
lore

Guenter Roeck

author maintainer
#0 lore raw

PATCH v2 1/2 hwmon: (lm95245) Add support for LM95235

LM95235 is register compatible to LM95245.

Also update link to LM95245 data sheet, and drop the link to the datasheet from the driver source to simplify code maintenance.

---
v2: Drop link to datasheet from driver source.
Drop DEVNAME.
Update MODULE_DESCRIPTION.
Use the same driver_data values for supported chips since the field is not used by the driver.

 Documentation/hwmon/lm95245 | 14 +++++++++-----
 drivers/hwmon/Kconfig       |  5 +++--
 drivers/hwmon/lm95245.c     | 41 +++++++++++++++++++++++++++--------------
 3 files changed, 39 insertions(+), 21 deletions(-)
Documentation/hwmon/lm95245 +9 -5
index 77eaf28..d755901 100644
@@ -2,10 +2,14 @@ Kernel driver lm95245
 =========
 
 Supported chips:
-  * National Semiconductor LM95245
+  * TI LM95235
+    Addresses scanned: I2C 0x18, 0x29, 0x4c
+    Datasheet: Publicly available at the TI website
+               http://www.ti.com/lit/ds/symlink/lm95235.pdf
+  * TI / National Semiconductor LM95245
     Addresses scanned: I2C 0x18, 0x19, 0x29, 0x4c, 0x4d
-    Datasheet: Publicly available at the National Semiconductor website
-               http://www.national.com/mpf/LM/LM95245.html
+    Datasheet: Publicly available at the TI website
+               http://www.ti.com/lit/ds/symlink/lm95245.pdf
 
 
 Author: Alexander Stein <[email protected]>
@@ -13,10 +17,10 @@ Author: Alexander Stein <[email protected]>
 Description
 -----------
 
-The LM95245 is an 11-bit digital temperature sensor with a 2-wire System
+LM95235 and LM95245 are 11-bit digital temperature sensors with a 2-wire System
 Management Bus (SMBus) interface and TruTherm technology that can monitor
 the temperature of a remote diode as well as its own temperature.
-The LM95245 can be used to very accurately monitor the temperature of
+The chips can be used to very accurately monitor the temperature of
 external devices such as microprocessors.
 
 All temperature values are given in millidegrees Celsius. Local temperature
drivers/hwmon/Kconfig +3 -2
index bcd5dad..27ef472 100644
@@ -1048,10 +1048,11 @@ config SENSORS_LM95241
 	  will be called lm95241.
 
 config SENSORS_LM95245
-	tristate "National Semiconductor LM95245 sensor chip"
+	tristate "National Semiconductor LM95245 and compatibles"
 	depends on I2C
 	help
-	  If you say yes here you get support for LM95245 sensor chip.
+	  If you say yes here you get support for LM95235 and LM95245
+	  temperature sensor chips.
 
 	  This driver can also be built as a module.  If so, the module
 	  will be called lm95245.
drivers/hwmon/lm95245.c +27 -14

88 lines not on this page · raw message

Signature · 7 lines
1.9.1


_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Reviewed-by on v2 1/2
#1 lore raw

Hi Guenter,

Quoted 35 lines · Guenter Roeck

LM95235 is register compatible to LM95245.

Also update link to LM95245 data sheet, and drop the link to the datasheet from the driver source to simplify code maintenance.

---
v2: Drop link to datasheet from driver source.
Drop DEVNAME.
Update MODULE_DESCRIPTION.
Use the same driver_data values for supported chips since the field is not used by the driver.

 Documentation/hwmon/lm95245 | 14 +++++++++-----
 drivers/hwmon/Kconfig       |  5 +++--
 drivers/hwmon/lm95245.c     | 41 +++++++++++++++++++++++++++--------------
 3 files changed, 39 insertions(+), 21 deletions(-)

(...)

drivers/hwmon/lm95245.c +3 -1
index 0ae0dfd..0680669 100644
(...)
@@ -427,17 +424,32 @@ static int lm95245_detect(struct i2c_client *new_client,
 			  struct i2c_board_info *info)
 {
 	struct i2c_adapter *adapter = new_client->adapter;
+	int address = new_client->addr;
+	const char *name;
+	int rev, id;
 
 	if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA))
 		return -ENODEV;
 
-	if (i2c_smbus_read_byte_data(new_client, LM95245_REG_R_MAN_ID)

drivers/hwmon/lm95245.c static int lm95245_detect(struct i2c_client *new_client, · line 439

Quoted 10 lines
drivers/hwmon/lm95245.c +4 -4
-			!= MANUFACTURER_ID
-		|| i2c_smbus_read_byte_data(new_client, LM95245_REG_R_CHIP_ID)
-			!= DEFAULT_REVISION)
+	id = i2c_smbus_read_byte_data(new_client, LM95245_REG_R_MAN_ID);
+	if (id != MANUFACTURER_ID)
 		return -ENODEV;
 
-	strlcpy(info->type, DEVNAME, I2C_NAME_SIZE);
+	rev = i2c_smbus_read_byte_data(new_client, LM95245_REG_R_CHIP_ID);
+	switch(rev) {

Missing space before opening parenthesis, checkpatch complains about it. Your original patch had it right, not sure what happened?

Everything else looks OK, so:

Signature · 7 lines
Jean Delvare
SUSE L3 Support

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
author maintainer
#2 lore raw
In reply to Guenter Roeck
Quoted 45 lines · Jean Delvare

Hi Guenter,

Quoted 42 lines · Guenter Roeck

LM95235 is register compatible to LM95245.

Also update link to LM95245 data sheet, and drop the link to the datasheet from the driver source to simplify code maintenance.

---
v2: Drop link to datasheet from driver source.
Drop DEVNAME.
Update MODULE_DESCRIPTION.
Use the same driver_data values for supported chips since the field is not used by the driver.

  Documentation/hwmon/lm95245 | 14 +++++++++-----
  drivers/hwmon/Kconfig       |  5 +++--
  drivers/hwmon/lm95245.c     | 41 +++++++++++++++++++++++++++--------------
  3 files changed, 39 insertions(+), 21 deletions(-)

(...)

drivers/hwmon/lm95245.c +5 -4
index 0ae0dfd..0680669 100644
(...)
@@ -427,17 +424,32 @@ static int lm95245_detect(struct i2c_client *new_client,
  			  struct i2c_board_info *info)
  {
  	struct i2c_adapter *adapter = new_client->adapter;
+	int address = new_client->addr;
+	const char *name;
+	int rev, id;
 
  	if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA))
  		return -ENODEV;
 
-	if (i2c_smbus_read_byte_data(new_client, LM95245_REG_R_MAN_ID)
-			!= MANUFACTURER_ID
-		|| i2c_smbus_read_byte_data(new_client, LM95245_REG_R_CHIP_ID)
-			!= DEFAULT_REVISION)
+	id = i2c_smbus_read_byte_data(new_client, LM95245_REG_R_MAN_ID);
+	if (id != MANUFACTURER_ID)
  		return -ENODEV;
 
Quoted 7 lines

drivers/hwmon/lm95245.c static int lm95245_detect(struct i2c_client *new_client, · line 439

Quoted 3 lines
drivers/hwmon/lm95245.c +2 -1
-	strlcpy(info->type, DEVNAME, I2C_NAME_SIZE);
+	rev = i2c_smbus_read_byte_data(new_client, LM95245_REG_R_CHIP_ID);
+	switch(rev) {

Missing space before opening parenthesis, checkpatch complains about it. Your original patch had it right, not sure what happened?

Me not either. The other patch has the same problem. Fixed up both.

Quoted 4 lines

Everything else looks OK, so:

Thanks!

Guenter

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors