On Wed, Sep 18, 2024 at 09:21:11PM -0400, Matt Walker wrote: > Hi all -- I'm trying to do GPIO from userspace and have run into some > confusion I could use some clarification on. > > Assumption: It is not possible to set the pull up bias for a specific > line from the device tree and expose the line to user space. And it is > not possible to set the bias from the old sysfs gpio configuration. > > I'm therefore trying to use the GPIO_V2_LINE_SET_CONFIG_IOCTL to set > the bias of the line. However, the MCP23S08 (pinctrl-mcp23s08.c) > driver does not have its implementation of struct > pinconf_ops.pin_config_set called. Instead I had to add an > implementation of struct gpiochip.set_config. > > Confusion: I thought the pin controller was solely responsible for > configuration of bias and that the gpiolib would magically know that > it needs to call pinconf_ops.pin_config_set. Since it seems like an > unnecessary duplication of effort to set bias config in both pinctrl > and gpiochip, I figure I'm missing something. I thought it might be > that the MCP driver does not have an explicit call to > gpiochip_add_pin_range, but that wasn't it. I also tried adding the > pinctrl definitions suggested in the device tree mapping, and that > also didn't work. > > Thanks for any insights anyone might have! And if there's not a better > way, I'll clean up the driver and submit it as a patch. > Not my bailiwick, but looking through the code (both gpiolib and drivers) it seems to me you should set mcp->chip.set_config = gpiochip_generic_config; to hook into the magic that you are expecting. Cheers, Kent.