Skip to content

Conversation

csarip
Copy link

@csarip csarip commented Oct 15, 2025

Add initial support for the MAX22216/MAX22217 device. These devices have four 36 V half-bridges that support various drive modes, supported by MFD, PWM, and MISC drivers.

@csarip csarip marked this pull request as draft October 15, 2025 07:22
Copy link

Hello @csarip, and thank you very much for your first pull request to the Zephyr project!
Our Continuous Integration pipeline will execute a series of checks on your Pull Request commit messages and code, and you are expected to address any failures by updating the PR. Please take a look at our commit message guidelines to find out how to format your commit messages, and at our contribution workflow to understand how to update your Pull Request. If you haven't already, please make sure to review the project's Contributor Expectations and update (by amending and force-pushing the commits) your pull request if necessary.
If you are stuck or need help please join us on Discord and ask your question there. Additionally, you can escalate the review when applicable. 😊

@zephyrbot zephyrbot added area: PWM Pulse Width Modulation platform: ADI Analog Devices, Inc. area: Devicetree Bindings area: Boards/SoCs area: Tests Issues related to a particular existing or missing test area: MFD labels Oct 15, 2025
@csarip csarip marked this pull request as ready for review October 15, 2025 09:09
Copy link
Member

@MaureenHelm MaureenHelm left a comment

Choose a reason for hiding this comment

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

Thanks @csarip!

Comment on lines 12 to 20
#if PWM_MAX2221X

config PWM_MAX2221X_INIT_PRIORITY
int "Init priority"
default 80
help
Analog Devices MAX22216/MAX22217 PWM driver initialization priority.

#endif #PWM_MAX2221X
Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason not to use PWM_INIT_PRIORITY?

If you do need a driver-specific init priority, you need to uncomment the if/endif statements and convert config PWM_MAX2221X to a menuconfig

Copy link
Author

Choose a reason for hiding this comment

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

Is there a reason not to use PWM_INIT_PRIORITY?

If you do need a driver-specific init priority, you need to uncomment the if/endif statements and convert config PWM_MAX2221X to a menuconfig

Thank you for the suggestion. I’ve converted it to a menuconfig option instead. I had to assign a different initialization priority value to the PWM to ensure that its dependency, the MFD, initializes first. By default, CONFIG_MFD_INIT_PRIORITY is 80, while CONFIG_PWM_INIT_PRIORITY is 50, which causes the PWM to initialize before its dependency.

Implements SPI-based register access (read, write, update) for the
MAX22216/MAX22217 multi-function device.

Signed-off-by: Cherrence Sarip <[email protected]>
@csarip csarip force-pushed the upstream/dev-max2221x branch from 980e049 to 7a1986f Compare October 22, 2025 09:39
Add MISC driver support for the MAX22216/MAX22217 device.
The driver provides miscellaneous functions and uses the parent
MFD device for register access.

Signed-off-by: John Erasmus Mari Geronimo <[email protected]>
Signed-off-by: Cherrence Sarip <[email protected]>
Implements PWM driver support for the MAX22216/MAX22217 device.
This driver integrates with the Zephyr PWM API and uses the parent
MFD device to perform register access.

Signed-off-by: Cherrence Sarip <[email protected]>
@csarip csarip force-pushed the upstream/dev-max2221x branch from 7a1986f to be50311 Compare October 22, 2025 09:46
@csarip
Copy link
Author

csarip commented Oct 22, 2025

v2:

  • added suggested changes in pwm_max2221x.c and misc Kconfig
  • converted config PWM_MAX2221X to a menuconfig
  • added an entry in tests/drivers/build_all/pwm/testcase.yaml

Copy link

@ttmut
Copy link
Contributor

ttmut commented Oct 22, 2025

Please check the issues found by SonarQube cloud analysis as well. Especially the warnings about misleading //.

Issues 21 New issues 0 Accepted issues

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

Labels

area: Boards/SoCs area: Devicetree Bindings area: MFD area: PWM Pulse Width Modulation area: Tests Issues related to a particular existing or missing test platform: ADI Analog Devices, Inc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants