r2118 - trunk/src/target/kernel/patches
laforge at sita.openmoko.org
laforge at sita.openmoko.org
Sat Jun 2 01:07:42 CEST 2007
Author: laforge
Date: 2007-06-02 01:07:41 +0200 (Sat, 02 Jun 2007)
New Revision: 2118
Modified:
trunk/src/target/kernel/patches/gta01-power_control.patch
Log:
fix bluetooth power-up routine (make sure device reset is used correctly)
Modified: trunk/src/target/kernel/patches/gta01-power_control.patch
===================================================================
--- trunk/src/target/kernel/patches/gta01-power_control.patch 2007-06-01 22:26:57 UTC (rev 2117)
+++ trunk/src/target/kernel/patches/gta01-power_control.patch 2007-06-01 23:07:41 UTC (rev 2118)
@@ -1,16 +1,16 @@
-Index: linux-2.6.21-moko/arch/arm/common/Makefile
+Index: linux-2.6.21.3-moko/arch/arm/common/Makefile
===================================================================
---- linux-2.6.21-moko.orig/arch/arm/common/Makefile
-+++ linux-2.6.21-moko/arch/arm/common/Makefile
+--- linux-2.6.21.3-moko.orig/arch/arm/common/Makefile
++++ linux-2.6.21.3-moko/arch/arm/common/Makefile
@@ -17,3 +17,4 @@
obj-$(CONFIG_SHARP_SCOOP) += scoop.o
obj-$(CONFIG_ARCH_IXP2000) += uengine.o
obj-$(CONFIG_ARCH_IXP23XX) += uengine.o
+obj-$(CONFIG_MACH_NEO1973_GTA01)+= gta01_pm_gsm.o gta01_pm_gps.o gta01_pm_bt.o
-Index: linux-2.6.21-moko/arch/arm/common/gta01_pm_gps.c
+Index: linux-2.6.21.3-moko/arch/arm/common/gta01_pm_gps.c
===================================================================
--- /dev/null
-+++ linux-2.6.21-moko/arch/arm/common/gta01_pm_gps.c
++++ linux-2.6.21.3-moko/arch/arm/common/gta01_pm_gps.c
@@ -0,0 +1,558 @@
+/*
+ * GPS Power Management code for the FIC Neo1973 GSM Phone
@@ -570,10 +570,10 @@
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Harald Welte <laforge at openmoko.org>");
+MODULE_DESCRIPTION("FIC GTA01 (Neo1973) GPS Power Management");
-Index: linux-2.6.21-moko/arch/arm/common/gta01_pm_gsm.c
+Index: linux-2.6.21.3-moko/arch/arm/common/gta01_pm_gsm.c
===================================================================
--- /dev/null
-+++ linux-2.6.21-moko/arch/arm/common/gta01_pm_gsm.c
++++ linux-2.6.21.3-moko/arch/arm/common/gta01_pm_gsm.c
@@ -0,0 +1,217 @@
+/*
+ * GSM Management code for the FIC Neo1973 GSM Phone
@@ -792,11 +792,11 @@
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Harald Welte <laforge at openmoko.org>");
+MODULE_DESCRIPTION("FIC GTA01 (Neo1973) GSM Management");
-Index: linux-2.6.21-moko/arch/arm/common/gta01_pm_bt.c
+Index: linux-2.6.21.3-moko/arch/arm/common/gta01_pm_bt.c
===================================================================
--- /dev/null
-+++ linux-2.6.21-moko/arch/arm/common/gta01_pm_bt.c
-@@ -0,0 +1,140 @@
++++ linux-2.6.21.3-moko/arch/arm/common/gta01_pm_bt.c
+@@ -0,0 +1,154 @@
+/*
+ * Bluetooth PM code for the FIC Neo1973 GSM Phone
+ *
@@ -832,7 +832,7 @@
+ PCF50606_REGULATOR_D1REG) == 3100)
+ goto out_1;
+ } else if (!strcmp(attr->attr.name, "reset")) {
-+ if (s3c2410_gpio_getpin(GTA01_GPIO_BT_EN))
++ if (s3c2410_gpio_getpin(GTA01_GPIO_BT_EN) == 0)
+ goto out_1;
+ }
+
@@ -847,14 +847,20 @@
+ unsigned long on = simple_strtoul(buf, NULL, 10);
+
+ if (!strcmp(attr->attr.name, "power_on")) {
-+ if (on)
++ /* if we are powering up, assert reset, then power, then
++ * release reset */
++ if (on) {
++ s3c2410_gpio_setpin(GTA01_GPIO_BT_EN, 0);
+ pcf50606_voltage_set(pcf50606_global,
+ PCF50606_REGULATOR_D1REG,
+ 3100);
++ }
+ pcf50606_onoff_set(pcf50606_global,
+ PCF50606_REGULATOR_D1REG, on);
++ s3c2410_gpio_setpin(GTA01_GPIO_BT_EN, on);
+ } else if (!strcmp(attr->attr.name, "reset")) {
-+ s3c2410_gpio_setpin(GTA01_GPIO_BT_EN, on);
++ /* reset is low-active, so we need to invert */
++ s3c2410_gpio_setpin(GTA01_GPIO_BT_EN, on ? 0 : 1 );
+ }
+
+ return count;
@@ -867,7 +873,9 @@
+static int gta01_bt_suspend(struct platform_device *pdev, pm_message_t state)
+{
+ dev_info(&pdev->dev, DRVMSG ": suspending\n");
-+ /* FIXME */
++ /* FIXME: The PMU should save the PMU status, and the GPIO code should
++ * preserve the GPIO level, so there shouldn't be anything left to do
++ * for us, should there? */
+
+ return 0;
+}
@@ -875,7 +883,6 @@
+static int gta01_bt_resume(struct platform_device *pdev)
+{
+ dev_info(&pdev->dev, DRVMSG ": resuming\n");
-+ /* FIXME */
+
+ return 0;
+}
@@ -899,6 +906,13 @@
+{
+ dev_info(&pdev->dev, DRVMSG ": starting\n");
+
++ /* we make sure that the voltage is off */
++ pcf50606_onoff_set(pcf50606_global,
++ PCF50606_REGULATOR_D1REG, 0);
++ /* we pull reset to low to make sure that the chip doesn't
++ * drain power through the reset line */
++ s3c2410_gpio_setpin(GTA01_GPIO_BT_EN, 0);
++
+ return sysfs_create_group(&pdev->dev.kobj, >a01_bt_attr_group);
+}
+
More information about the commitlog
mailing list