pinctrl: mediatek: Refine mtk_pinconf_get() and mtk_pinconf_set()
authorLight Hsieh <light.hsieh@mediatek.com>
Wed, 22 Jan 2020 06:53:11 +0000 (14:53 +0800)
committerLinus Walleij <linus.walleij@linaro.org>
Fri, 14 Feb 2020 10:31:18 +0000 (11:31 +0100)
commit3599cc525486be6681640ff3083376c001264c61
treef512a3f3f3d73f8bd824e85ee27d2c2a8af38a45
parent5f755e1f1efe5ca3b475b14169e6e85bf1411bb5
pinctrl: mediatek: Refine mtk_pinconf_get() and mtk_pinconf_set()

1.Refine mtk_pinconf_get():
  Use only one occurrence of return at end of this function.

2.Refine mtk_pinconf_set():
2.1 Use only one occurrence of return at end of this function.
2.2 Modify case of PIN_CONFIG_INPUT_ENABLE -
2.2.1
    Regard all non-zero setting value as enable, instead of always enable.
2.2.2
    Remove check of ies_present flag and always invoke mtk_hw_set_value()
    since mtk_hw_pin_field_lookup() invoked inside mtk_hw_set_value() has
    the same effect of checking if ies control is supported.
    [The rationale is that: available of a control is always checked
     in mtk_hw_pin_field_lookup() and no need to add ies_present flag
     specially for ies control.]
2.3 Simply code logic for case of PIN_CONFIG_INPUT_SCHMITT.
2.4 Add case for PIN_CONFIG_INPUT_SCHMITT_ENABLE and process it with the
    same code for case of PIN_CONFIG_INPUT_SCHMITT.

Signed-off-by: Light Hsieh <light.hsieh@mediatek.com>
Link: https://lore.kernel.org/r/1579675994-7001-3-git-send-email-light.hsieh@mediatek.com
Acked-by: Sean Wang <sean.wang@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/mediatek/pinctrl-mt6765.c
drivers/pinctrl/mediatek/pinctrl-mt8183.c
drivers/pinctrl/mediatek/pinctrl-paris.c