Re: [v4,2/2] hwmon: add MP2891 driver

From: Guenter Roeck
Date: Mon Jun 10 2024 - 12:24:19 EST


On 6/3/24 03:53, Noah Wang wrote:
Add support for MPS VR controller mp2891. This driver exposes
telemetry and limit value readings and writtings.

Signed-off-by: Noah Wang <noahwang.wang@xxxxxxxxxxx>
---
[ ... ]

+
+static int mp2891_identify(struct i2c_client *client, struct pmbus_driver_info *info)
+{
+ int ret;
+
+ /* Identify vout scale for rail 1. */
+ ret = mp2891_identify_vout_scale(client, info, 0);
+ if (ret < 0)
+ return ret;
+
+ /* Identify vout scale for rail 2. */
+ ret = mp2891_identify_vout_scale(client, info, 1);
+ if (ret < 0)
+ return ret;
+
+ /* Identify iout scale for rail 1. */
+ ret = mp2891_identify_iout_scale(client, info, 0);
+ if (ret < 0)
+ return ret;
+
+ /* Identify iout scale for rail 2. */
+ ret = mp2891_identify_iout_scale(client, info, 1);
+ if (ret < 0)
+ return ret;
+
+ return ret;

return mp2891_identify_iout_scale(...);

Guenter