linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] i2c: exynos5: Initialise Samsung High Speed I2C controller early
@ 2014-04-24 14:48 Naveen Krishna Chatradhi
  2014-04-24 16:25 ` Mark Brown
  0 siblings, 1 reply; 10+ messages in thread
From: Naveen Krishna Chatradhi @ 2014-04-24 14:48 UTC (permalink / raw)
  To: linux-i2c
  Cc: naveenkrishna.ch, linux-arm-kernel, linux-samsung-soc, sjg,
	grundler, linux-kernel, wsa, cpgs, broonie

This patch moves initialization code to subsys_initcall() to ensure
that the i2c bus is available early so the regulators can be quickly
probed and available for other devices on their probe() call.

Such solution has been proposed by Mark Brown to fix the problem of
the regulators not beeing available on the peripheral device probe():
http://lists.infradead.org/pipermail/linux-arm-kernel/2010-March/011971.html

Signed-off-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
---
 drivers/i2c/busses/i2c-exynos5.c |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-exynos5.c b/drivers/i2c/busses/i2c-exynos5.c
index 00af0a0..20e3077 100644
--- a/drivers/i2c/busses/i2c-exynos5.c
+++ b/drivers/i2c/busses/i2c-exynos5.c
@@ -762,8 +762,18 @@ static struct platform_driver exynos5_i2c_driver = {
 	},
 };
 
-module_platform_driver(exynos5_i2c_driver);
+static int __init i2c_adap_exynos5_init(void)
+{
+	return platform_driver_register(&exynos5_i2c_driver);
+}
+subsys_initcall(i2c_adap_exynos5_init);
+
+static void __exit i2c_adap_exynos5_exit(void)
+{
+	platform_driver_unregister(&exynos5_i2c_driver);
+}
 
+module_exit(i2c_adap_exynos5_exit);
 MODULE_DESCRIPTION("Exynos5 HS-I2C Bus driver");
 MODULE_AUTHOR("Naveen Krishna Chatradhi, <ch.naveen@samsung.com>");
 MODULE_AUTHOR("Taekgyun Ko, <taeggyun.ko@samsung.com>");
-- 
1.7.9.5


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

end of thread, other threads:[~2014-05-21 13:00 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-24 14:48 [PATCH] i2c: exynos5: Initialise Samsung High Speed I2C controller early Naveen Krishna Chatradhi
2014-04-24 16:25 ` Mark Brown
2014-04-25  4:58   ` Tushar Behera
2014-05-09 12:20   ` Naveen Krishna Ch
2014-05-09 13:51     ` Mark Brown
2014-05-09 14:42       ` Naveen Krishna Ch
2014-05-09 14:54         ` Mark Brown
2014-05-21 10:25           ` Wolfram Sang
2014-05-21 12:04             ` Naveen Krishna Ch
2014-05-21 13:00               ` Wolfram Sang

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).