-
Notifications
You must be signed in to change notification settings - Fork 904
add MAX17616/MAX17616A driver #2949
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
c3062cc
to
4b58025
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also missing kconfig.adi patch. And you know the drill already :). Please send this upstream.
compatible: | ||
enum: | ||
- adi,max17616 | ||
- adi,max17616a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why 2 compatibles? What's the difference between the variants? It seems that in terms of SW there's none (apart from the name)...
drivers/hwmon/pmbus/max17616.c
Outdated
return dev_err_probe(dev, ret, "Failed to read MFR_MODEL\n"); | ||
|
||
if ((strncmp(buf + 1, "MAX17616", 8) && strncmp(buf + 1, "MAX17616A", 9))) | ||
return dev_err_probe(dev, -ENODEV, "Unsupported device\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really want to have the above? And I guess that if ((strncmp(buf + 1, "MAX17616", 8))
should be enough, no? AFAICT, the two variants are pretty much compatible?
drivers/hwmon/pmbus/max17616.c
Outdated
static struct i2c_driver max17616_driver = { | ||
.driver = { | ||
.name = "max17616", | ||
.of_match_table = of_match_ptr(max17616_of_match), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please drop of_match_ptr()
Series applied upstream, add ADI compliant version. |
Add device tree documentation for MAX17616/MAX17616A current-limiter with overvoltage/surge, undervoltage, reverse polarity, loss of ground protection with PMBus interface. Signed-off-by: Kim Seer Paller <kimseer.paller@analog.com> Acked-by: Conor Dooley <conor.dooley@microchip.com> Link: https://lore.kernel.org/r/20250930-upstream-max17616-v1-1-1525a85f126c@analog.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Add interrupt property to document the SMBALERT pin functionality for fault condition signal. Suggested-by: Marcelo Schmitt <marcelo.schmitt@analog.com> Signed-off-by: Kim Seer Paller <kimseer.paller@analog.com> Acked-by: Conor Dooley <conor.dooley@microchip.com> Link: https://lore.kernel.org/r/20251013-upstream-max17616-v1-1-0e15002479c3@analog.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Add support for MAX17616/MAX17616A current-limiter with overvoltage/surge, undervoltage, reverse polarity, loss of ground protection with PMBus interface. The PMBus interface allows monitoring of input/output voltages, output current and temperature. Signed-off-by: Kim Seer Paller <kimseer.paller@analog.com> Link: https://lore.kernel.org/r/20250930-upstream-max17616-v1-2-1525a85f126c@analog.com [groeck: Fixed htmldocs 'WARNING: Title underline too short' as reported by Kriish Sharma <kriish.sharma2006@gmail.com>] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Add MAX17616 to the ADI Kconfig. Signed-off-by: Kim Seer Paller <kimseer.paller@analog.com>
Follow up patch and updates added |
|
||
static int max17616_probe(struct i2c_client *client) | ||
{ | ||
return pmbus_do_probe(client, &max17616_info); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From CI:
ERROR: modpost: module max17616 uses symbol pmbus_do_probe from namespace PMBUS, but does not import it.
you are using a symbol from PMBUS, but not setting on the Kconfig that your driver depends
on it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't think that's the issue. I think the problem is that MODULE_IMPORT_NS("PMBUS");
needs to be MODULE_IMPORT_NS(PMBUS);
There was a conversion upstream to quote the namespace that happened after 6.12.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do notice in our tree the unquoted syntax MODULE_IMPORT_NS(PMBUS);
is used. I will update the driver to make it compliant to our tree.
in1_label "vin" | ||
in1_input Measured input voltage | ||
in1_alarm Input voltage alarm | ||
in2_label "vout1" | ||
in2_input Measured output voltage | ||
curr1_label "iout1" | ||
curr1_input Measured output current. | ||
curr1_alarm Output current alarm | ||
temp1_input Measured temperature | ||
temp1_alarm Chip temperature alarm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you mixing tabs and spaces here?
Consider just using spaces
* Analog Devices MAX17616/MAX17616A | ||
|
||
Prefix: 'max17616' | ||
|
||
Addresses scanned: - | ||
|
||
Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/max17616-max17616a.pdf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Analog Devices MAX17616/MAX17616A | |
Prefix: 'max17616' | |
Addresses scanned: - | |
Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/max17616-max17616a.pdf | |
- | Analog Devices MAX17616/MAX17616A | |
| Prefix: 'max17616' | |
| Addresses scanned: - | |
| Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/max17616-max17616a.pdf |
You can force linebreaks using this syntax
|
||
Author: | ||
|
||
- Kim Seer Paller <kimseer.paller@analog.com> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leading whitespace has a meaning in rst, it will nest the list in a block.
It is not a big deal, but does have an effect.
----------- | ||
|
||
This driver does not auto-detect devices. You will have to instantiate | ||
the devices explicitly. Please see Documentation/i2c/instantiating-devices.rst |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the devices explicitly. Please see Documentation/i2c/instantiating-devices.rst | |
the devices explicitly. Please see :doc:`/i2c/instantiating-devices` |
https://www.sphinx-doc.org/en/master/usage/referencing.html#role-doc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note these are patches already applied upstream. So any change needs to go first there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used existing driver's rst as template. Should I update to consistent spacing/syntax or keep the current format for consistency with other docs?
PR Description
Add MAX17616/MAX17616A Current-Limiter with Overvoltage/Surge, Undervoltage, Reverse Polarity, Loss of Ground Protection with PMBus Interface
Lore: https://patchew.org/linux/20250930-upstream-max17616-v1-0-1525a85f126c@analog.com/
PR Type
PR Checklist