rk30:phone loquat:support Tps80032 usb otg
author张晴 <zhangqing@rock-chips.com>
Wed, 9 May 2012 09:29:56 +0000 (17:29 +0800)
committer张晴 <zhangqing@rock-chips.com>
Wed, 9 May 2012 09:29:56 +0000 (17:29 +0800)
arch/arm/mach-rk30/board-rk30-phone-twl60xx.c
drivers/usb/otg/twl6030-usb.c

index c5583711a2e01b597526156207ecc81ef4254e8f..21434217bd5780774accc23b873cd07e757b10df 100755 (executable)
@@ -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,
index 61a4954e32d9eebe77154a0bb36d475eb44a14be..437734e2b99e8ecb5c9c92bb86038b281c2b414e 100755 (executable)
@@ -34,7 +34,7 @@
 #include <linux/slab.h>
 #include <linux/delay.h>
 
-#include <plat/usb.h>
+//#include <plat/usb.h>
 
 /* 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)) {