diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2013-02-14 17:36:56 +0100 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2013-03-15 13:33:39 +0100 |
commit | a68fdca9b0447a0e7a85ee378510509be8b70d90 (patch) | |
tree | 2818288e43d82e8c6c7f829775800da3b59c3930 /drivers/pinctrl/sh-pfc/pinctrl.c | |
parent | 17dffe48d18f9c31ba7499af385e10bc02d7c7d9 (diff) | |
download | blackbird-obmc-linux-a68fdca9b0447a0e7a85ee378510509be8b70d90.tar.gz blackbird-obmc-linux-a68fdca9b0447a0e7a85ee378510509be8b70d90.zip |
sh-pfc: Use pinmux identifiers in the pin muxing API
The PFC core exposes a sh_pfc_config_gpio() function that configures
pinmuxing for a given GPIO (either a real GPIO or a function GPIO).
Handling of real and function GPIOs belong to the GPIO layer, move the
GPIO number to mark translation to the caller and rename the function to
sh_pfc_config_mux().
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/sh-pfc/pinctrl.c')
-rw-r--r-- | drivers/pinctrl/sh-pfc/pinctrl.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/pinctrl/sh-pfc/pinctrl.c b/drivers/pinctrl/sh-pfc/pinctrl.c index d420d9981725..a83f40070b3b 100644 --- a/drivers/pinctrl/sh-pfc/pinctrl.c +++ b/drivers/pinctrl/sh-pfc/pinctrl.c @@ -119,6 +119,7 @@ static void sh_pfc_noop_disable(struct pinctrl_dev *pctldev, unsigned func, static int sh_pfc_reconfig_pin(struct sh_pfc *pfc, unsigned offset, int new_type) { + unsigned int mark = pfc->info->pins[offset].enum_id; unsigned long flags; int pinmux_type; int ret = -EINVAL; @@ -137,7 +138,7 @@ static int sh_pfc_reconfig_pin(struct sh_pfc *pfc, unsigned offset, case PINMUX_TYPE_INPUT: case PINMUX_TYPE_INPUT_PULLUP: case PINMUX_TYPE_INPUT_PULLDOWN: - sh_pfc_config_gpio(pfc, offset, pinmux_type, GPIO_CFG_FREE); + sh_pfc_config_mux(pfc, mark, pinmux_type, GPIO_CFG_FREE); break; default: goto err; @@ -146,15 +147,13 @@ static int sh_pfc_reconfig_pin(struct sh_pfc *pfc, unsigned offset, /* * Dry run */ - if (sh_pfc_config_gpio(pfc, offset, new_type, - GPIO_CFG_DRYRUN) != 0) + if (sh_pfc_config_mux(pfc, mark, new_type, GPIO_CFG_DRYRUN) != 0) goto err; /* * Request */ - if (sh_pfc_config_gpio(pfc, offset, new_type, - GPIO_CFG_REQ) != 0) + if (sh_pfc_config_mux(pfc, mark, new_type, GPIO_CFG_REQ) != 0) goto err; pfc->info->pins[offset].flags &= ~PINMUX_FLAG_TYPE; @@ -214,7 +213,8 @@ static void sh_pfc_gpio_disable_free(struct pinctrl_dev *pctldev, pinmux_type = pfc->info->pins[offset].flags & PINMUX_FLAG_TYPE; - sh_pfc_config_gpio(pfc, offset, pinmux_type, GPIO_CFG_FREE); + sh_pfc_config_mux(pfc, pfc->info->pins[offset].enum_id, pinmux_type, + GPIO_CFG_FREE); spin_unlock_irqrestore(&pfc->lock, flags); } |