diff options
author | Heiko Stübner <heiko@sntech.de> | 2014-04-23 08:27:51 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2014-04-23 17:18:37 -0400 |
commit | dab3eba7c13cff58dbff767dd02ffb847255ddd3 (patch) | |
tree | ab7ecdc109704d303f31d7e847d3f74487e6f0aa /drivers/pinctrl/pinctrl-rockchip.c | |
parent | 7420d2d09b1279996e06efa6792f9f13c1863b1e (diff) |
pinctrl: rockchip: return a complete config in pinconf_get
Till now pinconf_get only set the argument value into the config parameter
effectively removing the actual config param value. As other pinctrl drivers
do, it might be nicer to keep the config param intact.
Therefore construct a real pinconfig value from param and arg in pinconf_get
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/pinctrl-rockchip.c')
-rw-r--r-- | drivers/pinctrl/pinctrl-rockchip.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c index 96c60d230c13..ae3dfe7642f1 100644 --- a/drivers/pinctrl/pinctrl-rockchip.c +++ b/drivers/pinctrl/pinctrl-rockchip.c | |||
@@ -740,13 +740,14 @@ static int rockchip_pinconf_get(struct pinctrl_dev *pctldev, unsigned int pin, | |||
740 | struct rockchip_pinctrl *info = pinctrl_dev_get_drvdata(pctldev); | 740 | struct rockchip_pinctrl *info = pinctrl_dev_get_drvdata(pctldev); |
741 | struct rockchip_pin_bank *bank = pin_to_bank(info, pin); | 741 | struct rockchip_pin_bank *bank = pin_to_bank(info, pin); |
742 | enum pin_config_param param = pinconf_to_config_param(*config); | 742 | enum pin_config_param param = pinconf_to_config_param(*config); |
743 | u16 arg; | ||
743 | 744 | ||
744 | switch (param) { | 745 | switch (param) { |
745 | case PIN_CONFIG_BIAS_DISABLE: | 746 | case PIN_CONFIG_BIAS_DISABLE: |
746 | if (rockchip_get_pull(bank, pin - bank->pin_base) != param) | 747 | if (rockchip_get_pull(bank, pin - bank->pin_base) != param) |
747 | return -EINVAL; | 748 | return -EINVAL; |
748 | 749 | ||
749 | *config = 0; | 750 | arg = 0; |
750 | break; | 751 | break; |
751 | case PIN_CONFIG_BIAS_PULL_UP: | 752 | case PIN_CONFIG_BIAS_PULL_UP: |
752 | case PIN_CONFIG_BIAS_PULL_DOWN: | 753 | case PIN_CONFIG_BIAS_PULL_DOWN: |
@@ -758,13 +759,15 @@ static int rockchip_pinconf_get(struct pinctrl_dev *pctldev, unsigned int pin, | |||
758 | if (rockchip_get_pull(bank, pin - bank->pin_base) != param) | 759 | if (rockchip_get_pull(bank, pin - bank->pin_base) != param) |
759 | return -EINVAL; | 760 | return -EINVAL; |
760 | 761 | ||
761 | *config = 1; | 762 | arg = 1; |
762 | break; | 763 | break; |
763 | default: | 764 | default: |
764 | return -ENOTSUPP; | 765 | return -ENOTSUPP; |
765 | break; | 766 | break; |
766 | } | 767 | } |
767 | 768 | ||
769 | *config = pinconf_to_config_packed(param, arg); | ||
770 | |||
768 | return 0; | 771 | return 0; |
769 | } | 772 | } |
770 | 773 | ||