summaryrefslogtreecommitdiffstats
path: root/drivers/net/pse-pd/tps23881.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-21 05:38:18 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-21 05:38:18 +0000
commit5a918526207805c8c5673e15a92bdf824ce53461 (patch)
tree9981a771882546899a1fc0c3b83114fb818810ca /drivers/net/pse-pd/tps23881.c
parentReleasing progress-linux version 6.10.4-1~progress7.99u1. (diff)
downloadlinux-5a918526207805c8c5673e15a92bdf824ce53461.tar.xz
linux-5a918526207805c8c5673e15a92bdf824ce53461.zip
Merging upstream version 6.10.6.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'drivers/net/pse-pd/tps23881.c')
-rw-r--r--drivers/net/pse-pd/tps23881.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/pse-pd/tps23881.c b/drivers/net/pse-pd/tps23881.c
index 98ffbb1bbf..2d1c2e5706 100644
--- a/drivers/net/pse-pd/tps23881.c
+++ b/drivers/net/pse-pd/tps23881.c
@@ -5,6 +5,7 @@
* Copyright (c) 2023 Bootlin, Kory Maincent <kory.maincent@bootlin.com>
*/
+#include <linux/bitfield.h>
#include <linux/delay.h>
#include <linux/firmware.h>
#include <linux/i2c.h>
@@ -29,6 +30,8 @@
#define TPS23881_REG_TPON BIT(0)
#define TPS23881_REG_FWREV 0x41
#define TPS23881_REG_DEVID 0x43
+#define TPS23881_REG_DEVID_MASK 0xF0
+#define TPS23881_DEVICE_ID 0x02
#define TPS23881_REG_SRAM_CTRL 0x60
#define TPS23881_REG_SRAM_DATA 0x61
@@ -750,7 +753,7 @@ static int tps23881_i2c_probe(struct i2c_client *client)
if (ret < 0)
return ret;
- if (ret != 0x22) {
+ if (FIELD_GET(TPS23881_REG_DEVID_MASK, ret) != TPS23881_DEVICE_ID) {
dev_err(dev, "Wrong device ID\n");
return -ENXIO;
}