diff options
author | Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> | 2016-09-06 11:14:14 -0400 |
---|---|---|
committer | Geert Uytterhoeven <geert+renesas@glider.be> | 2016-09-12 04:58:23 -0400 |
commit | 40ade582194668aa4336a30f96c9d592c46a1928 (patch) | |
tree | b8c9aec6edced88f3e7bbcecfe9a7441ba9f7971 | |
parent | c30716894e96ed1e76bf32ae68c5438350700496 (diff) |
pinctrl: sh-pfc: Return pinconf with arguments in packed format
The pinconf-generic code expects configurations with arguments to be
returned in a packed format in order to be displayed properly by
pinconf_generic_dump_one().
Reading /sys/kernel/debug/pinctrl/e6060000.pfc/pinconf-pins on
r8a7795/salvator-x now shows:
pin 101 (GP_3_5): output drive strength (9 mA), pin power source (3300 selector)
Instead of:
pin 101 (GP_3_5): output drive strength (0 mA), pin power source (0 selector)
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
-rw-r--r-- | drivers/pinctrl/sh-pfc/pinctrl.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/pinctrl/sh-pfc/pinctrl.c b/drivers/pinctrl/sh-pfc/pinctrl.c index e208ee04a9f4..c5772584594c 100644 --- a/drivers/pinctrl/sh-pfc/pinctrl.c +++ b/drivers/pinctrl/sh-pfc/pinctrl.c | |||
@@ -596,6 +596,7 @@ static int sh_pfc_pinconf_get(struct pinctrl_dev *pctldev, unsigned _pin, | |||
596 | struct sh_pfc *pfc = pmx->pfc; | 596 | struct sh_pfc *pfc = pmx->pfc; |
597 | enum pin_config_param param = pinconf_to_config_param(*config); | 597 | enum pin_config_param param = pinconf_to_config_param(*config); |
598 | unsigned long flags; | 598 | unsigned long flags; |
599 | unsigned int arg; | ||
599 | 600 | ||
600 | if (!sh_pfc_pinconf_validate(pfc, _pin, param)) | 601 | if (!sh_pfc_pinconf_validate(pfc, _pin, param)) |
601 | return -ENOTSUPP; | 602 | return -ENOTSUPP; |
@@ -616,7 +617,7 @@ static int sh_pfc_pinconf_get(struct pinctrl_dev *pctldev, unsigned _pin, | |||
616 | if (bias != param) | 617 | if (bias != param) |
617 | return -EINVAL; | 618 | return -EINVAL; |
618 | 619 | ||
619 | *config = 0; | 620 | arg = 0; |
620 | break; | 621 | break; |
621 | } | 622 | } |
622 | 623 | ||
@@ -627,7 +628,7 @@ static int sh_pfc_pinconf_get(struct pinctrl_dev *pctldev, unsigned _pin, | |||
627 | if (ret < 0) | 628 | if (ret < 0) |
628 | return ret; | 629 | return ret; |
629 | 630 | ||
630 | *config = ret; | 631 | arg = ret; |
631 | break; | 632 | break; |
632 | } | 633 | } |
633 | 634 | ||
@@ -646,7 +647,7 @@ static int sh_pfc_pinconf_get(struct pinctrl_dev *pctldev, unsigned _pin, | |||
646 | val = sh_pfc_read_reg(pfc, pocctrl, 32); | 647 | val = sh_pfc_read_reg(pfc, pocctrl, 32); |
647 | spin_unlock_irqrestore(&pfc->lock, flags); | 648 | spin_unlock_irqrestore(&pfc->lock, flags); |
648 | 649 | ||
649 | *config = (val & BIT(bit)) ? 3300 : 1800; | 650 | arg = (val & BIT(bit)) ? 3300 : 1800; |
650 | break; | 651 | break; |
651 | } | 652 | } |
652 | 653 | ||
@@ -654,6 +655,7 @@ static int sh_pfc_pinconf_get(struct pinctrl_dev *pctldev, unsigned _pin, | |||
654 | return -ENOTSUPP; | 655 | return -ENOTSUPP; |
655 | } | 656 | } |
656 | 657 | ||
658 | *config = pinconf_to_config_packed(param, arg); | ||
657 | return 0; | 659 | return 0; |
658 | } | 660 | } |
659 | 661 | ||