sh-pfc: Clean up pin configuration type handling
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Sun, 10 Mar 2013 16:25:29 +0000 (17:25 +0100)
committerLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Fri, 15 Mar 2013 12:33:54 +0000 (13:33 +0100)
commit9fddc4a589c6d1bd9c935d445b1a1d216b1457ab
tree7d2c00beb3508a6502384ae9b7051712f3918f8f
parent0d00f00a1077ae89fb0ecbbba8da4c2c6bc93446
sh-pfc: Clean up pin configuration type handling

Set pin configuration type to

- PINMUX_TYPE_NONE at initialization time and when disabling a function
  or freeing a GPIO

- PINMUX_TYPE_FUNCTION when enabling a function

- PINMUX_TYPE_INPUT or PINMUX_TYPE_OUTPUT when setting the GPIO
  direction

Verify that the type is PINMUX_TYPE_NONE when enabling a function or
requesting a GPIO and return -EBUSY if it isn't.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/sh-pfc/pinctrl.c