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@xxxxxxxxxxxxxxxxxxxx> --- Not sure if this is a proper solution, but at least this is a proof-of-concept. It makes the sloppy GPIO analyzer work by assigning it GPIOs which are already muxed to, say, I2C or PWM. I didn't see any side-effects, but there may be some I missed. Tested on a Salvator-XS with R-Car M3-N where the only occasions of MUX+GPIO at the same time were the logic analyzer. AFAIU if '.strict' is set, the request will be rejected at higher levels, so on those systems should be no harm. drivers/pinctrl/renesas/pinctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pinctrl/renesas/pinctrl.c b/drivers/pinctrl/renesas/pinctrl.c index f3eecb20c086..8d4541ac43a9 100644 --- a/drivers/pinctrl/renesas/pinctrl.c +++ b/drivers/pinctrl/renesas/pinctrl.c @@ -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. */ -- 2.30.2