]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
pinctrl: sh-pfc: Do not unconditionally support PIN_CONFIG_BIAS_DISABLE
authorNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Sat, 12 Nov 2016 16:04:24 +0000 (17:04 +0100)
committerGeert Uytterhoeven <geert+renesas@glider.be>
Tue, 15 Nov 2016 10:01:09 +0000 (11:01 +0100)
Always stating PIN_CONFIG_BIAS_DISABLE is supported gives untrue output
when examining /sys/kernel/debug/pinctrl/e6060000.pfc/pinconf-pins if
the operation get_bias() is implemented but the pin is not handled by
the get_bias() implementation. In that case the output will state that
"input bias disabled" indicating that this pin has bias control
support.

Make support for PIN_CONFIG_BIAS_DISABLE depend on that the pin either
supports SH_PFC_PIN_CFG_PULL_UP or SH_PFC_PIN_CFG_PULL_DOWN. This also
solves the issue where SoC specific implementations print error messages
if their particular implementation of {set,get}_bias() is called with a
pin it does not know about.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
drivers/pinctrl/sh-pfc/pinctrl.c

index c5772584594ce3c48686f5df0315586dc2e9f8b2..fcacfa73ef6e9b657fb043186fcd6c9cd0d2dfeb 100644 (file)
@@ -570,7 +570,8 @@ static bool sh_pfc_pinconf_validate(struct sh_pfc *pfc, unsigned int _pin,
 
        switch (param) {
        case PIN_CONFIG_BIAS_DISABLE:
-               return true;
+               return pin->configs &
+                       (SH_PFC_PIN_CFG_PULL_UP | SH_PFC_PIN_CFG_PULL_DOWN);
 
        case PIN_CONFIG_BIAS_PULL_UP:
                return pin->configs & SH_PFC_PIN_CFG_PULL_UP;