Re: [PATCH 0/4 v4] pin controller subsystem v4

From: Linus Walleij
Date: Fri Aug 26 2011 - 03:57:53 EST


On Fri, Aug 26, 2011 at 3:58 AM, Barry Song <21cnbao@xxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/