[PATCH] nhk8815: fix i2c-gpio initialization

Alessandro Rubini rubini-list at gnudd.com
Thu Dec 17 04:34:34 EST 2009


From: Alessandro Rubini <rubini at unipv.it>

Signed-off-by: Alessandro Rubini <rubini at unipv.it>
Acked-by: Andrea Gallo <andrea.gallo at stericsson.com>
---
 arch/arm/mach-nomadik/i2c-8815nhk.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-nomadik/i2c-8815nhk.c b/arch/arm/mach-nomadik/i2c-8815nhk.c
index abfe25a..7045ec1 100644
--- a/arch/arm/mach-nomadik/i2c-8815nhk.c
+++ b/arch/arm/mach-nomadik/i2c-8815nhk.c
@@ -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;
-- 
1.6.0.2



More information about the linux-arm-kernel mailing list