-
Notifications
You must be signed in to change notification settings - Fork 5.1k
MCP23S17 bias pull-up not working #6763
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
Comments
Has this worked before with older kernels? |
It might be a driver issue. I created the following patch, and it seems to work well.
|
I've reproduced the same issue on MCP23017 (the I2C version of the chip). I'll agree that it's a driver issue. We haven't modified that driver from upstream, so it would be worth reporting upstream too.
Although they'll obviously be happy with a patch fixing it too. Your I don't know if pinconf_set(PIN_CONFIG_BIAS_DISABLE) is guaranteed to have an argument of 0, if not then you could have a disable call result in setting the pull-up. Note the docs for gpiochip_add_pin_range say
I think that means that the overlay should be adding a gpio-ranges property, but I've not looked into the syntax that is required. |
For the Pi 4's combined GPIO/pinctrl driver node there is:
This declares that all 58 GPIOs have corresponding pinctrl identities. Don't ask me which 0 is which. Therefore each combined gpio/pinctrl instance that is added will need |
pinctrl-bcm2835 (supporting up to bcm2711/Pi4) also has a manual I haven't checked whether that is called seeing as there is a gpio-ranges property defined. |
The name of the function from which it is called ( |
So it's not a driver bug, but the omission of the gpio-ranges from the overlay.
|
Take it back - I had a patched module on my test system :-( |
Maybe we still need to make some changes, including adding |
Yup, it needs a combination of things. gpio-ranges removes the need for the I'll try and make a coherent patch set. |
|
Pretty much. See #6769. Seeing as these should go upstream, each element needs to be a separate patch. |
Hi, I also noticed that the dtoverlay for the MCP23S17 sets the maximum SPI speed to 0.5 MHz, whereas according to the datasheet, these chips can operate at speeds up to 10 MHz. |
Describe the bug
pinctrl-mcp23s08 driver unable to enable pull-up resister on MCP23S17(
dtoverlay=mcp23s17
)Steps to reproduce the behaviour
using the following command to read pin 0 on gpiochip2 (MCP23S17 on SPI0.0)
Device (s)
Raspberry Pi 4 Mod. B
System
Linux dev 6.12.20+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.12.20-1+rpt1~bpo12+1 (2025-03-19) aarch64 GNU/Linux
Logs
No response
Additional context
reading GPPUA directly from device return 0b00000000, which indicate that pull-up is not enabled
The text was updated successfully, but these errors were encountered: