diff options
Diffstat (limited to 'drivers/hwmon/pmbus/max16601.c')
| -rw-r--r-- | drivers/hwmon/pmbus/max16601.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/drivers/hwmon/pmbus/max16601.c b/drivers/hwmon/pmbus/max16601.c index 5a226a564776..d696e506aafb 100644 --- a/drivers/hwmon/pmbus/max16601.c +++ b/drivers/hwmon/pmbus/max16601.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 /* - * Hardware monitoring driver for Maxim MAX16508 and MAX16601. + * Hardware monitoring driver for Maxim MAX16508, MAX16600, MAX16601, + * and MAX16602. * * Implementation notes: * @@ -31,7 +32,7 @@ #include "pmbus.h" -enum chips { max16508, max16601 }; +enum chips { max16508, max16600, max16601, max16602 }; #define REG_DEFAULT_NUM_POP 0xc4 #define REG_SETPT_DVID 0xd1 @@ -202,7 +203,7 @@ static int max16601_identify(struct i2c_client *client, else info->vrm_version[0] = vr12; - if (data->id != max16601) + if (data->id != max16600 && data->id != max16601 && data->id != max16602) return 0; reg = i2c_smbus_read_byte_data(client, REG_DEFAULT_NUM_POP); @@ -263,7 +264,9 @@ static void max16601_remove(void *_data) static const struct i2c_device_id max16601_id[] = { {"max16508", max16508}, + {"max16600", max16600}, {"max16601", max16601}, + {"max16602", max16602}, {} }; MODULE_DEVICE_TABLE(i2c, max16601_id); @@ -280,13 +283,17 @@ static int max16601_get_id(struct i2c_client *client) return -ENODEV; /* - * PMBUS_IC_DEVICE_ID is expected to return "MAX16601y.xx" - * or "MAX16500y.xx". + * PMBUS_IC_DEVICE_ID is expected to return MAX1660[012]y.xx", + * "MAX16500y.xx".cdxxcccccccccc, or "MAX16508y.xx". */ - if (!strncmp(buf, "MAX16500", 8)) { + if (!strncmp(buf, "MAX16500", 8) || !strncmp(buf, "MAX16508", 8)) { id = max16508; + } else if (!strncmp(buf, "MAX16600", 8)) { + id = max16600; } else if (!strncmp(buf, "MAX16601", 8)) { id = max16601; + } else if (!strncmp(buf, "MAX16602", 8)) { + id = max16602; } else { buf[ret] = '\0'; dev_err(dev, "Unsupported chip '%s'\n", buf); @@ -350,7 +357,7 @@ static struct i2c_driver max16601_driver = { .driver = { .name = "max16601", }, - .probe_new = max16601_probe, + .probe = max16601_probe, .id_table = max16601_id, }; @@ -359,4 +366,4 @@ module_i2c_driver(max16601_driver); MODULE_AUTHOR("Guenter Roeck <linux@roeck-us.net>"); MODULE_DESCRIPTION("PMBus driver for Maxim MAX16601"); MODULE_LICENSE("GPL v2"); -MODULE_IMPORT_NS(PMBUS); +MODULE_IMPORT_NS("PMBUS"); |
