mirror of
https://github.com/torvalds/linux.git
synced 2026-05-12 16:18:45 +02:00
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>
This commit is contained in:
parent
32a7bdbd20
commit
ffa2ad0aa6
|
|
@ -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 },
|
||||
{ },
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user