hwmon: (pmbus/adp1050): Support adp1051 and adp1055#2629
Conversation
ca32f70 to
ffc9249
Compare
nunojsa
left a comment
There was a problem hiding this comment.
Another hint is to run:
git log --oneline drivers/hwmon/pmbus to look for the style used in that dir for commit titles. The most common seems to be (adapted for your case):
hwmon: (pmbus/adp1050): Support adp1051 and adp1055
|
|
||
| description: | | ||
| The ADP1050 is used to monitor system voltages, currents and temperatures. | ||
| The ADP1050, ADP1051, and ADP1055 are used to monitor system voltages, |
There was a problem hiding this comment.
This does not scale. Instead say "The ADP1050 and similar devices..."
| and has four individual monitors for input/output voltage, input current | ||
| and temperature. | ||
| Datasheet: | ||
| https://www.analog.com/en/products/adp1050.html |
There was a problem hiding this comment.
Just add here the links to new datasheets
|
|
||
| hwmon@70 { | ||
| compatible = "adi,adp1050"; | ||
| compatible = "adi,adp1050", "adi,adp1051"; |
There was a problem hiding this comment.
It does not work like this... If you can fallback to some compatible, that needs to be stated in the bindings which is not.
| compatible = "adi,adp1050", "adi,adp1051"; | ||
| reg = <0x70>; | ||
| vcc-supply = <&vcc>; | ||
| status = "okay"; |
| compatible = "adi,adp1055"; | ||
| reg = <0x4b>; | ||
| vcc-supply = <&vcc>; | ||
| status = "okay"; |
There was a problem hiding this comment.
If it#s only a matter of the address being different, I would not bother in adding another example
| | PMBUS_HAVE_VIN | PMBUS_HAVE_STATUS_INPUT | ||
| | PMBUS_HAVE_IIN | PMBUS_HAVE_TEMP | ||
| | PMBUS_HAVE_STATUS_TEMP, | ||
| }; |
There was a problem hiding this comment.
Also unrelated change. I would drop it (or add it in a different patch)
| ADP1050, | ||
| ADP1051, | ||
| ADP1055, | ||
| }; |
| { .compatible = "adi,adp1050"}, | ||
| { .compatible = "adi,adp1050", .data = (void *)ADP1050}, | ||
| { .compatible = "adi,adp1051", .data = (void *)ADP1051}, | ||
| { .compatible = "adi,adp1055", .data = (void *)ADP1055}, |
There was a problem hiding this comment.
pass in directly the pmbus_driver_info structs...
| {"adp1050", 0}, | ||
| {"adp1050", ADP1050}, | ||
| {"adp1051", ADP1051}, | ||
| {"adp1055", ADP1055}, |
There was a problem hiding this comment.
here you need a cast but there are examples:
https://elixir.bootlin.com/linux/v6.11.5/source/drivers/iio/addac/ad74413r.c#L1530
| return pmbus_do_probe(client, &adp1050_info); | ||
| enum ADP1050_type type; | ||
|
|
||
| type = (enum ADP1050_type)(uintptr_t)device_get_match_data(&client->dev); |
There was a problem hiding this comment.
Now you can properly do error checking:
info = device_get_match_data();
if (!info)
return -ENODEV;
39943c4 to
9a7485b
Compare
|
v2 .yaml:
.rst
.c
|
nunojsa
left a comment
There was a problem hiding this comment.
Fell free to send this upstream...
| - enum: | ||
| - adi,adp1050 | ||
| - adi,adp1051 | ||
| - adi,adp1055 |
There was a problem hiding this comment.
On top of what I've said already, you don't need "items:" in here (as you have things now at least).
| return pmbus_do_probe(client, &adp1050_info); | ||
| struct pmbus_driver_info *info; | ||
|
|
||
| info = (struct pmbus_driver_info *)device_get_match_data(&client->dev); |
There was a problem hiding this comment.
I added the cast just to remove a warning but yes this can be removed to simplify the code further.
edit: removal of the cast started failing some of the checks. is this ok?
| const struct i2c_device_id *id) | ||
| { | ||
| return pmbus_do_probe(client, &adp1050_info); | ||
| struct pmbus_driver_info *info; |
There was a problem hiding this comment.
It can be const pmbus_driver_info *info
There was a problem hiding this comment.
Obviously a typo from me... const struct pmbus_driver_info *info and then no need for the cast
There was a problem hiding this comment.
Yes, my bad... pmbus_do_probe() discards the const qualifier. Sorry for the noise.
There was a problem hiding this comment.
reverted back to original
struct pmbus_driver_info *info;
82c4d40 to
72a535b
Compare
|
Please send this upstream so we can merge this here |
72a535b to
7b8e680
Compare
|
This was already sent upstream. However, the maintainers caught this and another driver LTP8800 to be somewhat similar and suggested we combine them and send together in one patch. There was feedback on LTP8800 and am still waiting for updates on it. Will apply the recent feedback here too to the upstream when ready. Also it seems the main branch file was updated and I merged/resolved conflicts it above. I hope this is ok. /* 6.1 probe() function still uses the second struct i2c_device_id argument */ |
|
Hi, I'm just checking in on the status of this pull request. Is there anything I can do to help move it forward? |
|
I got in touch with the one handling the other part and it seems this was the latest update: |
Please, it looks pretty much ready to be accepted so... |
|
v3 - Upstream applied: cherry picked the applied patches This PR is now the merged drivers of adp1051, adp1055, and ltp8800 Linked here is the old pull request for ltp8800 |
nunojsa
left a comment
There was a problem hiding this comment.
It seems it still needs some care this PR. I definitely don't expect that merge commit in here. Please rebase and apply the patches.
Add support for adp1051, adp1055, and ltp8800.
ADP1051: 6 PWM for I/O Voltage, I/O Current, Temperature
ADP1055: 6 PWM for I/O Voltage, I/O Current, Power, Temperature
LTP8800-1A/-2/-4A: 150A/135A/200A DC/DC µModule Regulator
Co-developed-by: Alexis Czezar Torreno <alexisczezar.torreno@analog.com>
Signed-off-by: Alexis Czezar Torreno <alexisczezar.torreno@analog.com>
Signed-off-by: Cedric Encarnacion <cedricjustine.encarnacion@analog.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20250709-adp1051-v5-1-539254692252@analog.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Introduce hardware monitoring support for the following devices:
ADP1051: 6 PWM for I/O Voltage, I/O Current, Temperature
ADP1055: 6 PWM for I/O Voltage, I/O Current, Power, Temperature
LTP8800-1A/-2/-4A: 150A/135A/200A DC/DC µModule Regulator
The ADP1051 and ADP1055 are similar digital controllers for high
efficiency DC-DC power conversion while the LTP8800 is a family of
step-down μModule regulators that provides microprocessor core voltage
from 54V power distribution architecture. All of the above components
features telemetry monitoring of input/output voltage, input current,
output power, and temperature over PMBus.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Co-developed-by: Alexis Czezar Torreno <alexisczezar.torreno@analog.com>
Signed-off-by: Alexis Czezar Torreno <alexisczezar.torreno@analog.com>
Signed-off-by: Cedric Encarnacion <cedricjustine.encarnacion@analog.com>
Link: https://lore.kernel.org/r/20250709-adp1051-v5-2-539254692252@analog.com
[groeck: Dropped unnecessaary spaces after type casts]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Add regulator support for the single-channel LTP8800-1A/-2/-4A 150A/135A/200A DC/DC µModule Regulator. Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Cedric Encarnacion <cedricjustine.encarnacion@analog.com> Link: https://lore.kernel.org/r/20250709-adp1051-v5-3-539254692252@analog.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
db5163b to
b167147
Compare


PR Description
PR Type
PR Checklist