summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Huang <u8813345@gmail.com>2026-03-16 16:39:34 +0800
committerGuenter Roeck <linux@roeck-us.net>2026-03-30 19:45:06 -0700
commitffa2ad0aa64697c29d501f76cb7b7187cbbb147a (patch)
tree7237bd2c28cc7819f418b7e0793a906a4cf7f39d
parent32a7bdbd201be809c690c64a3a233c7bb640c48c (diff)
hwmon: (pmbus) Add Delta Q54SN120A1 Q54SW120A7 chip
Add the DELTA chips Q54SN120A1, Q54SW120A7 in q54sj108a2, 1/4 Brick DC/DC Regulated Power Module with PMBus support Signed-off-by: Colin Huang <u8813345@gmail.com> Link: https://lore.kernel.org/r/20260316-add-q54sn120a1-q54q54sw120a7-v2-2-60e6182cc4a7@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-rw-r--r--drivers/hwmon/pmbus/q54sj108a2.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/drivers/hwmon/pmbus/q54sj108a2.c b/drivers/hwmon/pmbus/q54sj108a2.c
index 7e799f36f923..a368cfa9d45a 100644
--- a/drivers/hwmon/pmbus/q54sj108a2.c
+++ b/drivers/hwmon/pmbus/q54sj108a2.c
@@ -271,6 +271,8 @@ static const struct file_operations q54sj108a2_fops = {
static const struct i2c_device_id q54sj108a2_id[] = {
{ "q54sj108a2", q54sj108a2 },
+ { "q54sn120a1", q54sj108a2 },
+ { "q54sw120a7", q54sj108a2 },
{ },
};
@@ -280,6 +282,7 @@ static int q54sj108a2_probe(struct i2c_client *client)
{
struct device *dev = &client->dev;
u8 buf[I2C_SMBUS_BLOCK_MAX + 1];
+ const struct i2c_device_id *mid;
enum chips chip_id;
int ret, i;
struct dentry *debugfs;
@@ -313,8 +316,12 @@ static int q54sj108a2_probe(struct i2c_client *client)
dev_err(dev, "Failed to read Manufacturer Model\n");
return ret;
}
- if (ret != 14 || strncmp(buf, "Q54SJ108A2", 10)) {
- buf[ret] = '\0';
+ buf[ret] = '\0';
+ for (mid = q54sj108a2_id; mid->name[0]; mid++) {
+ if (!strncasecmp(mid->name, buf, strlen(mid->name)))
+ break;
+ }
+ if (!mid->name[0]) {
dev_err(dev, "Unsupported Manufacturer Model '%s'\n", buf);
return -ENODEV;
}
@@ -324,7 +331,10 @@ static int q54sj108a2_probe(struct i2c_client *client)
dev_err(dev, "Failed to read Manufacturer Revision\n");
return ret;
}
- if (ret != 4 || buf[0] != 'S') {
+ /*
+ * accept manufacturer revision with optional NUL byte
+ */
+ if (!(ret == 4 || ret == 5) || buf[0] != 'S') {
buf[ret] = '\0';
dev_err(dev, "Unsupported Manufacturer Revision '%s'\n", buf);
return -ENODEV;
@@ -401,6 +411,8 @@ static int q54sj108a2_probe(struct i2c_client *client)
static const struct of_device_id q54sj108a2_of_match[] = {
{ .compatible = "delta,q54sj108a2", .data = (void *)q54sj108a2 },
+ { .compatible = "delta,q54sn120a1", .data = (void *)q54sj108a2 },
+ { .compatible = "delta,q54sw120a7", .data = (void *)q54sj108a2 },
{ },
};