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

mcp23s17 fixes #6769

Open
wants to merge 4 commits into
base: rpi-6.12.y
Choose a base branch
from
Open

mcp23s17 fixes #6769

wants to merge 4 commits into from

Conversation

6by9
Copy link
Contributor

@6by9 6by9 commented Apr 3, 2025

6by9 added 4 commits April 3, 2025 16:16
All DT configured GPIO controllers are meant to have gpio-ranges
if linking pinctrl and gpio. As the mcp23s17 driver does, add them.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
In order for gpio-ranges to be registered correctly, the
pinctrl device needs to be registered before the gpiochip.
The mcp23s08 driver was doing them in the opposite order.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
In order to use gpioget to set bias pull up settings, the
gpiochip function list needs a set_config function.

gpiochip_generic_config is applicable for mcp23s08, so
configure it.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Whilst PIN_CONFIG_BIAS_PULL_UP had been implemented to enable
the 100k pull-up resistor, PIN_CONFIG_BIAS_DISABLE hadn't been
implemented to disable it again.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
@pelwell
Copy link
Contributor

pelwell commented Apr 3, 2025

Is doing a get on BIAS_DISABLE really a thing?

@6by9
Copy link
Contributor Author

6by9 commented Apr 3, 2025

@pelwell
Copy link
Contributor

pelwell commented Apr 3, 2025

@pelwell
Copy link
Contributor

pelwell commented Apr 5, 2025

If we treat the pinconf_get semantics for the individual bias modes as a boolean query as to whether or not that mode is selected, then the implementation of the BIAS_DISABLE query is wrong - the status should be (data & BIT(pin)) ? 0 : 1 (or !(data & BIT(pin)) if you prefer).

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.

2 participants