aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-03-11 03:06:18 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2017-03-11 03:06:18 -0500
commitcb853a82dfe48a60b63831191e8d1d8a1b8b116c (patch)
treef3cf59017662a1c73dab95abed70f238971b8c54
parent24c534bb161b8c95f261b34cbe44bbd043e829fc (diff)
parent96e1ce8fcd66d850196758c038bd9d6f7857c518 (diff)
Merge tag 'pinctrl-v4.11-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl
Pull pinctrl fixes from Linus Walleij: "Two smaller pin control fixes for the v4.11 series: - Add a get_direction() function to the qcom driver - Fix two pin names in the uniphier driver" * tag 'pinctrl-v4.11-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: pinctrl: uniphier: change pin names of aio/xirq for LD11 pinctrl: qcom: add get_direction function
-rw-r--r--drivers/pinctrl/qcom/pinctrl-msm.c15
-rw-r--r--drivers/pinctrl/uniphier/pinctrl-uniphier-ld11.c12
2 files changed, 21 insertions, 6 deletions
diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c
index f8e9e1c2b2f6..c978be5eb9eb 100644
--- a/drivers/pinctrl/qcom/pinctrl-msm.c
+++ b/drivers/pinctrl/qcom/pinctrl-msm.c
@@ -422,6 +422,20 @@ static int msm_gpio_direction_output(struct gpio_chip *chip, unsigned offset, in
422 return 0; 422 return 0;
423} 423}
424 424
425static int msm_gpio_get_direction(struct gpio_chip *chip, unsigned int offset)
426{
427 struct msm_pinctrl *pctrl = gpiochip_get_data(chip);
428 const struct msm_pingroup *g;
429 u32 val;
430
431 g = &pctrl->soc->groups[offset];
432
433 val = readl(pctrl->regs + g->ctl_reg);
434
435 /* 0 = output, 1 = input */
436 return val & BIT(g->oe_bit) ? 0 : 1;
437}
438
425static int msm_gpio_get(struct gpio_chip *chip, unsigned offset) 439static int msm_gpio_get(struct gpio_chip *chip, unsigned offset)
426{ 440{
427 const struct msm_pingroup *g; 441 const struct msm_pingroup *g;
@@ -510,6 +524,7 @@ static void msm_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
510static struct gpio_chip msm_gpio_template = { 524static struct gpio_chip msm_gpio_template = {
511 .direction_input = msm_gpio_direction_input, 525 .direction_input = msm_gpio_direction_input,
512 .direction_output = msm_gpio_direction_output, 526 .direction_output = msm_gpio_direction_output,
527 .get_direction = msm_gpio_get_direction,
513 .get = msm_gpio_get, 528 .get = msm_gpio_get,
514 .set = msm_gpio_set, 529 .set = msm_gpio_set,
515 .request = gpiochip_generic_request, 530 .request = gpiochip_generic_request,
diff --git a/drivers/pinctrl/uniphier/pinctrl-uniphier-ld11.c b/drivers/pinctrl/uniphier/pinctrl-uniphier-ld11.c
index 77a0236ee781..83f8864fa76a 100644
--- a/drivers/pinctrl/uniphier/pinctrl-uniphier-ld11.c
+++ b/drivers/pinctrl/uniphier/pinctrl-uniphier-ld11.c
@@ -390,22 +390,22 @@ static const struct pinctrl_pin_desc uniphier_ld11_pins[] = {
390 UNIPHIER_PINCTRL_PIN(140, "AO1D0", 140, 390 UNIPHIER_PINCTRL_PIN(140, "AO1D0", 140,
391 140, UNIPHIER_PIN_DRV_1BIT, 391 140, UNIPHIER_PIN_DRV_1BIT,
392 140, UNIPHIER_PIN_PULL_DOWN), 392 140, UNIPHIER_PIN_PULL_DOWN),
393 UNIPHIER_PINCTRL_PIN(141, "TCON0", 141, 393 UNIPHIER_PINCTRL_PIN(141, "AO1D1", 141,
394 141, UNIPHIER_PIN_DRV_1BIT, 394 141, UNIPHIER_PIN_DRV_1BIT,
395 141, UNIPHIER_PIN_PULL_DOWN), 395 141, UNIPHIER_PIN_PULL_DOWN),
396 UNIPHIER_PINCTRL_PIN(142, "TCON1", 142, 396 UNIPHIER_PINCTRL_PIN(142, "AO1D2", 142,
397 142, UNIPHIER_PIN_DRV_1BIT, 397 142, UNIPHIER_PIN_DRV_1BIT,
398 142, UNIPHIER_PIN_PULL_DOWN), 398 142, UNIPHIER_PIN_PULL_DOWN),
399 UNIPHIER_PINCTRL_PIN(143, "TCON2", 143, 399 UNIPHIER_PINCTRL_PIN(143, "XIRQ9", 143,
400 143, UNIPHIER_PIN_DRV_1BIT, 400 143, UNIPHIER_PIN_DRV_1BIT,
401 143, UNIPHIER_PIN_PULL_DOWN), 401 143, UNIPHIER_PIN_PULL_DOWN),
402 UNIPHIER_PINCTRL_PIN(144, "TCON3", 144, 402 UNIPHIER_PINCTRL_PIN(144, "XIRQ10", 144,
403 144, UNIPHIER_PIN_DRV_1BIT, 403 144, UNIPHIER_PIN_DRV_1BIT,
404 144, UNIPHIER_PIN_PULL_DOWN), 404 144, UNIPHIER_PIN_PULL_DOWN),
405 UNIPHIER_PINCTRL_PIN(145, "TCON4", 145, 405 UNIPHIER_PINCTRL_PIN(145, "XIRQ11", 145,
406 145, UNIPHIER_PIN_DRV_1BIT, 406 145, UNIPHIER_PIN_DRV_1BIT,
407 145, UNIPHIER_PIN_PULL_DOWN), 407 145, UNIPHIER_PIN_PULL_DOWN),
408 UNIPHIER_PINCTRL_PIN(146, "TCON5", 146, 408 UNIPHIER_PINCTRL_PIN(146, "XIRQ13", 146,
409 146, UNIPHIER_PIN_DRV_1BIT, 409 146, UNIPHIER_PIN_DRV_1BIT,
410 146, UNIPHIER_PIN_PULL_DOWN), 410 146, UNIPHIER_PIN_PULL_DOWN),
411 UNIPHIER_PINCTRL_PIN(147, "PWMA", 147, 411 UNIPHIER_PINCTRL_PIN(147, "PWMA", 147,