Skip to contentSkip to conversation

hwmon: emc1403: Add support for EMC1442

PATCH Superseded Delphine CC Chiu 3 participants 4 messages Nov 2, 2023 Hardware monitoring

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 hwmon: emc1403: Add support for EMC1442

Add support for EMC1442 which is compatible with EMC1403.

---
change in v2:
Revised emc1403 to emc1402

---
 drivers/hwmon/emc1403.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/hwmon/emc1403.c +5 -1
index bb7c859e799d..1332e4ac078c 100644
@@ -346,6 +346,9 @@ static int emc1403_detect(struct i2c_client *client,
 	case 0x27:
 		strscpy(info->type, "emc1424", I2C_NAME_SIZE);
 		break;
+	case 0x60:
+		strscpy(info->type, "emc1442", I2C_NAME_SIZE);
+		break;
 	default:
 		return -ENODEV;
 	}
@@ -430,7 +433,7 @@ static int emc1403_probe(struct i2c_client *client)
 }
 
 static const unsigned short emc1403_address_list[] = {
-	0x18, 0x1c, 0x29, 0x4c, 0x4d, 0x5c, I2C_CLIENT_END
+	0x18, 0x1c, 0x29, 0x3c, 0x4c, 0x4d, 0x5c, I2C_CLIENT_END
 };
 
 /* Last digit of chip name indicates number of channels */
@@ -444,6 +447,7 @@ static const struct i2c_device_id emc1403_idtable[] = {
 	{ "emc1422", emc1402 },
 	{ "emc1423", emc1403 },
 	{ "emc1424", emc1404 },
+	{ "emc1442", emc1402 },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, emc1403_idtable);
Signature · 1 line
2.25.1
Reviewed-by on v2 1/1
#1 lore raw

On Thu, Nov 02, 2023 at 05:08:07PM +0800, Delphine CC Chiu wrote:

I have a datasheet for this chip with a "Revision 1.0 (10-25-10)" in the footer. Reviewed the change against the datasheet.

drivers/hwmon/emc1403.c static int emc1403_detect(struct i2c_client *client, · line 351

Quoted 10 lines

Add support for EMC1442 which is compatible with EMC1403.

---
change in v2:
Revised emc1403 to emc1402

drivers/hwmon/emc1403.c +3 -0
+	case 0x60:
+		strscpy(info->type, "emc1442", I2C_NAME_SIZE);
+		break;

Confirmed against datasheet.

Section 2.2 "Register Set Delta" specifies:
- Product ID | 60h

drivers/hwmon/emc1403.c static int emc1403_probe(struct i2c_client *client) · line 436

Quoted 3 lines

static const unsigned short emc1403_address_list[] = {

drivers/hwmon/emc1403.c +1 -1
-	0x18, 0x1c, 0x29, 0x4c, 0x4d, 0x5c, I2C_CLIENT_END
+	0x18, 0x1c, 0x29, 0x3c, 0x4c, 0x4d, 0x5c, I2C_CLIENT_END

Confirmed against datasheet.

Section 5.1.2 "SMBus Address and RD/WR Bit" has a table indicating that a 22k pull-up resistor corresponds to 0011_100? binary.

drivers/hwmon/emc1403.c static const struct i2c_device_id emc1403_idtable[] = { · line 450

Quoted 4 lines
drivers/hwmon/emc1403.c +1 -0
 	{ "emc1422", emc1402 },
 	{ "emc1423", emc1403 },
 	{ "emc1424", emc1404 },
+	{ "emc1442", emc1402 },

Datasheet section 2.1 is titled "Functional Delta from EMC1412 to EMC1442", with minimal differences. We map "emc1412" to emc1402, so mapping "emc1442" to the same should be appropriate.

Signature · 1 line
Patrick Williams
maintainer
#2 lore raw
Quoted 40 lines · Patrick Williams

On Thu, Nov 02, 2023 at 05:08:07PM +0800, Delphine CC Chiu wrote:

I have a datasheet for this chip with a "Revision 1.0 (10-25-10)" in the footer. Reviewed the change against the datasheet.

drivers/hwmon/emc1403.c static int emc1403_detect(struct i2c_client *client, · line 351

Quoted 10 lines

Add support for EMC1442 which is compatible with EMC1403.

---
change in v2:
Revised emc1403 to emc1402

drivers/hwmon/emc1403.c +3 -0
+	case 0x60:
+		strscpy(info->type, "emc1442", I2C_NAME_SIZE);
+		break;

Confirmed against datasheet.

Section 2.2 "Register Set Delta" specifies:
- Product ID | 60h

drivers/hwmon/emc1403.c static int emc1403_probe(struct i2c_client *client) · line 436

Quoted 3 lines
  static const unsigned short emc1403_address_list[] = {
drivers/hwmon/emc1403.c +1 -1
-	0x18, 0x1c, 0x29, 0x4c, 0x4d, 0x5c, I2C_CLIENT_END
+	0x18, 0x1c, 0x29, 0x3c, 0x4c, 0x4d, 0x5c, I2C_CLIENT_END

Confirmed against datasheet.

Section 5.1.2 "SMBus Address and RD/WR Bit" has a table indicating that a 22k pull-up resistor corresponds to 0011_100? binary.

drivers/hwmon/emc1403.c static const struct i2c_device_id emc1403_idtable[] = { · line 450

Quoted 4 lines

{ "emc1422", emc1402 },
{ "emc1423", emc1403 },
{ "emc1424", emc1404 },

drivers/hwmon/emc1403.c +1 -0
+	{ "emc1442", emc1402 },

Datasheet section 2.1 is titled "Functional Delta from EMC1412 to EMC1442", with minimal differences. We map "emc1412" to emc1402, so mapping "emc1442" to the same should be appropriate.

Quoted 2 lines

Thanks. I'll apply, and fix the description while doing so.

Guenter

maintainer
#3 lore raw
In reply to Delphine CC Chiu
Quoted 1 line · Delphine CC Chiu

Add support for EMC1442 which is compatible with EMC1403.

                                                   ^^^^^^^

EMC1402

NP, I can fix that up when applying.

Quoted 24 lines

---
change in v2:
Revised emc1403 to emc1402

---
  drivers/hwmon/emc1403.c | 6 +++++-
  1 file changed, 5 insertions(+), 1 deletion(-)
drivers/hwmon/emc1403.c +3 -0
index bb7c859e799d..1332e4ac078c 100644
@@ -346,6 +346,9 @@ static int emc1403_detect(struct i2c_client *client,
  	case 0x27:
  		strscpy(info->type, "emc1424", I2C_NAME_SIZE);
  		break;
+	case 0x60:
+		strscpy(info->type, "emc1442", I2C_NAME_SIZE);
+		break;
  	default:
  		return -ENODEV;
  	}

drivers/hwmon/emc1403.c static int emc1403_probe(struct i2c_client *client) · line 436

Quoted 5 lines
drivers/hwmon/emc1403.c +1 -1
@@ -430,7 +433,7 @@ static int emc1403_probe(struct i2c_client *client)
  }
 
  static const unsigned short emc1403_address_list[] = {
-	0x18, 0x1c, 0x29, 0x4c, 0x4d, 0x5c, I2C_CLIENT_END
+	0x18, 0x1c, 0x29, 0x3c, 0x4c, 0x4d, 0x5c, I2C_CLIENT_END
                          ^^^^

This also needs confirmation from someone (else) with a datasheet.

Thanks,
Guenter

Quoted 11 lines
drivers/hwmon/emc1403.c +1 -0
  };
 
  /* Last digit of chip name indicates number of channels */
@@ -444,6 +447,7 @@ static const struct i2c_device_id emc1403_idtable[] = {
  	{ "emc1422", emc1402 },
  	{ "emc1423", emc1403 },
  	{ "emc1424", emc1404 },
+	{ "emc1442", emc1402 },
  	{ }
  };
  MODULE_DEVICE_TABLE(i2c, emc1403_idtable);