[PATCH v3 3/3] gpio: pxa: request pinmux function for gpio

Linus Walleij linus.walleij at linaro.org
Sun Jan 1 09:22:07 EST 2012


On Thu, Dec 22, 2011 at 9:17 AM, Haojian Zhuang
<haojian.zhuang at marvell.com> wrote:

> While gpio is requested for pxa, gpio driver will request function ready
> on pin.
(...)

> +#ifdef CONFIG_PINMUX
> +static int pxa_gpio_request(struct gpio_chip *chip, unsigned offset)
> +{
> +       return pinmux_request_gpio(chip->base + offset);
> +}
> +
> +static void pxa_gpio_free(struct gpio_chip *chip, unsigned offset)
> +{
> +       pinmux_free_gpio(chip->base + offset);
> +}
> +#else
> +static int pxa_gpio_request(struct gpio_chip *chip, unsigned offset) {return 0;}
> +static void pxa_gpio_free(struct gpio_chip *chip, unsigned offset) {}
> +#endif
> +

Skip the #ifdef, the pinmux portion of pinctrl already provides stubs if
CONFIG_PINMUX is not selected. See <linux/pinctrl/pinmux.h>

Yours,
Linus Walleij



More information about the linux-arm-kernel mailing list