Skip to content

Commit 89108cb

Browse files
kyle-swenson-estkuba-moo
authored andcommitted
net: pse-pd: tps23881: Fix the device ID check
The DEVID register contains two pieces of information: the device ID in the upper nibble, and the silicon revision number in the lower nibble. The driver should work fine with any silicon revision, so let's mask that out in the device ID check. Fixes: 20e6d19 ("net: pse-pd: Add TI TPS23881 PSE controller driver") Signed-off-by: Kyle Swenson <[email protected]> Reviewed-by: Thomas Petazzoni <[email protected]> Acked-by: Oleksij Rempel <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 9ab0faa commit 89108cb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/net/pse-pd/tps23881.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
#define TPS23881_REG_TPON BIT(0)
3030
#define TPS23881_REG_FWREV 0x41
3131
#define TPS23881_REG_DEVID 0x43
32+
#define TPS23881_REG_DEVID_MASK 0xF0
33+
#define TPS23881_DEVICE_ID 0x02
3234
#define TPS23881_REG_SRAM_CTRL 0x60
3335
#define TPS23881_REG_SRAM_DATA 0x61
3436

@@ -750,7 +752,7 @@ static int tps23881_i2c_probe(struct i2c_client *client)
750752
if (ret < 0)
751753
return ret;
752754

753-
if (ret != 0x22) {
755+
if (FIELD_GET(TPS23881_REG_DEVID_MASK, ret) != TPS23881_DEVICE_ID) {
754756
dev_err(dev, "Wrong device ID\n");
755757
return -ENXIO;
756758
}

0 commit comments

Comments
 (0)