hwmon: (pmbus/max20830): add enable-gpio property, VOUT feedback resistor properties, and add support for max20830c/max20840c - #3357
Conversation
71e6378 to
ed1b60e
Compare
| enum: | ||
| - adi,max20830 | ||
| - adi,max20830c | ||
| - adi,max20840c |
There was a problem hiding this comment.
Can the new devices somehow fallback to the adi,max20830 so that we can use fallback compatible? If not, you might be asked to justify it and typically DT maintainers want that in the commit message.
There was a problem hiding this comment.
ah yes, they're so similar that falling back wouldn't change behavior
| {"max20830"}, | ||
| {"max20830", max20830}, | ||
| {"max20830c", max20830c}, | ||
| {"max20840c", max20840c}, |
There was a problem hiding this comment.
I know this is something common in pmbus but I would try it as in IIO? per device struct with a const char * identifier.
There was a problem hiding this comment.
ill try it out, i think it could reduce a lot of the code complexity
| /* MAX20840C variant detected */ | ||
| } else if (!strncmp(buf, "MAX20830", 8)) { | ||
| /* MAX20830 variant detected */ | ||
| } else { |
There was a problem hiding this comment.
Then no need for the above. Just one comparison
| */ | ||
| ret = i2c_smbus_read_i2c_block_data(client, PMBUS_IC_DEVICE_ID, | ||
| MAX20830_IC_DEVICE_ID_LENGTH + 1, | ||
| MAX20830_IC_DEVICE_ID_MAX_LENGTH + 1, |
There was a problem hiding this comment.
Does this actually work for the devices that only have MAX20830_IC_DEVICE_ID_MIN_LENGTH? Anyways, with a per chip struct this becomes again trivial to just use the amount of bytes any device is really needs to be read.
There was a problem hiding this comment.
just to answer so far yes, the i2c read here just returns FF beyond what the chip replies,
but yeah if edited as suggested above, this should be trivial
9b8e2eb to
d4a9363
Compare
|
v2: dts:
.c:
Note: |
f84f0b6 to
5ee4759
Compare
|
I guess this is to upstream? If so, please change base branch to a sensible mirror/ |
8c1a5f8 to
bd112c8
Compare
Adding a missing entry for the MAX20830 EN (enable) pin. Signed-off-by: Alexis Czezar Torreno <alexisczezar.torreno@analog.com>
Add support for the GPIO controlled EN pin. The EN pin is asserted high for device to operate. Signed-off-by: Alexis Czezar Torreno <alexisczezar.torreno@analog.com>
…erties Add adi,vout-rfb1-ohms and adi,vout-rfb2-ohms properties to support external voltage divider configuration for VOUT sensing. When the desired output voltage is higher than VREF, a resistor divider (RFB1 and RFB2) is required to reach the intended value. The properties use a dependency constraint to ensure both resistors are specified together, or neither. This prevents misconfiguration where only one resistor value is provided. Signed-off-by: Alexis Czezar Torreno <alexisczezar.torreno@analog.com>
Implement support for external voltage divider scaling using the adi,vout-rfb1-ohms and adi,vout-rfb2-ohms device tree properties. When the desired output voltage exceeds VREF, a resistor divider (RFB1 and RFB2) is used to scale down the feedback voltage. The driver reads these resistor values from device tree and applies the scaling formula: VOUT_actual = VOUT_measured × (1 + RFB1/RFB2) The properties are optional. If not specified, the driver assumes no voltage divider is present and reports the raw VOUT reading. Signed-off-by: Alexis Czezar Torreno <alexisczezar.torreno@analog.com>
…port Add compatible strings for variants of MAX20830 which are MAX20830C and MAX20840C. These devices have the same register functionality with MAX20830 but with a longer IC_DEVICE_ID. Signed-off-by: Alexis Czezar Torreno <alexisczezar.torreno@analog.com>
Add support for MAX20830C and MAX20840 step-down DC-DC switching regulator with PMBus interface. MAX20830C is a different packaging for MAX20830, and MAX20840C supports 40A regulation compared to MAX20830 that is only 30A. Signed-off-by: Alexis Czezar Torreno <alexisczezar.torreno@analog.com>
b8ab74e to
b9080e0
Compare
4e21503 to
97e15ef
Compare
8411d1b to
a17a53a
Compare
PR Description
Adds a missing entry for enable pin in the driver.
Adds entries for VOUT feedback resistor properties. VOUT telemetry is now based on the
scaling provided by two feedback resistors where VOUT = VREF*(1+Rfb1/Rfb2)
This PR adds support for the Analog Devices MAX20830C and MAX20840C
step-down DC-DC switching regulator with PMBus interface.
This PR is based on top of this: #3183
PR Type
PR Checklist