Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pinctrl: sh-pfc: Do not unconditionally support PIN_CONFIG_BIAS_DISABLE

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>

authored by

Niklas Söderlund and committed by
Geert Uytterhoeven
5d7400c4 cccc618a

+2 -1
+2 -1
drivers/pinctrl/sh-pfc/pinctrl.c
··· 570 570 571 571 switch (param) { 572 572 case PIN_CONFIG_BIAS_DISABLE: 573 - return true; 573 + return pin->configs & 574 + (SH_PFC_PIN_CFG_PULL_UP | SH_PFC_PIN_CFG_PULL_DOWN); 574 575 575 576 case PIN_CONFIG_BIAS_PULL_UP: 576 577 return pin->configs & SH_PFC_PIN_CFG_PULL_UP;