Skip to content
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

[drivers][gpio]: Support TCA9536 #84057

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

RafaelLaya
Copy link
Contributor

@RafaelLaya RafaelLaya commented Jan 15, 2025

The PCA953x driver supports the TCA953x family of GPIO expanders from TI. Currently, it makes the assumption that there are always 8 pins on the module. However, the variant TCA9536 is identical to TCA9538 except it only has 4 output pins.

To properly support TCA953x, we need to allow for a number of GPIOs that aren't 8. This change allows this in the driver.

There seem to be no DTS definitions in the Zephyr tree where ngpios isn't explicitly selected for this driver, so no definitions are changing besides just the driver in this PR.

@zephyrbot zephyrbot added area: GPIO platform: TI SimpleLink Texas Instruments SimpleLink MCU labels Jan 15, 2025
@RafaelLaya RafaelLaya force-pushed the tca9536_support branch 2 times, most recently from e244497 to 4a6d047 Compare January 15, 2025 22:23
@RafaelLaya
Copy link
Contributor Author

Bump

@vaishnavachath
Copy link
Collaborator

vaishnavachath commented Jan 20, 2025

@RafaelLaya now that user can put any ngpios, should the driver check for valid inputs (8 or 4) and handle errors accordingly? also can you update the commit title to follow the pattern followed in the subsystem ? do a git log --oneline drivers/gpio/ to find that.

@RafaelLaya
Copy link
Contributor Author

Thanks! I've addressed validation with a build-assert checking for 4 or 8 on the gpios property and fixed the git commit title

@RafaelLaya
Copy link
Contributor Author

Latest version fixes syntax error introduced on the previous revision

@RafaelLaya
Copy link
Contributor Author

Any reviewers?

@RafaelLaya
Copy link
Contributor Author

Rebased

The PCA953x driver supports the TCA953x family

To properly support TCA953x, we need to allow ngpios!=8

This change allows this posibility in the driver

Signed-off-by: Rafael Laya <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: GPIO platform: TI SimpleLink Texas Instruments SimpleLink MCU
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants