mcp23s17 fixes
#6763
Is doing a get on BIAS_DISABLE really a thing?
Is doing a get on BIAS_DISABLE really a thing?
Most drivers seem to think so: https://github.com/raspberrypi/linux/blob/rpi-6.12.y/drivers/pinctrl/pinctrl-as3722.c#L332 https://github.com/raspberrypi/linux/blob/rpi-6.12.y/drivers/pinctrl/pinctrl-at91-pio4.c#L751 https://github.com/raspberrypi/linux/blob/rpi-6.12.y/drivers/pinctrl/pinctrl-bm1880.c#L1173 https://github.com/raspberrypi/linux/blob/rpi-6.12.y/drivers/pinctrl/bcm/pinctrl-bcm2835.c#L1135 https://github.com/raspberrypi/linux/blob/rpi-6.12.y/drivers/pinctrl/pinctrl-rp1.c#L1470
Although I can't find the definitive docs for what it meant to be returned when, and what the argument part of the configs array is meant to mean for set and get for each param value. That one may need to be refined.
I'd say this is an exemplary implementation: https://github.com/raspberrypi/linux/blob/rpi-6.12.y/drivers/pinctrl/pinctrl-rp1.c#L1470-L1472
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).