linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] pinctrl: sh-pfc: only use dummy states for non-DT platforms
@ 2016-03-07 18:40 Wolfram Sang
  2016-03-07 19:56 ` Geert Uytterhoeven
  2016-03-15  8:29 ` Linus Walleij
  0 siblings, 2 replies; 19+ messages in thread
From: Wolfram Sang @ 2016-03-07 18:40 UTC (permalink / raw)
  To: linux-renesas-soc
  Cc: Wolfram Sang, Geert Uytterhoeven, Laurent Pinchart,
	Kuninori Morimoto, Magnus Damm, Geert Uytterhoeven, linux-gpio

From: Wolfram Sang <wsa+renesas@sang-engineering.com>

If pinctrl_provide_dummies() is used unconditionally, then the dummy
state will be used even on DT platforms when the "init" state was
intentionally left out. Instead of "default", the dummy "init" state
will then be used during probe. Thus, when probing an I2C controller on
cold boot, communication triggered by bus notifiers broke because the
pins were not initialized.

Do it like OMAP2: use the dummy state only for non-DT platforms.

Reported-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---

Geert recently pointed out the problem, that the IRQ2 fixup for the
DA9xxx PMICs failed on Lager on cold boot. I could verify this iff IIC3
was used and not I2C3. IIC3 is the default, however I mostly used I2C3
recently, because it has the slave capabilities.

The original pinctrl_provide_dummies() is there since the beginning of the
file, so in order to avoid regressions, the below solution looks plausible to
me. I do not have much experience with hardware older than Gen2, though, so
comments are much appreciated!


 drivers/pinctrl/sh-pfc/core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/pinctrl/sh-pfc/core.c b/drivers/pinctrl/sh-pfc/core.c
index 0c2d14c504aa1d..db53d7bbc16e18 100644
--- a/drivers/pinctrl/sh-pfc/core.c
+++ b/drivers/pinctrl/sh-pfc/core.c
@@ -545,7 +545,9 @@ static int sh_pfc_probe(struct platform_device *pdev)
 			return ret;
 	}
 
-	pinctrl_provide_dummies();
+	/* Enable dummy states for those platforms without pinctrl support */
+	if (!of_have_populated_dt())
+		pinctrl_provide_dummies();
 
 	ret = sh_pfc_init_ranges(pfc);
 	if (ret < 0)
-- 
2.7.0

^ permalink raw reply related	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2016-03-29  5:48 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-07 18:40 [RFC] pinctrl: sh-pfc: only use dummy states for non-DT platforms Wolfram Sang
2016-03-07 19:56 ` Geert Uytterhoeven
2016-03-07 20:02   ` Sergei Shtylyov
2016-03-07 20:29     ` Geert Uytterhoeven
2016-03-07 20:34       ` Sergei Shtylyov
2016-03-07 21:00         ` Geert Uytterhoeven
2016-03-07 21:19           ` Sergei Shtylyov
2016-03-08  8:15             ` Geert Uytterhoeven
2016-03-07 22:21           ` Wolfram Sang
2016-03-09 10:30             ` Linus Walleij
2016-03-09  9:58           ` Wolfram Sang
2016-03-09 10:32             ` Linus Walleij
2016-03-09 12:51               ` Sergei Shtylyov
2016-03-09 15:37                 ` Wolfram Sang
2016-03-09 13:17               ` Geert Uytterhoeven
2016-03-29  5:48           ` Shawn Guo
2016-03-15  8:29 ` Linus Walleij
2016-03-15  9:08   ` Geert Uytterhoeven
2016-03-15 12:31   ` Sergei Shtylyov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).