Send commitlog mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.openmoko.org/mailman/listinfo/commitlog
or, via email, send a message with subject or body 'help' to
[EMAIL PROTECTED]
You can reach the person managing the list at
[EMAIL PROTECTED]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of commitlog digest..."
Today's Topics:
1. r4088 - branches/src/target/kernel/2.6.24.x/patches
([EMAIL PROTECTED])
2. r4089 - branches/src/target/kernel/2.6.24.x/patches
([EMAIL PROTECTED])
3. r4090 - branches/src/target/kernel/2.6.24.x/patches
([EMAIL PROTECTED])
4. r4091 - in trunk/src/target/gsm: include/gsmd include/libgsmd
src/gsmd src/libgsmd src/util ([EMAIL PROTECTED])
--- Begin Message ---
Author: werner
Date: 2008-02-21 04:30:29 +0100 (Thu, 21 Feb 2008)
New Revision: 4088
Added:
branches/src/target/kernel/2.6.24.x/patches/gta02-power_control.patch
Modified:
branches/src/target/kernel/2.6.24.x/patches/gta02-core.patch
branches/src/target/kernel/2.6.24.x/patches/series
Log:
Moved changes to arch/arm/plat-s3c24xx/neo1973_pm_bt.c and
arch/arm/plat-s3c24xx/neo1973_pm_gsm.c from the core of ugliness
(gta02-core.patch) to a new patch gta02-power_control.patch,
mirroring gta01-power_control.patch
Modified: branches/src/target/kernel/2.6.24.x/patches/gta02-core.patch
===================================================================
--- branches/src/target/kernel/2.6.24.x/patches/gta02-core.patch
2008-02-20 06:43:49 UTC (rev 4087)
+++ branches/src/target/kernel/2.6.24.x/patches/gta02-core.patch
2008-02-21 03:30:29 UTC (rev 4088)
@@ -962,284 +962,6 @@
obj-$(CONFIG_MACH_NEXCODER_2440) += mach-nexcoder.o
obj-$(CONFIG_MACH_HXD8) += mach-hxd8.o
+obj-$(CONFIG_MACH_NEO1973_GTA02) += mach-gta02.o
-Index: linux-2.6.24/arch/arm/plat-s3c24xx/neo1973_pm_bt.c
-===================================================================
---- linux-2.6.24.orig/arch/arm/plat-s3c24xx/neo1973_pm_bt.c
-+++ linux-2.6.24/arch/arm/plat-s3c24xx/neo1973_pm_bt.c
-@@ -19,7 +19,9 @@
- #include <linux/pcf50606.h>
-
- #include <asm/hardware.h>
-+#include <asm/mach-types.h>
- #include <asm/arch/gta01.h>
-+#include <asm/arch/gta02.h>
-
- #define DRVMSG "FIC Neo1973 Bluetooth Power Management"
-
-@@ -27,14 +29,30 @@
- char *buf)
- {
- if (!strcmp(attr->attr.name, "power_on")) {
-- if (pcf50606_onoff_get(pcf50606_global,
-- PCF50606_REGULATOR_D1REG) &&
-- pcf50606_voltage_get(pcf50606_global,
-- PCF50606_REGULATOR_D1REG) == 3100)
-- goto out_1;
-+ switch (machine_arch_type) {
-+ case MACH_TYPE_NEO1973_GTA01:
-+ if (pcf50606_onoff_get(pcf50606_global,
-+ PCF50606_REGULATOR_D1REG) &&
-+ pcf50606_voltage_get(pcf50606_global,
-+ PCF50606_REGULATOR_D1REG) ==
3100)
-+ goto out_1;
-+ break;
-+ case MACH_TYPE_NEO1973_GTA02:
-+ if (s3c2410_gpio_getpin(GTA02_GPIO_BT_EN))
-+ goto out_1;
-+ break;
-+ }
- } else if (!strcmp(attr->attr.name, "reset")) {
-- if (s3c2410_gpio_getpin(GTA01_GPIO_BT_EN) == 0)
-- goto out_1;
-+ switch (machine_arch_type) {
-+ case MACH_TYPE_NEO1973_GTA01:
-+ if (s3c2410_gpio_getpin(GTA01_GPIO_BT_EN) == 0)
-+ goto out_1;
-+ break;
-+ case MACH_TYPE_NEO1973_GTA02:
-+ if (s3c2410_gpio_getpin(GTA02_GPIO_BT_EN) == 0)
-+ goto out_1;
-+ break;
-+ }
- }
-
- return strlcpy(buf, "0\n", 3);
-@@ -48,20 +66,37 @@
- unsigned long on = simple_strtoul(buf, NULL, 10);
-
- if (!strcmp(attr->attr.name, "power_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);
-+ switch (machine_arch_type) {
-+ case MACH_TYPE_NEO1973_GTA01:
-+ /* 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);
-+ break;
-+ case MACH_TYPE_NEO1973_GTA02:
-+ if (on)
-+ s3c2410_gpio_setpin(GTA02_GPIO_BT_EN, 0);
-+ else
-+ s3c2410_gpio_setpin(GTA02_GPIO_BT_EN, 1);
-+ break;
- }
-- pcf50606_onoff_set(pcf50606_global,
-- PCF50606_REGULATOR_D1REG, on);
-- s3c2410_gpio_setpin(GTA01_GPIO_BT_EN, on);
- } else if (!strcmp(attr->attr.name, "reset")) {
- /* reset is low-active, so we need to invert */
-- s3c2410_gpio_setpin(GTA01_GPIO_BT_EN, on ? 0 : 1);
-+ switch (machine_arch_type) {
-+ case MACH_TYPE_NEO1973_GTA01:
-+ s3c2410_gpio_setpin(GTA01_GPIO_BT_EN, on ? 0 : 1);
-+ break;
-+ case MACH_TYPE_NEO1973_GTA02:
-+ s3c2410_gpio_setpin(GTA02_GPIO_BT_EN, on ? 0 : 1);
-+ break;
-+ }
- }
-
- return count;
-@@ -107,9 +142,16 @@
- {
- dev_info(&pdev->dev, DRVMSG ": starting\n");
-
-- /* we make sure that the voltage is off */
-- pcf50606_onoff_set(pcf50606_global,
-- PCF50606_REGULATOR_D1REG, 0);
-+ switch (machine_arch_type) {
-+ case MACH_TYPE_NEO1973_GTA01:
-+ /* we make sure that the voltage is off */
-+ pcf50606_onoff_set(pcf50606_global,
-+ PCF50606_REGULATOR_D1REG, 0);
-+ break;
-+ case MACH_TYPE_NEO1973_GTA02:
-+ /* FIXME: implementation */
-+ break;
-+ }
- /* 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);
-Index: linux-2.6.24/arch/arm/plat-s3c24xx/neo1973_pm_gsm.c
-===================================================================
---- linux-2.6.24.orig/arch/arm/plat-s3c24xx/neo1973_pm_gsm.c
-+++ linux-2.6.24/arch/arm/plat-s3c24xx/neo1973_pm_gsm.c
-@@ -19,8 +19,15 @@
- #include <linux/errno.h>
-
- #include <asm/hardware.h>
-+#include <asm/mach-types.h>
- #include <asm/arch/gta01.h>
-
-+#ifdef CONFIG_MACH_NEO1973_GTA02
-+#include <asm/arch/gta02.h>
-+#include <linux/pcf50633.h>
-+#include <asm/arch/regs-gpioj.h>
-+#endif
-+
- struct gta01pm_priv {
- int gpio_ngsm_en;
- struct console *con;
-@@ -54,8 +61,16 @@
- if (s3c2410_gpio_getpin(GTA01_GPIO_MODEM_RST))
- goto out_1;
- } else if (!strcmp(attr->attr.name, "download")) {
-- if (s3c2410_gpio_getpin(GTA01_GPIO_MODEM_DNLOAD))
-- goto out_1;
-+#ifdef CONFIG_MACH_NEO1973_GTA01
-+ if (machine_is_neo1973_gta01())
-+ if (s3c2410_gpio_getpin(GTA01_GPIO_MODEM_DNLOAD))
-+ goto out_1;
-+#endif
-+#ifdef CONFIG_MACH_NEO1973_GTA02
-+ if (machine_is_neo1973_gta02())
-+ if (s3c2410_gpio_getpin(GTA02_GPIO_nDL_GSM))
-+ goto out_1;
-+#endif
- }
-
- return strlcpy(buf, "0\n", 3);
-@@ -70,32 +85,65 @@
-
- if (!strcmp(attr->attr.name, "power_on")) {
- if (on) {
-- dev_info(dev, "powering up GSM, thus disconnecting "
-- "serial console\n");
-+ if (gta01_gsm.con) {
-+ dev_info(dev, "powering up GSM, thus "
-+ "disconnecting serial console\n");
-
-- if (gta01_gsm.con)
- console_stop(gta01_gsm.con);
-+ }
-
- if (gta01_gsm.gpio_ngsm_en)
- s3c2410_gpio_setpin(gta01_gsm.gpio_ngsm_en, 0);
-
-+ switch (system_rev) {
-+#ifdef CONFIG_MACH_NEO1973_GTA02
-+ case GTA02v2_SYSTEM_REV:
-+ case GTA02v3_SYSTEM_REV:
-+ case GTA02v4_SYSTEM_REV:
-+ case GTA02v5_SYSTEM_REV:
-+ pcf50633_gpio_set(pcf50633_global,
-+ PCF50633_GPIO2, 1);
-+ break;
-+#endif
-+ }
-+
- s3c2410_gpio_setpin(GTA01_GPIO_MODEM_ON, 1);
- } else {
- s3c2410_gpio_setpin(GTA01_GPIO_MODEM_ON, 0);
-
-+ switch (system_rev) {
-+#ifdef CONFIG_MACH_NEO1973_GTA02
-+ case GTA02v2_SYSTEM_REV:
-+ case GTA02v3_SYSTEM_REV:
-+ case GTA02v4_SYSTEM_REV:
-+ case GTA02v5_SYSTEM_REV:
-+ pcf50633_gpio_set(pcf50633_global,
-+ PCF50633_GPIO2, 0);
-+ break;
-+#endif
-+ }
-+
- if (gta01_gsm.gpio_ngsm_en)
- s3c2410_gpio_setpin(gta01_gsm.gpio_ngsm_en, 1);
-
-- if (gta01_gsm.con)
-+ if (gta01_gsm.con) {
- console_start(gta01_gsm.con);
-
-- dev_info(dev, "powered down GSM, thus enabling "
-- "serial console\n");
-+ dev_info(dev, "powered down GSM, thus enabling "
-+ "serial console\n");
-+ }
- }
- } else if (!strcmp(attr->attr.name, "reset")) {
- s3c2410_gpio_setpin(GTA01_GPIO_MODEM_RST, on);
- } else if (!strcmp(attr->attr.name, "download")) {
-- s3c2410_gpio_setpin(GTA01_GPIO_MODEM_DNLOAD, on);
-+#ifdef CONFIG_MACH_NEO1973_GTA01
-+ if (machine_is_neo1973_gta01())
-+ s3c2410_gpio_setpin(GTA01_GPIO_MODEM_DNLOAD, on);
-+#endif
-+#ifdef CONFIG_MACH_NEO1973_GTA02
-+ if (machine_is_neo1973_gta02())
-+ s3c2410_gpio_setpin(GTA02_GPIO_nDL_GSM, on);
-+#endif
- }
-
- return count;
-@@ -134,7 +182,7 @@
- static struct attribute *gta01_gsm_sysfs_entries[] = {
- &dev_attr_power_on.attr,
- &dev_attr_reset.attr,
-- NULL,
-+ &dev_attr_download.attr,
- NULL
- };
-
-@@ -158,8 +206,17 @@
- gta01_gsm.gpio_ngsm_en = GTA01Bv2_GPIO_nGSM_EN;
- s3c2410_gpio_setpin(GTA01v3_GPIO_nGSM_EN, 0);
- break;
-+#ifdef CONFIG_MACH_NEO1973_GTA02
-+ case GTA02v1_SYSTEM_REV:
-+ case GTA02v2_SYSTEM_REV:
-+ case GTA02v3_SYSTEM_REV:
-+ case GTA02v4_SYSTEM_REV:
-+ case GTA02v5_SYSTEM_REV:
-+ gta01_gsm.gpio_ngsm_en = 0;
-+ break;
-+#endif
- default:
-- dev_warn(&pdev->dev, "Unknown GTA01 Revision 0x%x, "
-+ dev_warn(&pdev->dev, "Unknown Neo1973 Revision 0x%x, "
- "some PM features not available!!!\n",
- system_rev);
- break;
-@@ -175,9 +232,13 @@
- break;
- }
-
-- gta01_gsm.con = find_s3c24xx_console();
-- if (!gta01_gsm.con)
-- dev_warn(&pdev->dev, "cannot find S3C24xx console driver\n");
-+ if (machine_is_neo1973_gta01()) {
-+ gta01_gsm.con = find_s3c24xx_console();
-+ if (!gta01_gsm.con)
-+ dev_warn(&pdev->dev,
-+ "cannot find S3C24xx console driver\n");
-+ } else
-+ gta01_gsm.con = NULL;
-
- return sysfs_create_group(&pdev->dev.kobj, >a01_gsm_attr_group);
- }
Index: linux-2.6.24/drivers/leds/leds-neo1973-vibrator.c
===================================================================
--- linux-2.6.24.orig/drivers/leds/leds-neo1973-vibrator.c
Added: branches/src/target/kernel/2.6.24.x/patches/gta02-power_control.patch
===================================================================
--- branches/src/target/kernel/2.6.24.x/patches/gta02-power_control.patch
2008-02-20 06:43:49 UTC (rev 4087)
+++ branches/src/target/kernel/2.6.24.x/patches/gta02-power_control.patch
2008-02-21 03:30:29 UTC (rev 4088)
@@ -0,0 +1,278 @@
+Index: linux-2.6.24/arch/arm/plat-s3c24xx/neo1973_pm_bt.c
+===================================================================
+--- linux-2.6.24.orig/arch/arm/plat-s3c24xx/neo1973_pm_bt.c
++++ linux-2.6.24/arch/arm/plat-s3c24xx/neo1973_pm_bt.c
+@@ -19,7 +19,9 @@
+ #include <linux/pcf50606.h>
+
+ #include <asm/hardware.h>
++#include <asm/mach-types.h>
+ #include <asm/arch/gta01.h>
++#include <asm/arch/gta02.h>
+
+ #define DRVMSG "FIC Neo1973 Bluetooth Power Management"
+
+@@ -27,14 +29,30 @@
+ char *buf)
+ {
+ if (!strcmp(attr->attr.name, "power_on")) {
+- if (pcf50606_onoff_get(pcf50606_global,
+- PCF50606_REGULATOR_D1REG) &&
+- pcf50606_voltage_get(pcf50606_global,
+- PCF50606_REGULATOR_D1REG) == 3100)
+- goto out_1;
++ switch (machine_arch_type) {
++ case MACH_TYPE_NEO1973_GTA01:
++ if (pcf50606_onoff_get(pcf50606_global,
++ PCF50606_REGULATOR_D1REG) &&
++ pcf50606_voltage_get(pcf50606_global,
++ PCF50606_REGULATOR_D1REG) ==
3100)
++ goto out_1;
++ break;
++ case MACH_TYPE_NEO1973_GTA02:
++ if (s3c2410_gpio_getpin(GTA02_GPIO_BT_EN))
++ goto out_1;
++ break;
++ }
+ } else if (!strcmp(attr->attr.name, "reset")) {
+- if (s3c2410_gpio_getpin(GTA01_GPIO_BT_EN) == 0)
+- goto out_1;
++ switch (machine_arch_type) {
++ case MACH_TYPE_NEO1973_GTA01:
++ if (s3c2410_gpio_getpin(GTA01_GPIO_BT_EN) == 0)
++ goto out_1;
++ break;
++ case MACH_TYPE_NEO1973_GTA02:
++ if (s3c2410_gpio_getpin(GTA02_GPIO_BT_EN) == 0)
++ goto out_1;
++ break;
++ }
+ }
+
+ return strlcpy(buf, "0\n", 3);
+@@ -48,20 +66,37 @@
+ unsigned long on = simple_strtoul(buf, NULL, 10);
+
+ if (!strcmp(attr->attr.name, "power_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);
++ switch (machine_arch_type) {
++ case MACH_TYPE_NEO1973_GTA01:
++ /* 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);
++ break;
++ case MACH_TYPE_NEO1973_GTA02:
++ if (on)
++ s3c2410_gpio_setpin(GTA02_GPIO_BT_EN, 0);
++ else
++ s3c2410_gpio_setpin(GTA02_GPIO_BT_EN, 1);
++ break;
+ }
+- pcf50606_onoff_set(pcf50606_global,
+- PCF50606_REGULATOR_D1REG, on);
+- s3c2410_gpio_setpin(GTA01_GPIO_BT_EN, on);
+ } else if (!strcmp(attr->attr.name, "reset")) {
+ /* reset is low-active, so we need to invert */
+- s3c2410_gpio_setpin(GTA01_GPIO_BT_EN, on ? 0 : 1);
++ switch (machine_arch_type) {
++ case MACH_TYPE_NEO1973_GTA01:
++ s3c2410_gpio_setpin(GTA01_GPIO_BT_EN, on ? 0 : 1);
++ break;
++ case MACH_TYPE_NEO1973_GTA02:
++ s3c2410_gpio_setpin(GTA02_GPIO_BT_EN, on ? 0 : 1);
++ break;
++ }
+ }
+
+ return count;
+@@ -107,9 +142,16 @@
+ {
+ dev_info(&pdev->dev, DRVMSG ": starting\n");
+
+- /* we make sure that the voltage is off */
+- pcf50606_onoff_set(pcf50606_global,
+- PCF50606_REGULATOR_D1REG, 0);
++ switch (machine_arch_type) {
++ case MACH_TYPE_NEO1973_GTA01:
++ /* we make sure that the voltage is off */
++ pcf50606_onoff_set(pcf50606_global,
++ PCF50606_REGULATOR_D1REG, 0);
++ break;
++ case MACH_TYPE_NEO1973_GTA02:
++ /* FIXME: implementation */
++ break;
++ }
+ /* 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);
+Index: linux-2.6.24/arch/arm/plat-s3c24xx/neo1973_pm_gsm.c
+===================================================================
+--- linux-2.6.24.orig/arch/arm/plat-s3c24xx/neo1973_pm_gsm.c
++++ linux-2.6.24/arch/arm/plat-s3c24xx/neo1973_pm_gsm.c
+@@ -19,8 +19,15 @@
+ #include <linux/errno.h>
+
+ #include <asm/hardware.h>
++#include <asm/mach-types.h>
+ #include <asm/arch/gta01.h>
+
++#ifdef CONFIG_MACH_NEO1973_GTA02
++#include <asm/arch/gta02.h>
++#include <linux/pcf50633.h>
++#include <asm/arch/regs-gpioj.h>
++#endif
++
+ struct gta01pm_priv {
+ int gpio_ngsm_en;
+ struct console *con;
+@@ -54,8 +61,16 @@
+ if (s3c2410_gpio_getpin(GTA01_GPIO_MODEM_RST))
+ goto out_1;
+ } else if (!strcmp(attr->attr.name, "download")) {
+- if (s3c2410_gpio_getpin(GTA01_GPIO_MODEM_DNLOAD))
+- goto out_1;
++#ifdef CONFIG_MACH_NEO1973_GTA01
++ if (machine_is_neo1973_gta01())
++ if (s3c2410_gpio_getpin(GTA01_GPIO_MODEM_DNLOAD))
++ goto out_1;
++#endif
++#ifdef CONFIG_MACH_NEO1973_GTA02
++ if (machine_is_neo1973_gta02())
++ if (s3c2410_gpio_getpin(GTA02_GPIO_nDL_GSM))
++ goto out_1;
++#endif
+ }
+
+ return strlcpy(buf, "0\n", 3);
+@@ -70,32 +85,65 @@
+
+ if (!strcmp(attr->attr.name, "power_on")) {
+ if (on) {
+- dev_info(dev, "powering up GSM, thus disconnecting "
+- "serial console\n");
++ if (gta01_gsm.con) {
++ dev_info(dev, "powering up GSM, thus "
++ "disconnecting serial console\n");
+
+- if (gta01_gsm.con)
+ console_stop(gta01_gsm.con);
++ }
+
+ if (gta01_gsm.gpio_ngsm_en)
+ s3c2410_gpio_setpin(gta01_gsm.gpio_ngsm_en, 0);
+
++ switch (system_rev) {
++#ifdef CONFIG_MACH_NEO1973_GTA02
++ case GTA02v2_SYSTEM_REV:
++ case GTA02v3_SYSTEM_REV:
++ case GTA02v4_SYSTEM_REV:
++ case GTA02v5_SYSTEM_REV:
++ pcf50633_gpio_set(pcf50633_global,
++ PCF50633_GPIO2, 1);
++ break;
++#endif
++ }
++
+ s3c2410_gpio_setpin(GTA01_GPIO_MODEM_ON, 1);
+ } else {
+ s3c2410_gpio_setpin(GTA01_GPIO_MODEM_ON, 0);
+
++ switch (system_rev) {
++#ifdef CONFIG_MACH_NEO1973_GTA02
++ case GTA02v2_SYSTEM_REV:
++ case GTA02v3_SYSTEM_REV:
++ case GTA02v4_SYSTEM_REV:
++ case GTA02v5_SYSTEM_REV:
++ pcf50633_gpio_set(pcf50633_global,
++ PCF50633_GPIO2, 0);
++ break;
++#endif
++ }
++
+ if (gta01_gsm.gpio_ngsm_en)
+ s3c2410_gpio_setpin(gta01_gsm.gpio_ngsm_en, 1);
+
+- if (gta01_gsm.con)
++ if (gta01_gsm.con) {
+ console_start(gta01_gsm.con);
+
+- dev_info(dev, "powered down GSM, thus enabling "
+- "serial console\n");
++ dev_info(dev, "powered down GSM, thus enabling "
++ "serial console\n");
++ }
+ }
+ } else if (!strcmp(attr->attr.name, "reset")) {
+ s3c2410_gpio_setpin(GTA01_GPIO_MODEM_RST, on);
+ } else if (!strcmp(attr->attr.name, "download")) {
+- s3c2410_gpio_setpin(GTA01_GPIO_MODEM_DNLOAD, on);
++#ifdef CONFIG_MACH_NEO1973_GTA01
++ if (machine_is_neo1973_gta01())
++ s3c2410_gpio_setpin(GTA01_GPIO_MODEM_DNLOAD, on);
++#endif
++#ifdef CONFIG_MACH_NEO1973_GTA02
++ if (machine_is_neo1973_gta02())
++ s3c2410_gpio_setpin(GTA02_GPIO_nDL_GSM, on);
++#endif
+ }
+
+ return count;
+@@ -134,7 +182,7 @@
+ static struct attribute *gta01_gsm_sysfs_entries[] = {
+ &dev_attr_power_on.attr,
+ &dev_attr_reset.attr,
+- NULL,
++ &dev_attr_download.attr,
+ NULL
+ };
+
+@@ -158,8 +206,17 @@
+ gta01_gsm.gpio_ngsm_en = GTA01Bv2_GPIO_nGSM_EN;
+ s3c2410_gpio_setpin(GTA01v3_GPIO_nGSM_EN, 0);
+ break;
++#ifdef CONFIG_MACH_NEO1973_GTA02
++ case GTA02v1_SYSTEM_REV:
++ case GTA02v2_SYSTEM_REV:
++ case GTA02v3_SYSTEM_REV:
++ case GTA02v4_SYSTEM_REV:
++ case GTA02v5_SYSTEM_REV:
++ gta01_gsm.gpio_ngsm_en = 0;
++ break;
++#endif
+ default:
+- dev_warn(&pdev->dev, "Unknown GTA01 Revision 0x%x, "
++ dev_warn(&pdev->dev, "Unknown Neo1973 Revision 0x%x, "
+ "some PM features not available!!!\n",
+ system_rev);
+ break;
+@@ -175,9 +232,13 @@
+ break;
+ }
+
+- gta01_gsm.con = find_s3c24xx_console();
+- if (!gta01_gsm.con)
+- dev_warn(&pdev->dev, "cannot find S3C24xx console driver\n");
++ if (machine_is_neo1973_gta01()) {
++ gta01_gsm.con = find_s3c24xx_console();
++ if (!gta01_gsm.con)
++ dev_warn(&pdev->dev,
++ "cannot find S3C24xx console driver\n");
++ } else
++ gta01_gsm.con = NULL;
+
+ return sysfs_create_group(&pdev->dev.kobj, >a01_gsm_attr_group);
+ }
Modified: branches/src/target/kernel/2.6.24.x/patches/series
===================================================================
--- branches/src/target/kernel/2.6.24.x/patches/series 2008-02-20 06:43:49 UTC
(rev 4087)
+++ branches/src/target/kernel/2.6.24.x/patches/series 2008-02-21 03:30:29 UTC
(rev 4088)
@@ -46,6 +46,7 @@
smedia-glamo.patch
glamo-mmc.patch
gta02-core.patch
+gta02-power_control.patch
gta02-sound.patch
lis302dl.patch
gta02-leds.patch
--- End Message ---
--- Begin Message ---
Author: werner
Date: 2008-02-21 05:04:39 +0100 (Thu, 21 Feb 2008)
New Revision: 4089
Modified:
branches/src/target/kernel/2.6.24.x/patches/gta02-power_control.patch
Log:
First part of suspend-prelim2.bin by Matt Hsu, with some adaptations.
(The system can get into suspend when gsmd starts up.)
arch/arm/plat-s3c24xx/neo1973_pm_gsm.c (gta01_gsm_suspend, gta01_gsm_resume):
set GTA02_GPIO_nDL_GSM during suspend (if on GTA02)
Modified: branches/src/target/kernel/2.6.24.x/patches/gta02-power_control.patch
===================================================================
--- branches/src/target/kernel/2.6.24.x/patches/gta02-power_control.patch
2008-02-21 03:30:29 UTC (rev 4088)
+++ branches/src/target/kernel/2.6.24.x/patches/gta02-power_control.patch
2008-02-21 04:04:39 UTC (rev 4089)
@@ -12,7 +12,7 @@
#define DRVMSG "FIC Neo1973 Bluetooth Power Management"
-@@ -27,14 +29,30 @@
+@@ -27,14 +29,30 @@ static ssize_t bt_read(struct device *de
char *buf)
{
if (!strcmp(attr->attr.name, "power_on")) {
@@ -50,7 +50,7 @@
}
return strlcpy(buf, "0\n", 3);
-@@ -48,20 +66,37 @@
+@@ -48,20 +66,37 @@ static ssize_t bt_write(struct device *d
unsigned long on = simple_strtoul(buf, NULL, 10);
if (!strcmp(attr->attr.name, "power_on")) {
@@ -99,7 +99,7 @@
}
return count;
-@@ -107,9 +142,16 @@
+@@ -107,9 +142,16 @@ static int __init gta01_bt_probe(struct
{
dev_info(&pdev->dev, DRVMSG ": starting\n");
@@ -139,7 +139,7 @@
struct gta01pm_priv {
int gpio_ngsm_en;
struct console *con;
-@@ -54,8 +61,16 @@
+@@ -54,8 +61,16 @@ static ssize_t gsm_read(struct device *d
if (s3c2410_gpio_getpin(GTA01_GPIO_MODEM_RST))
goto out_1;
} else if (!strcmp(attr->attr.name, "download")) {
@@ -158,7 +158,7 @@
}
return strlcpy(buf, "0\n", 3);
-@@ -70,32 +85,65 @@
+@@ -70,32 +85,65 @@ static ssize_t gsm_write(struct device *
if (!strcmp(attr->attr.name, "power_on")) {
if (on) {
@@ -231,7 +231,26 @@
}
return count;
-@@ -134,7 +182,7 @@
+@@ -111,6 +159,9 @@ static int gta01_gsm_suspend(struct plat
+ /* GPIO state is saved/restored by S3C2410 core GPIO driver, so we
+ * don't need to do anything here */
+
++ /* disable DL GSM to prevent jack_insert becoming flaoting */
++ if (machine_is_neo1973_gta02())
++ s3c2410_gpio_setpin(GTA02_GPIO_nDL_GSM, 1);
+ return 0;
+ }
+
+@@ -124,6 +175,8 @@ static int gta01_gsm_resume(struct platf
+ if (s3c2410_gpio_getpin(GTA01_GPIO_MODEM_ON) && gta01_gsm.con)
+ console_stop(gta01_gsm.con);
+
++ if (machine_is_neo1973_gta02())
++ s3c2410_gpio_setpin(GTA02_GPIO_nDL_GSM, 0);
+ return 0;
+ }
+ #else
+@@ -134,7 +187,7 @@ static int gta01_gsm_resume(struct platf
static struct attribute *gta01_gsm_sysfs_entries[] = {
&dev_attr_power_on.attr,
&dev_attr_reset.attr,
@@ -240,7 +259,7 @@
NULL
};
-@@ -158,8 +206,17 @@
+@@ -158,8 +211,17 @@ static int __init gta01_gsm_probe(struct
gta01_gsm.gpio_ngsm_en = GTA01Bv2_GPIO_nGSM_EN;
s3c2410_gpio_setpin(GTA01v3_GPIO_nGSM_EN, 0);
break;
@@ -259,7 +278,7 @@
"some PM features not available!!!\n",
system_rev);
break;
-@@ -175,9 +232,13 @@
+@@ -175,9 +237,13 @@ static int __init gta01_gsm_probe(struct
break;
}
--- End Message ---
--- Begin Message ---
Author: werner
Date: 2008-02-21 05:16:03 +0100 (Thu, 21 Feb 2008)
New Revision: 4090
Modified:
branches/src/target/kernel/2.6.24.x/patches/gta01-inputdevice.patch
Log:
Second part of suspend-prelim2.bin by Matt Hsu:
Remove AUX key as wake up source [so that we can resume even if the
NOR has no valid content].
gta01-inputdevice.patch:
- drivers/input/keyboard/neo1973kbd.c (neo1973kbd_probe): add AUX as a wakeup
interrupt source only if on GTA01
Modified: branches/src/target/kernel/2.6.24.x/patches/gta01-inputdevice.patch
===================================================================
--- branches/src/target/kernel/2.6.24.x/patches/gta01-inputdevice.patch
2008-02-21 04:04:39 UTC (rev 4089)
+++ branches/src/target/kernel/2.6.24.x/patches/gta01-inputdevice.patch
2008-02-21 04:16:03 UTC (rev 4090)
@@ -2,11 +2,11 @@
Signed-off-by: Harald Welte <[EMAIL PROTECTED]>
-Index: linux-2.6/drivers/input/keyboard/Kconfig
+Index: linux-2.6.24/drivers/input/keyboard/Kconfig
===================================================================
---- linux-2.6.orig/drivers/input/keyboard/Kconfig
-+++ linux-2.6/drivers/input/keyboard/Kconfig
-@@ -293,4 +293,16 @@
+--- linux-2.6.24.orig/drivers/input/keyboard/Kconfig
++++ linux-2.6.24/drivers/input/keyboard/Kconfig
+@@ -293,4 +293,16 @@ config KEYBOARD_BFIN
To compile this driver as a module, choose M here: the
module will be called bf54x-keys.
@@ -23,11 +23,11 @@
+
+
endif
-Index: linux-2.6/drivers/input/keyboard/Makefile
+Index: linux-2.6.24/drivers/input/keyboard/Makefile
===================================================================
---- linux-2.6.orig/drivers/input/keyboard/Makefile
-+++ linux-2.6/drivers/input/keyboard/Makefile
-@@ -14,6 +14,7 @@
+--- linux-2.6.24.orig/drivers/input/keyboard/Makefile
++++ linux-2.6.24/drivers/input/keyboard/Makefile
+@@ -14,6 +14,7 @@ obj-$(CONFIG_KEYBOARD_LOCOMO) += locomo
obj-$(CONFIG_KEYBOARD_NEWTON) += newtonkbd.o
obj-$(CONFIG_KEYBOARD_STOWAWAY) += stowaway.o
obj-$(CONFIG_KEYBOARD_CORGI) += corgikbd.o
@@ -35,11 +35,11 @@
obj-$(CONFIG_KEYBOARD_SPITZ) += spitzkbd.o
obj-$(CONFIG_KEYBOARD_HIL) += hil_kbd.o
obj-$(CONFIG_KEYBOARD_HIL_OLD) += hilkbd.o
-Index: linux-2.6/drivers/input/keyboard/neo1973kbd.c
+Index: linux-2.6.24/drivers/input/keyboard/neo1973kbd.c
===================================================================
--- /dev/null
-+++ linux-2.6/drivers/input/keyboard/neo1973kbd.c
-@@ -0,0 +1,236 @@
++++ linux-2.6.24/drivers/input/keyboard/neo1973kbd.c
+@@ -0,0 +1,239 @@
+/*
+ * Keyboard driver for FIC Neo1973 GSM phone
+ *
@@ -66,6 +66,7 @@
+
+#include <asm/hardware.h>
+#include <asm/arch/gta01.h>
++#include <asm/mach-types.h>
+
+struct neo1973kbd {
+ struct input_dev *input;
@@ -200,8 +201,10 @@
+ dev_err(&pdev->dev, "Can't get IRQ %u\n", irq_aux);
+ goto out_aux;
+ }
-+ enable_irq_wake(irq_aux);
+
++ if (machine_is_neo1973_gta01())
++ enable_irq_wake(irq_aux);
++
+ if (request_irq(irq_hold, neo1973kbd_hold_irq, IRQF_DISABLED |
+ IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
+ "Neo1973 HOLD button", neo1973kbd)) {
--- End Message ---
--- Begin Message ---
Author: erin_yueh
Date: 2008-02-21 06:16:15 +0100 (Thu, 21 Feb 2008)
New Revision: 4091
Modified:
trunk/src/target/gsm/include/gsmd/usock.h
trunk/src/target/gsm/include/libgsmd/misc.h
trunk/src/target/gsm/src/gsmd/usock.c
trunk/src/target/gsm/src/libgsmd/libgsmd_phone.c
trunk/src/target/gsm/src/libgsmd/libgsmd_pin.c
trunk/src/target/gsm/src/util/shell.c
Log:
gsmd: get battery status (Sudharshan S)
Modified: trunk/src/target/gsm/include/gsmd/usock.h
===================================================================
--- trunk/src/target/gsm/include/gsmd/usock.h 2008-02-21 04:16:03 UTC (rev
4090)
+++ trunk/src/target/gsm/include/gsmd/usock.h 2008-02-21 05:16:15 UTC (rev
4091)
@@ -139,6 +139,7 @@
GSMD_PHONE_GET_MODEL = 5,
GSMD_PHONE_GET_REVISION = 6,
GSMD_PHONE_GET_SERIAL = 7,
+ GSMD_PHONE_GET_BATTERY = 8,
};
enum gsmd_msg_modem {
@@ -371,6 +372,14 @@
/* Length from 3GPP TS 04.08, Clause 10.5.4.7 */
+/* battery connection status from 3GPP TS 07.07 subclause 8.4 */
+enum gsmd_bat_conn_status {
+ GSMD_BAT_NORMAL = 0,
+ GSMD_BAT_NOT_POWERED = 1,
+ GSMD_BAT_NO_BAT = 2,
+ GSMD_BAT_POWER_FAULT = 3,
+};
+
#define GSMD_ADDR_MAXLEN 32
struct gsmd_addr {
u_int8_t type;
@@ -392,6 +401,11 @@
struct gsmd_addr addr;
} __attribute__ ((packed));
+struct gsmd_battery_charge {
+ enum gsmd_bat_conn_status bcs;
+ u_int8_t bcl;
+} __attribute__ ((packed));
+
#define GSMD_ALPHA_MAXLEN 20
/* call status from 3GPP TS 07.07 clause 07.17 */
Modified: trunk/src/target/gsm/include/libgsmd/misc.h
===================================================================
--- trunk/src/target/gsm/include/libgsmd/misc.h 2008-02-21 04:16:03 UTC (rev
4090)
+++ trunk/src/target/gsm/include/libgsmd/misc.h 2008-02-21 05:16:15 UTC (rev
4091)
@@ -71,4 +71,6 @@
extern int lgsm_voicemail_set(struct lgsm_handle *lh, const char *number);
/* Get currently configured voice mail number */
extern int lgsm_voicemail_get(struct lgsm_handle *lh);
+/* Get Battery Connection status and charge level */
+extern int lgsm_get_battery(struct lgsm_handle *lh);
#endif
Modified: trunk/src/target/gsm/src/gsmd/usock.c
===================================================================
--- trunk/src/target/gsm/src/gsmd/usock.c 2008-02-21 04:16:03 UTC (rev
4090)
+++ trunk/src/target/gsm/src/gsmd/usock.c 2008-02-21 05:16:15 UTC (rev
4091)
@@ -613,7 +613,7 @@
cmd->id, sizeof(ret), &ret);
}
-static int gsmd_get_manuf_cb(struct gsmd_atcmd *cmd, void *ctx, char *resp)
+static int phone_get_manuf_cb(struct gsmd_atcmd *cmd, void *ctx, char *resp)
{
struct gsmd_user *gu = ctx;
@@ -624,7 +624,7 @@
cmd->id, strlen(resp) + 1, resp);
}
-static int gsmd_get_model_cb(struct gsmd_atcmd *cmd, void *ctx, char *resp)
+static int phone_get_model_cb(struct gsmd_atcmd *cmd, void *ctx, char *resp)
{
struct gsmd_user *gu = ctx;
@@ -635,7 +635,7 @@
cmd->id, strlen(resp) + 1, resp);
}
-static int gsmd_get_revision_cb(struct gsmd_atcmd *cmd, void *ctx, char *resp)
+static int phone_get_revision_cb(struct gsmd_atcmd *cmd, void *ctx, char *resp)
{
struct gsmd_user *gu = ctx;
@@ -646,7 +646,7 @@
cmd->id, strlen(resp) + 1, resp);
}
-static int gsmd_get_serial_cb(struct gsmd_atcmd *cmd, void *ctx, char *resp)
+static int phone_get_serial_cb(struct gsmd_atcmd *cmd, void *ctx, char *resp)
{
struct gsmd_user *gu = ctx;
@@ -657,6 +657,28 @@
cmd->id, strlen(resp) + 1, resp);
}
+static int phone_get_battery_cb(struct gsmd_atcmd *cmd, void *ctx, char *resp)
+{
+ struct gsmd_user *gu = ctx;
+ struct gsmd_battery_charge gbs;
+ struct gsm_extrsp *er;
+
+ DEBUGP("cmd = '%s', resp: '%s'\n", cmd->buf, resp);
+ er = extrsp_parse(gsmd_tallocs, resp);
+ if(!er)
+ return -ENOMEM;
+ /* +CBC: 0,0 */
+ if((er->num_tokens == 2) &&
+ er->tokens[0].type == GSMD_ECMD_RTT_NUMERIC &&
+ er->tokens[1].type == GSMD_ECMD_RTT_NUMERIC ) {
+ gbs.bcs = er->tokens[0].u.numeric;
+ gbs.bcl = er->tokens[1].u.numeric;
+ }
+ talloc_free(er);
+ return gsmd_ucmd_submit(gu, GSMD_MSG_PHONE, GSMD_PHONE_GET_BATTERY,
+ cmd -> id, sizeof(gbs), &gbs);
+}
+
static int usock_rcv_phone(struct gsmd_user *gu, struct gsmd_msg_hdr *gph,
int len)
{
@@ -679,21 +701,23 @@
break;
case GSMD_PHONE_GET_MANUF:
cmd = atcmd_fill("AT+CGMI", 7+1,
- &gsmd_get_manuf_cb, gu, 0, NULL);
+ &phone_get_manuf_cb, gu, 0, NULL);
break;
case GSMD_PHONE_GET_MODEL:
cmd = atcmd_fill("AT+CGMM", 7+1,
- &gsmd_get_model_cb, gu, 0, NULL);
+ &phone_get_model_cb, gu, 0, NULL);
break;
case GSMD_PHONE_GET_REVISION:
cmd = atcmd_fill("AT+CGMR", 7+1,
- &gsmd_get_revision_cb, gu, 0, NULL);
+ &phone_get_revision_cb, gu, 0, NULL);
break;
case GSMD_PHONE_GET_SERIAL:
cmd = atcmd_fill("AT+CGSN", 7+1,
- &gsmd_get_serial_cb, gu, 0, NULL);
+ &phone_get_serial_cb, gu, 0, NULL);
break;
-
+ case GSMD_PHONE_GET_BATTERY:
+ cmd = atcmd_fill("AT+CBC", 6+1, &phone_get_battery_cb, gu, 0,
NULL);
+ break;
default:
return -EINVAL;
}
Modified: trunk/src/target/gsm/src/libgsmd/libgsmd_phone.c
===================================================================
--- trunk/src/target/gsm/src/libgsmd/libgsmd_phone.c 2008-02-21 04:16:03 UTC
(rev 4090)
+++ trunk/src/target/gsm/src/libgsmd/libgsmd_phone.c 2008-02-21 05:16:15 UTC
(rev 4091)
@@ -70,3 +70,7 @@
return lgsm_send_simple(lh, GSMD_MSG_PHONE, GSMD_PHONE_GET_SERIAL);
}
+int lgsm_get_battery(struct lgsm_handle *lh)
+{
+ return lgsm_send_simple(lh, GSMD_MSG_PHONE, GSMD_PHONE_GET_BATTERY);
+}
Modified: trunk/src/target/gsm/src/libgsmd/libgsmd_pin.c
===================================================================
--- trunk/src/target/gsm/src/libgsmd/libgsmd_pin.c 2008-02-21 04:16:03 UTC
(rev 4090)
+++ trunk/src/target/gsm/src/libgsmd/libgsmd_pin.c 2008-02-21 05:16:15 UTC
(rev 4091)
@@ -28,6 +28,8 @@
#include <gsmd/event.h>
#include <libgsmd/libgsmd.h>
+#include "lgsm_internals.h"
+
static const char *pin_type_names[__NUM_GSMD_PIN] = {
[GSMD_PIN_READY] = "READY",
[GSMD_PIN_SIM_PIN] = "SIM PIN",
Modified: trunk/src/target/gsm/src/util/shell.c
===================================================================
--- trunk/src/target/gsm/src/util/shell.c 2008-02-21 04:16:03 UTC (rev
4090)
+++ trunk/src/target/gsm/src/util/shell.c 2008-02-21 05:16:15 UTC (rev
4091)
@@ -394,6 +394,8 @@
{
char *payload = (char *)gmh + sizeof(*gmh);
int *intresult = (void *)gmh + sizeof(*gmh);
+ const struct gsmd_battery_charge *bc = (struct gsmd_battery_charge *)
+ ((void *) gmh + sizeof(*gmh));
switch (gmh->msg_subtype) {
case GSMD_PHONE_GET_IMSI:
@@ -423,6 +425,9 @@
else
printf("Modem down\n");
break;
+ case GSMD_PHONE_GET_BATTERY:
+ printf("<BCS>: %d <BCL>: %d \n", bc->bcs, bc->bcl);
+ break;
default:
return -EINVAL;
}
@@ -568,6 +573,7 @@
"\tsn\tGet serial number\n"
"\tcs\tGet Call status\n"
"\tgp\tGet PIN status\n"
+ "\tcbc\tGet Battery status\n"
"\tRh\tRelease all held calls (+CHLD=0)\n"
"\tUDUB\tUser Determined User Busy (+CHLD=0)\n"
"\tRa\tRelease all active calls (+CHLD=1)\n"
@@ -987,6 +993,10 @@
ptr = strchr(buf, '=');
lgsm_voice_fwd_erase(lgsmh, atoi(ptr+1));
pending_responses ++;
+ }else if ( !strncmp(buf, "cbc", 3)) {
+ printf("Battery Connection status and Battery
Charge Level\n");
+ lgsm_get_battery(lgsmh);
+ pending_responses++;
}else {
printf("Unknown command `%s'\n", buf);
}
--- End Message ---
_______________________________________________
commitlog mailing list
[email protected]
http://lists.openmoko.org/mailman/listinfo/commitlog