From 30d2cc7772948237113241593bf0524aa94d2fc0 Mon Sep 17 00:00:00 2001 From: "H. Nikolaus Schaller" Date: Thu, 10 Jan 2013 10:04:05 +0100 Subject: moved ITG3200 reset code to tsc init command --- u-boot/board/goldelico/gta04/gta04.c | 16 ---------------- u-boot/board/goldelico/gta04/systest.h | 1 + u-boot/board/goldelico/gta04/tsc2007.c | 29 +++++++++++++++++++++++++++++ 3 files changed, 30 insertions(+), 16 deletions(-) diff --git a/u-boot/board/goldelico/gta04/gta04.c b/u-boot/board/goldelico/gta04/gta04.c index 95865dd..6baa333 100644 --- a/u-boot/board/goldelico/gta04/gta04.c +++ b/u-boot/board/goldelico/gta04/gta04.c @@ -142,22 +142,6 @@ int misc_init_r(void) i2c_reg_write(TCA6507_ADDRESS, TCA6507_SELECT1, 0); i2c_reg_write(TCA6507_ADDRESS, TCA6507_SELECT2, 0x40); // pull down reset for WLAN&BT chip -#if 1 - // FIXME: if(gta04_board_revision() should have ITG) - /* if the GTA04 is connected to USB power first and - * the battery is inserted after this, all power rails - * have oscillated until the battery is available - * this makes the ITG3200 Power On Reset fail - */ - i2c_set_bus_num(TCA6507_BUS); // I2C2 - udelay(10*1000); // wait a little until power stabilizes - if(i2c_probe(0x68)) { // ITG3200 does not respond - printf("ITG3200 does not respond\n"); - // Pulse VAUX2 to force POR - // how can we do that??? - } -#endif - i2c_set_bus_num(0); // write I2C1 #if 0 // FIXME: enable only on demand if we want to test BT/WIFI - and apply RESET diff --git a/u-boot/board/goldelico/gta04/systest.h b/u-boot/board/goldelico/gta04/systest.h index 4126b3b..07e928a 100644 --- a/u-boot/board/goldelico/gta04/systest.h +++ b/u-boot/board/goldelico/gta04/systest.h @@ -32,5 +32,6 @@ int irdatest(void); int wlanbttest(int serial); int OTGchargepump(int enable); int gpiotest(void); +int keytest(void); #endif diff --git a/u-boot/board/goldelico/gta04/tsc2007.c b/u-boot/board/goldelico/gta04/tsc2007.c index 0df22ce..11565df 100644 --- a/u-boot/board/goldelico/gta04/tsc2007.c +++ b/u-boot/board/goldelico/gta04/tsc2007.c @@ -29,6 +29,7 @@ #include #include #include +#include #include "tsc2007.h" #define TSC2007_BUS (2-1) // I2C2 @@ -92,6 +93,34 @@ int tsc2007_init(void) return 1; } +#if 1 + // FIXME: if(gta04_board_revision() should have ITG) + /* if the GTA04 is connected to USB power first and + * the battery is inserted after this, all power rails + * have oscillated until the battery is available + * this makes the ITG3200 Power On Reset fail + */ + if(i2c_probe(0x68)) + { // ITG3200 does not respond + printf("ITG3200 does not respond\n"); + // FIXME: temporarily switch off VAUX2 + twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED, + /*TWL4030_PM_RECEIVER_VAUX2_VSEL_28*/ 0x09, + TWL4030_PM_RECEIVER_VAUX2_DEV_GRP, + TWL4030_PM_RECEIVER_DEV_GRP_P1); + udelay(30*1000); // wait a little until power drops + twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED, + /*TWL4030_PM_RECEIVER_VAUX2_VSEL_28*/ 0x09, + TWL4030_PM_RECEIVER_VAUX2_DEV_GRP, + TWL4030_PM_RECEIVER_DEV_GRP_P1); + udelay(10*1000); // wait a little until power stabilizes and ITG did reset + if(i2c_probe(0x68)) // ITG3200 does not respond + printf("ITG3200 still does not respond\n"); + else + printf("ITG3200 now ok\n"); + } +#endif + if(i2c_probe(TSC2007_ADDRESS)) { printf ("could not probe TSC2007\n"); -- cgit v1.1