aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2010-03-02 06:23:41 -0500
committerJean Delvare <khali@linux-fr.org>2010-03-02 06:23:41 -0500
commit6d376fcc28d98f7f8f652755ae4dca1ff7240563 (patch)
treef238f98bbbf2fb3e2f270571404d3c9a91c5281a /drivers/i2c/busses
parentc05d490234b7cf1715d9568d2041d9bc598a0b45 (diff)
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>
Diffstat (limited to 'drivers/i2c/busses')
-rw-r--r--drivers/i2c/busses/i2c-parport-light.c6
-rw-r--r--drivers/i2c/busses/i2c-parport.c6
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 322c5691e38e..5383f64c5372 100644
--- a/drivers/i2c/busses/i2c-parport-light.c
+++ b/drivers/i2c/busses/i2c-parport-light.c
@@ -27,6 +27,7 @@
27#include <linux/kernel.h> 27#include <linux/kernel.h>
28#include <linux/module.h> 28#include <linux/module.h>
29#include <linux/init.h> 29#include <linux/init.h>
30#include <linux/delay.h>
30#include <linux/platform_device.h> 31#include <linux/platform_device.h>
31#include <linux/ioport.h> 32#include <linux/ioport.h>
32#include <linux/i2c.h> 33#include <linux/i2c.h>
@@ -127,8 +128,11 @@ static int __devinit i2c_parport_probe(struct platform_device *pdev)
127 parport_setsda(NULL, 1); 128 parport_setsda(NULL, 1);
128 parport_setscl(NULL, 1); 129 parport_setscl(NULL, 1);
129 /* Other init if needed (power on...) */ 130 /* Other init if needed (power on...) */
130 if (adapter_parm[type].init.val) 131 if (adapter_parm[type].init.val) {
131 line_set(1, &adapter_parm[type].init); 132 line_set(1, &adapter_parm[type].init);
133 /* Give powered devices some time to settle */
134 msleep(100);
135 }
132 136
133 parport_adapter.dev.parent = &pdev->dev; 137 parport_adapter.dev.parent = &pdev->dev;
134 err = i2c_bit_add_bus(&parport_adapter); 138 err = i2c_bit_add_bus(&parport_adapter);
diff --git a/drivers/i2c/busses/i2c-parport.c b/drivers/i2c/busses/i2c-parport.c
index 0d8998610c74..056af1820993 100644
--- a/drivers/i2c/busses/i2c-parport.c
+++ b/drivers/i2c/busses/i2c-parport.c
@@ -27,6 +27,7 @@
27#include <linux/kernel.h> 27#include <linux/kernel.h>
28#include <linux/module.h> 28#include <linux/module.h>
29#include <linux/init.h> 29#include <linux/init.h>
30#include <linux/delay.h>
30#include <linux/parport.h> 31#include <linux/parport.h>
31#include <linux/i2c.h> 32#include <linux/i2c.h>
32#include <linux/i2c-algo-bit.h> 33#include <linux/i2c-algo-bit.h>
@@ -185,8 +186,11 @@ static void i2c_parport_attach (struct parport *port)
185 parport_setsda(port, 1); 186 parport_setsda(port, 1);
186 parport_setscl(port, 1); 187 parport_setscl(port, 1);
187 /* Other init if needed (power on...) */ 188 /* Other init if needed (power on...) */
188 if (adapter_parm[type].init.val) 189 if (adapter_parm[type].init.val) {
189 line_set(port, 1, &adapter_parm[type].init); 190 line_set(port, 1, &adapter_parm[type].init);
191 /* Give powered devices some time to settle */
192 msleep(100);
193 }
190 194
191 if (i2c_bit_add_bus(&adapter->adapter) < 0) { 195 if (i2c_bit_add_bus(&adapter->adapter) < 0) {
192 printk(KERN_ERR "i2c-parport: Unable to register with I2C\n"); 196 printk(KERN_ERR "i2c-parport: Unable to register with I2C\n");