Skip to content

Conversation

kseerp
Copy link
Member

@kseerp kseerp commented Sep 23, 2025

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

  • Bug fix (a change that fixes an issue)
  • New feature (a change that adds new functionality)
  • Breaking change (a change that affects other repos or cause CIs to fail)

PR Checklist

  • I have conducted a self-review of my own code changes
  • I have tested the changes on the relevant hardware
  • I have updated the documentation outside this repo accordingly (if there is the case)

Copy link
Collaborator

@nunojsa nunojsa left a 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
Copy link
Collaborator

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)...

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");
Copy link
Collaborator

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?

static struct i2c_driver max17616_driver = {
.driver = {
.name = "max17616",
.of_match_table = of_match_ptr(max17616_of_match),
Copy link
Collaborator

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()

@kseerp
Copy link
Member Author

kseerp commented Oct 13, 2025

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>
@kseerp
Copy link
Member Author

kseerp commented Oct 16, 2025

Follow up patch and updates added


static int max17616_probe(struct i2c_client *client)
{
return pmbus_do_probe(client, &max17616_info);
Copy link
Contributor

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.

Copy link
Collaborator

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.

Copy link
Member Author

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.

Comment on lines +52 to +61
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
Copy link
Contributor

@gastmaier gastmaier Oct 16, 2025

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

Comment on lines +8 to +14
* Analog Devices MAX17616/MAX17616A

Prefix: 'max17616'

Addresses scanned: -

Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/max17616-max17616a.pdf
Copy link
Contributor

@gastmaier gastmaier Oct 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* 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>
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

Copy link
Collaborator

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

Copy link
Member Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants