From 892ebc1a3813a375a473d781816ee3545344368d Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E5=BC=A0=E6=99=B4?= Date: Wed, 9 May 2012 17:29:56 +0800 Subject: [PATCH] rk30:phone loquat:support Tps80032 usb otg --- arch/arm/mach-rk30/board-rk30-phone-twl60xx.c | 17 ++++++++++++++--- drivers/usb/otg/twl6030-usb.c | 11 +++++++++-- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-rk30/board-rk30-phone-twl60xx.c b/arch/arm/mach-rk30/board-rk30-phone-twl60xx.c index c5583711a2e0..21434217bd57 100755 --- a/arch/arm/mach-rk30/board-rk30-phone-twl60xx.c +++ b/arch/arm/mach-rk30/board-rk30-phone-twl60xx.c @@ -593,8 +593,19 @@ static struct twl4030_bci_platform_data tps80032_bci_data = { .battery_tmp_tbl = tps_batt_table, .tblsize = ARRAY_SIZE(tps_batt_table), }; -static struct twl4030_usb_data tps80032_usb_data = { - .usb_mode = T2_USB_MODE_ULPI, + +int rk30_phy_init(){} +int rk30_phy_exit(){} +int rk30_phy_power(){} +int rk30_phy_set_clk(){} +int rk30_phy_suspend(){} +static struct twl4030_usb_data tps80032_usbphy_data = { + .phy_init = rk30_phy_init, + .phy_exit = rk30_phy_exit, + .phy_power = rk30_phy_power, + .phy_set_clock = rk30_phy_set_clk, + .phy_suspend = rk30_phy_suspend, + }; static struct twl4030_ins sleep_on_seq[] __initdata = { /* @@ -777,7 +788,7 @@ static struct twl4030_platform_data tps80032_data = { .madc = &tps80032_madc_data, .bci = &tps80032_bci_data, - .usb = &tps80032_usb_data, + .usb = &tps80032_usbphy_data, // .power = &tps80032_scripts_data, /* Regulators */ .ldo1 = &tps80032_ldo1, diff --git a/drivers/usb/otg/twl6030-usb.c b/drivers/usb/otg/twl6030-usb.c index 61a4954e32d9..437734e2b99e 100755 --- a/drivers/usb/otg/twl6030-usb.c +++ b/drivers/usb/otg/twl6030-usb.c @@ -34,7 +34,7 @@ #include #include -#include +//#include /* usb register definitions */ #define USB_VENDOR_ID_LSB 0x00 @@ -92,6 +92,9 @@ #define CONTROLLER_STAT1 0x03 #define VBUS_DET BIT(2) +extern int get_msc_connect_flag(void); + + struct twl6030_usb { struct otg_transceiver otg; struct device *dev; @@ -310,7 +313,11 @@ static irqreturn_t twl6030_usb_irq(int irq, void *_twl) regulator_enable(twl->usb3v3); twl6030_phy_suspend(&twl->otg, 0); - charger_type = omap4_charger_detect(); + if(0 == get_msc_connect_flag()) + charger_type = POWER_SUPPLY_TYPE_USB_DCP; + else + charger_type = POWER_SUPPLY_TYPE_USB; + twl6030_phy_suspend(&twl->otg, 1); if ((charger_type == POWER_SUPPLY_TYPE_USB_CDP) || (charger_type == POWER_SUPPLY_TYPE_USB)) { -- 2.34.1