Skip to contentSkip to conversation

nhk8815: fix i2c-gpio initialization

PATCH New Alessandro Rubini 1 participant 1 message Dec 17, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nhk8815: fix i2c-gpio initialization

From: Alessandro Rubini <[email protected]>

---
 arch/arm/mach-nomadik/i2c-8815nhk.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
arch/arm/mach-nomadik/i2c-8815nhk.c +5 -0
index abfe25a..7045ec1 100644
@@ -43,12 +43,17 @@ static struct platform_device nhk8815_i2c_dev1 = {
 
 static int __init nhk8815_i2c_init(void)
 {
+	/* i2c-gpio switches from out to in and back, so force out data to 0 */
 	nmk_gpio_set_mode(nhk8815_i2c_data0.scl_pin, NMK_GPIO_ALT_GPIO);
 	nmk_gpio_set_mode(nhk8815_i2c_data0.sda_pin, NMK_GPIO_ALT_GPIO);
+	gpio_set_value(nhk8815_i2c_data0.sda_pin, 0);
+	gpio_set_value(nhk8815_i2c_data0.scl_pin, 0);
 	platform_device_register(&nhk8815_i2c_dev0);
 
 	nmk_gpio_set_mode(nhk8815_i2c_data1.scl_pin, NMK_GPIO_ALT_GPIO);
 	nmk_gpio_set_mode(nhk8815_i2c_data1.sda_pin, NMK_GPIO_ALT_GPIO);
+	gpio_set_value(nhk8815_i2c_data1.sda_pin, 0);
+	gpio_set_value(nhk8815_i2c_data1.scl_pin, 0);
 	platform_device_register(&nhk8815_i2c_dev1);
 
 	return 0;
Signature · 1 line
1.6.0.2