Changeset 2118


Ignore:
Timestamp:
06/02/07 01:07:41 (6 years ago)
Author:
laforge
Message:

fix bluetooth power-up routine (make sure device reset is used correctly)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/target/kernel/patches/gta01-power_control.patch

    r2072 r2118  
    1 Index: linux-2.6.21-moko/arch/arm/common/Makefile 
     1Index: linux-2.6.21.3-moko/arch/arm/common/Makefile 
    22=================================================================== 
    3 --- linux-2.6.21-moko.orig/arch/arm/common/Makefile 
    4 +++ linux-2.6.21-moko/arch/arm/common/Makefile 
     3--- linux-2.6.21.3-moko.orig/arch/arm/common/Makefile 
     4+++ linux-2.6.21.3-moko/arch/arm/common/Makefile 
    55@@ -17,3 +17,4 @@ 
    66 obj-$(CONFIG_SHARP_SCOOP)      += scoop.o 
     
    88 obj-$(CONFIG_ARCH_IXP23XX)     += uengine.o 
    99+obj-$(CONFIG_MACH_NEO1973_GTA01)+= gta01_pm_gsm.o gta01_pm_gps.o gta01_pm_bt.o 
    10 Index: linux-2.6.21-moko/arch/arm/common/gta01_pm_gps.c 
     10Index: linux-2.6.21.3-moko/arch/arm/common/gta01_pm_gps.c 
    1111=================================================================== 
    1212--- /dev/null 
    13 +++ linux-2.6.21-moko/arch/arm/common/gta01_pm_gps.c 
     13+++ linux-2.6.21.3-moko/arch/arm/common/gta01_pm_gps.c 
    1414@@ -0,0 +1,558 @@ 
    1515+/* 
     
    571571+MODULE_AUTHOR("Harald Welte <laforge@openmoko.org>"); 
    572572+MODULE_DESCRIPTION("FIC GTA01 (Neo1973) GPS Power Management"); 
    573 Index: linux-2.6.21-moko/arch/arm/common/gta01_pm_gsm.c 
     573Index: linux-2.6.21.3-moko/arch/arm/common/gta01_pm_gsm.c 
    574574=================================================================== 
    575575--- /dev/null 
    576 +++ linux-2.6.21-moko/arch/arm/common/gta01_pm_gsm.c 
     576+++ linux-2.6.21.3-moko/arch/arm/common/gta01_pm_gsm.c 
    577577@@ -0,0 +1,217 @@ 
    578578+/* 
     
    793793+MODULE_AUTHOR("Harald Welte <laforge@openmoko.org>"); 
    794794+MODULE_DESCRIPTION("FIC GTA01 (Neo1973) GSM Management"); 
    795 Index: linux-2.6.21-moko/arch/arm/common/gta01_pm_bt.c 
     795Index: linux-2.6.21.3-moko/arch/arm/common/gta01_pm_bt.c 
    796796=================================================================== 
    797797--- /dev/null 
    798 +++ linux-2.6.21-moko/arch/arm/common/gta01_pm_bt.c 
    799 @@ -0,0 +1,140 @@ 
     798+++ linux-2.6.21.3-moko/arch/arm/common/gta01_pm_bt.c 
     799@@ -0,0 +1,154 @@ 
    800800+/* 
    801801+ * Bluetooth PM code for the FIC Neo1973 GSM Phone 
     
    833833+                       goto out_1; 
    834834+       } else if (!strcmp(attr->attr.name, "reset")) { 
    835 +               if (s3c2410_gpio_getpin(GTA01_GPIO_BT_EN)) 
     835+               if (s3c2410_gpio_getpin(GTA01_GPIO_BT_EN) == 0) 
    836836+                       goto out_1; 
    837837+       } 
     
    848848+ 
    849849+       if (!strcmp(attr->attr.name, "power_on")) { 
    850 +               if (on) 
     850+               /* if we are powering up, assert reset, then power, then 
     851+                * release reset */ 
     852+               if (on) { 
     853+                       s3c2410_gpio_setpin(GTA01_GPIO_BT_EN, 0); 
    851854+                       pcf50606_voltage_set(pcf50606_global, 
    852855+                                            PCF50606_REGULATOR_D1REG, 
    853856+                                            3100); 
     857+               } 
    854858+               pcf50606_onoff_set(pcf50606_global, 
    855859+                                  PCF50606_REGULATOR_D1REG, on); 
     860+               s3c2410_gpio_setpin(GTA01_GPIO_BT_EN, on); 
    856861+       } else if (!strcmp(attr->attr.name, "reset")) { 
    857 +               s3c2410_gpio_setpin(GTA01_GPIO_BT_EN, on); 
     862+               /* reset is low-active, so we need to invert */ 
     863+               s3c2410_gpio_setpin(GTA01_GPIO_BT_EN, on ? 0 : 1 ); 
    858864+       } 
    859865+ 
     
    868874+{ 
    869875+       dev_info(&pdev->dev, DRVMSG ": suspending\n"); 
    870 +       /* FIXME */ 
     876+       /* FIXME: The PMU should save the PMU status, and the GPIO code should 
     877+        * preserve the GPIO level, so there shouldn't be anything left to do 
     878+        * for us, should there? */ 
    871879+ 
    872880+       return 0; 
     
    876884+{ 
    877885+       dev_info(&pdev->dev, DRVMSG ": resuming\n"); 
    878 +       /* FIXME */ 
    879886+ 
    880887+       return 0; 
     
    899906+{ 
    900907+       dev_info(&pdev->dev, DRVMSG ": starting\n"); 
     908+ 
     909+       /* we make sure that the voltage is off */ 
     910+       pcf50606_onoff_set(pcf50606_global, 
     911+                          PCF50606_REGULATOR_D1REG, 0); 
     912+       /* we pull reset to low to make sure that the chip doesn't 
     913+        * drain power through the reset line */ 
     914+       s3c2410_gpio_setpin(GTA01_GPIO_BT_EN, 0); 
    901915+ 
    902916+       return sysfs_create_group(&pdev->dev.kobj, &gta01_bt_attr_group); 
Note: See TracChangeset for help on using the changeset viewer.