aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/pinctrl-xway.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pinctrl/pinctrl-xway.c')
-rw-r--r--drivers/pinctrl/pinctrl-xway.c14
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,
466 *config = LTQ_PINCONF_PACK(param, 1); 466 *config = LTQ_PINCONF_PACK(param, 1);
467 break; 467 break;
468 468
469 case LTQ_PINCONF_PARAM_OUTPUT:
470 reg = GPIO_DIR(pin);
471 *config = LTQ_PINCONF_PACK(param,
472 gpio_getbit(info->membase[0], reg, PORT_PIN(pin)));
473 break;
469 default: 474 default:
470 dev_err(pctldev->dev, "Invalid config param %04x\n", param); 475 dev_err(pctldev->dev, "Invalid config param %04x\n", param);
471 return -ENOTSUPP; 476 return -ENOTSUPP;
@@ -515,6 +520,14 @@ static int xway_pinconf_set(struct pinctrl_dev *pctldev,
515 dev_err(pctldev->dev, "Invalid pull value %d\n", arg); 520 dev_err(pctldev->dev, "Invalid pull value %d\n", arg);
516 break; 521 break;
517 522
523 case LTQ_PINCONF_PARAM_OUTPUT:
524 reg = GPIO_DIR(pin);
525 if (arg == 0)
526 gpio_clearbit(info->membase[0], reg, PORT_PIN(pin));
527 else
528 gpio_setbit(info->membase[0], reg, PORT_PIN(pin));
529 break;
530
518 default: 531 default:
519 dev_err(pctldev->dev, "Invalid config param %04x\n", param); 532 dev_err(pctldev->dev, "Invalid config param %04x\n", param);
520 return -ENOTSUPP; 533 return -ENOTSUPP;
@@ -573,6 +586,7 @@ static inline int xway_mux_apply(struct pinctrl_dev *pctrldev,
573static const struct ltq_cfg_param xway_cfg_params[] = { 586static const struct ltq_cfg_param xway_cfg_params[] = {
574 {"lantiq,pull", LTQ_PINCONF_PARAM_PULL}, 587 {"lantiq,pull", LTQ_PINCONF_PARAM_PULL},
575 {"lantiq,open-drain", LTQ_PINCONF_PARAM_OPEN_DRAIN}, 588 {"lantiq,open-drain", LTQ_PINCONF_PARAM_OPEN_DRAIN},
589 {"lantiq,output", LTQ_PINCONF_PARAM_OUTPUT},
576}; 590};
577 591
578static struct ltq_pinmux_info xway_info = { 592static struct ltq_pinmux_info xway_info = {