diff options
author | John Crispin <blogic@openwrt.org> | 2013-02-01 13:04:58 +0100 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2013-02-05 16:17:22 +0100 |
commit | 6360350cbc0567f51afacb2d1e6a8e611b3b9b2b (patch) | |
tree | c0e2d28aab28cc4a831dadec9c2e6477329d3472 /drivers/pinctrl/pinctrl-xway.c | |
parent | 3a6b04ca33a225dd64fcd5f4469b7b1088f16c37 (diff) | |
download | linux-6360350cbc0567f51afacb2d1e6a8e611b3b9b2b.tar.gz linux-6360350cbc0567f51afacb2d1e6a8e611b3b9b2b.tar.bz2 linux-6360350cbc0567f51afacb2d1e6a8e611b3b9b2b.zip |
pinctrl/lantiq: add output pinconf parameter
While converting the boards inside OpenWrt to OF I noticed
that the we are missing a pinconf parameter to set a pin
to output.
Signed-off-by: John Crispin <blogic@openwrt.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/pinctrl-xway.c')
-rw-r--r-- | drivers/pinctrl/pinctrl-xway.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/pinctrl/pinctrl-xway.c b/drivers/pinctrl/pinctrl-xway.c index aa4c8b815c20..b23b8954ae31 100644 --- a/drivers/pinctrl/pinctrl-xway.c +++ b/drivers/pinctrl/pinctrl-xway.c @@ -466,6 +466,11 @@ static int xway_pinconf_get(struct pinctrl_dev *pctldev, *config = LTQ_PINCONF_PACK(param, 1); break; + case LTQ_PINCONF_PARAM_OUTPUT: + reg = GPIO_DIR(pin); + *config = LTQ_PINCONF_PACK(param, + gpio_getbit(info->membase[0], reg, PORT_PIN(pin))); + break; default: dev_err(pctldev->dev, "Invalid config param %04x\n", param); return -ENOTSUPP; @@ -515,6 +520,14 @@ static int xway_pinconf_set(struct pinctrl_dev *pctldev, dev_err(pctldev->dev, "Invalid pull value %d\n", arg); break; + case LTQ_PINCONF_PARAM_OUTPUT: + reg = GPIO_DIR(pin); + if (arg == 0) + gpio_clearbit(info->membase[0], reg, PORT_PIN(pin)); + else + gpio_setbit(info->membase[0], reg, PORT_PIN(pin)); + break; + default: dev_err(pctldev->dev, "Invalid config param %04x\n", param); return -ENOTSUPP; @@ -573,6 +586,7 @@ static inline int xway_mux_apply(struct pinctrl_dev *pctrldev, static const struct ltq_cfg_param xway_cfg_params[] = { {"lantiq,pull", LTQ_PINCONF_PARAM_PULL}, {"lantiq,open-drain", LTQ_PINCONF_PARAM_OPEN_DRAIN}, + {"lantiq,output", LTQ_PINCONF_PARAM_OUTPUT}, }; static struct ltq_pinmux_info xway_info = { |