-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Somebody in the thread at some point said:
| Somebody in the thread at some point said:
| | Somebody in the thread at some point said:
| | | Andy,
| | |
| | | I've now confirmed it is from GSM wakeup. If I do not initialize the
| GSM
| | | then the phone never locks up.
| |
| | EXCELLENT, thanks a lot.
| |
| | Mike can this plug into the serial resume problems?
| |
| | How can one provoke GSM wakes then? Although I am in runlevel 3 I do
| | actually have a SIM card in and am running gsmd -- last night before I
| | went to bed though I put it in suspend, and it woke 100% perfect
| | thismorning after 7 - 8 hours suspended. But it didn't wake before that
| | from GSM.... you really have to ring the phone?
|
| Hm what's going on here... in the resume:
|
| /* We must defer the auto flowcontrol because we resume before
Sean,
I have a dirty patch done really quickly since I have to go out for a
few hours, I tested it and it correctly defers resume of pm-gsm until
after uart0 on GTA02. Please give it a whirl and I will fix up any
breakage when I get back.
- -Andy
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
iEYEARECAAYFAkhZTH8ACgkQOjLpvpq7dMorBwCdGtgLubXBO/OAkRq/wIEtEdIt
BZQAn0kdxCmisWJ9DL89YUk8i1/quYD/
=DonI
-----END PGP SIGNATURE-----
fix-gsm-resume-problems.patch
From: Andy Green <[EMAIL PROTECTED]>
Signed-off-by: Andy Green <[EMAIL PROTECTED]>
---
arch/arm/plat-s3c24xx/neo1973_pm_gsm.c | 21 +++++++++++++++++++++
drivers/serial/s3c2410.c | 17 +++++++++++++++++
2 files changed, 38 insertions(+), 0 deletions(-)
diff --git a/arch/arm/plat-s3c24xx/neo1973_pm_gsm.c b/arch/arm/plat-s3c24xx/neo1973_pm_gsm.c
index 3d086bc..87c407e 100644
--- a/arch/arm/plat-s3c24xx/neo1973_pm_gsm.c
+++ b/arch/arm/plat-s3c24xx/neo1973_pm_gsm.c
@@ -18,6 +18,7 @@
#include <linux/console.h>
#include <linux/errno.h>
#include <linux/interrupt.h>
+#include <linux/resume-dependency.h>
#include <asm/gpio.h>
#include <asm/mach-types.h>
@@ -35,6 +36,9 @@
#include <linux/delay.h>
extern void s3c24xx_fake_rx_interrupt(int l);
+extern void s3c24xx_serial_register_resume_dependency(struct resume_dependency *
+ resume_dependency, int uart_index);
+
static struct work_struct gsmwork;
@@ -59,9 +63,12 @@ EXPORT_SYMBOL(gta_gsm_interrupts);
struct gta01pm_priv {
int gpio_ngsm_en;
int gpio_ndl_gsm;
+
struct console *con;
};
+struct resume_dependency resume_dep_gsm_uart;
+
static struct gta01pm_priv gta01_gsm;
static struct console *find_s3c24xx_console(void)
@@ -431,6 +438,7 @@ static void gsm_resume_work(struct work_struct *w)
printk(KERN_INFO "%s: done.\n", __FUNCTION__);
}
+static int gta01_gsm_resume(struct platform_device *pdev);
static int gta01_gsm_suspend(struct platform_device *pdev, pm_message_t state)
{
/* GPIO state is saved/restored by S3C2410 core GPIO driver, so we
@@ -466,6 +474,12 @@ static int gta01_gsm_suspend(struct platform_device *pdev, pm_message_t state)
if (machine_is_neo1973_gta02())
s3c2410_gpio_setpin(GTA02_GPIO_nDL_GSM, 1);
+ /* register our resume dependency on the appropriate UART being up */
+ resume_dep_gsm_uart.callback = gta01_gsm_resume;
+ resume_dep_gsm_uart.context = (void *)pdev;
+
+ s3c24xx_serial_register_resume_dependency(&resume_dep_gsm_uart, 0);
+
return 0;
busy:
@@ -486,6 +500,11 @@ gta01_gsm_suspend_late(struct platform_device *pdev, pm_message_t state)
static int gta01_gsm_resume(struct platform_device *pdev)
{
+ if (resume_dep_gsm_uart.called_flag != 1)
+ return 0;
+
+ resume_dep_gsm_uart.called_flag++; /* only run once */
+
/* GPIO state is saved/restored by S3C2410 core GPIO driver, so we
* don't need to do much here. */
@@ -588,6 +607,8 @@ static int __init gta01_gsm_probe(struct platform_device *pdev)
if (machine_is_neo1973_gta02())
s3c2410_gpio_setpin(GTA02_GPIO_nDL_GSM, 1);
+ init_resume_dependency_list(&resume_dep_gsm_uart);
+
return sysfs_create_group(&pdev->dev.kobj, >a01_gsm_attr_group);
}
diff --git a/drivers/serial/s3c2410.c b/drivers/serial/s3c2410.c
index 3315fca..f174ff1 100644
--- a/drivers/serial/s3c2410.c
+++ b/drivers/serial/s3c2410.c
@@ -72,6 +72,7 @@
#include <linux/serial.h>
#include <linux/delay.h>
#include <linux/clk.h>
+#include <linux/resume-dependency.h>
#include <asm/io.h>
#include <asm/irq.h>
@@ -117,6 +118,8 @@ struct s3c24xx_uart_port {
struct clk *clk;
struct clk *baudclk;
struct uart_port port;
+
+ struct resume_dependency resume_dependency;
};
@@ -1298,6 +1301,8 @@ static int s3c24xx_serial_probe(struct platform_device *dev,
ourport = &s3c24xx_serial_ports[probe_index];
probe_index++;
+ init_resume_dependency_list(&ourport->resume_dependency);
+
dbg("%s: initialising port %p...\n", __FUNCTION__, ourport);
ret = s3c24xx_serial_init_port(ourport, info, dev);
@@ -1365,6 +1370,16 @@ static int s3c24xx_serial_suspend(struct platform_device *dev,
return -EBUSY;
}
+void s3c24xx_serial_register_resume_dependency(struct resume_dependency *
+ resume_dependency, int uart_index)
+{
+ struct s3c24xx_uart_port *ourport = &s3c24xx_serial_ports[uart_index];
+
+ register_resume_dependency(&ourport->resume_dependency,
+ resume_dependency);
+}
+EXPORT_SYMBOL(s3c24xx_serial_register_resume_dependency);
+
static int s3c24xx_serial_resume(struct platform_device *dev)
{
struct uart_port *port = s3c24xx_dev_to_port(&dev->dev);
@@ -1405,6 +1420,8 @@ static int s3c24xx_serial_resume(struct platform_device *dev)
}
}
+ callback_all_resume_dependencies(&ourport->resume_dependency);
+
return 0;
}