On Fri, Aug 26, 2011 at 3:58 AM, Barry Song 21cnbao@gmail.com wrote:
Do you want the pinmux_request_gpio called by the gpiolib driver or by every device driver who uses this gpio?
I always thought about the gpiolib driver.
I think Grant told me he wanted drivers with combined GPIO and pinmuxing to reside in drivers/pinctrl and expose an additional gpiolib interface.
Do you think the following make sense in gpiolib driver? static int xxx_gpio_request(struct gpio_chip *chip, unsigned offset) { int ret = 0;
ret = pinmux_request_gpio(chip->base + offset); if (ret) goto out; ..... out: return ret; }
Looks sane to me. It's a bit unfortunate to have to subtract the base and then add it again before passing to pinmux but the idea is to drop the global GPIO pinspace down the road and then it makes more sense.
Yours, Linus Walleij