pinctrl: renesas: rcar: Do not enforce GPIO if already muxed
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Fri, 10 Dec 2021 11:32:26 +0000 (12:32 +0100)
committerGeert Uytterhoeven <geert+renesas@glider.be>
Mon, 24 Jan 2022 08:59:42 +0000 (09:59 +0100)
For Renesas PFCs not setting .strict, we can snoop GPIOs which are
already muxed to some other function.  To actually make use of that, we
shouldn't mux them back to GPIO if they have been already muxed to
something.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20211210113226.40111-1-wsa+renesas@sang-engineering.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
drivers/pinctrl/renesas/pinctrl.c

index 96b9de974246ac238af5232496e7998da4f7a9e7..401e6472503268ca7aadd8b4a05d13a98c7086e6 100644 (file)
@@ -397,7 +397,7 @@ static int sh_pfc_gpio_request_enable(struct pinctrl_dev *pctldev,
 
        spin_lock_irqsave(&pfc->lock, flags);
 
-       if (!pfc->gpio) {
+       if (!pfc->gpio && !cfg->mux_mark) {
                /* If GPIOs are handled externally the pin mux type needs to be
                 * set to GPIO here.
                 */