pinctrl: mediatek: paris: Fix PIN_CONFIG_BIAS_* readback
authorChen-Yu Tsai <wenst@chromium.org>
Tue, 8 Mar 2022 10:09:47 +0000 (18:09 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 12:23:49 +0000 (14:23 +0200)
commita8d236a32934cb60377e933954289f1a70340c9a
treee13131e600d18c32c21f2e3798ca94517003af48
parent3ddbb9ba7579d21ee646a41aea5dd9d2228c22e1
pinctrl: mediatek: paris: Fix PIN_CONFIG_BIAS_* readback

[ Upstream commit 3e8c6bc608480010f360c4a59578d7841726137d ]

When reading back pin bias settings, if the pin is not in the
corresponding bias state, the function should return -EINVAL.

Fix this in the mediatek-paris pinctrl library so that the read back
state is not littered with bogus a "input bias disabled" combined with
"pull up" or "pull down" states.

Fixes: 805250982bb5 ("pinctrl: mediatek: add pinctrl-paris that implements the vendor dt-bindings")
Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20220308100956.2750295-3-wenst@chromium.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pinctrl/mediatek/pinctrl-paris.c