i2c-parport: Give powered devices some time to settle

Previous thread: percpu: add __percpu sparse annotations to what's left by Linux Kernel Mailing List on Wednesday, March 3, 2010 - 12:00 pm. (1 message)

Next thread: i2c: Separate Kconfig option for i2c-smbus by Linux Kernel Mailing List on Wednesday, March 3, 2010 - 12:00 pm. (1 message)
From: Linux Kernel Mailing List
Date: Wednesday, March 3, 2010 - 12:00 pm

Gitweb:     http://git.kernel.org/linus/6d376fcc28d98f7f8f652755ae4dca1ff7240563
Commit:     6d376fcc28d98f7f8f652755ae4dca1ff7240563
Parent:     c05d490234b7cf1715d9568d2041d9bc598a0b45
Author:     Jean Delvare <khali@linux-fr.org>
AuthorDate: Tue Mar 2 12:23:41 2010 +0100
Committer:  Jean Delvare <khali@linux-fr.org>
CommitDate: Tue Mar 2 12:23:41 2010 +0100

    i2c-parport: Give powered devices some time to settle
    
    When the i2c-parport adapter is reponsible for powering devices, it
    would seem reasonable to give them some time to settle before trying
    to access them.
    
    Signed-off-by: Jean Delvare <khali@linux-fr.org>
---
 drivers/i2c/busses/i2c-parport-light.c |    6 +++++-
 drivers/i2c/busses/i2c-parport.c       |    6 +++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-parport-light.c b/drivers/i2c/busses/i2c-parport-light.c
index 322c569..5383f64 100644
--- a/drivers/i2c/busses/i2c-parport-light.c
+++ b/drivers/i2c/busses/i2c-parport-light.c
@@ -27,6 +27,7 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
+#include <linux/delay.h>
 #include <linux/platform_device.h>
 #include <linux/ioport.h>
 #include <linux/i2c.h>
@@ -127,8 +128,11 @@ static int __devinit i2c_parport_probe(struct platform_device *pdev)
 	parport_setsda(NULL, 1);
 	parport_setscl(NULL, 1);
 	/* Other init if needed (power on...) */
-	if (adapter_parm[type].init.val)
+	if (adapter_parm[type].init.val) {
 		line_set(1, &adapter_parm[type].init);
+		/* Give powered devices some time to settle */
+		msleep(100);
+	}
 
 	parport_adapter.dev.parent = &pdev->dev;
 	err = i2c_bit_add_bus(&parport_adapter);
diff --git a/drivers/i2c/busses/i2c-parport.c b/drivers/i2c/busses/i2c-parport.c
index 0d89986..056af18 100644
--- a/drivers/i2c/busses/i2c-parport.c
+++ b/drivers/i2c/busses/i2c-parport.c
@@ -27,6 +27,7 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
+#include ...
Previous thread: percpu: add __percpu sparse annotations to what's left by Linux Kernel Mailing List on Wednesday, March 3, 2010 - 12:00 pm. (1 message)

Next thread: i2c: Separate Kconfig option for i2c-smbus by Linux Kernel Mailing List on Wednesday, March 3, 2010 - 12:00 pm. (1 message)