aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/plat-s3c24xx/neo1973_pm_gsm.c
diff options
context:
space:
mode:
authorAndy Green <andy@openmoko.com>2008-11-19 17:09:52 +0000
committerAndy Green <agreen@pads.home.warmcat.com>2008-11-19 17:09:52 +0000
commit7e7270be85be64eeee2196bbc8cd877395870f40 (patch)
tree56fddaa9490ac18ab327fa172fd5c224c79b3344 /arch/arm/plat-s3c24xx/neo1973_pm_gsm.c
parenta87a0ef35f6f1d0c18af247dd0fc3a5027613b63 (diff)
fix-gsm-resume-problems.patch
Signed-off-by: Andy Green <andy@openmoko.com>
Diffstat (limited to 'arch/arm/plat-s3c24xx/neo1973_pm_gsm.c')
-rw-r--r--arch/arm/plat-s3c24xx/neo1973_pm_gsm.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/arm/plat-s3c24xx/neo1973_pm_gsm.c b/arch/arm/plat-s3c24xx/neo1973_pm_gsm.c
index 149b8669add..6b6b2f4cc7d 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>
@@ -33,9 +34,12 @@
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)
@@ -179,6 +183,8 @@ static DEVICE_ATTR(reset, 0644, gsm_read, gsm_write);
static DEVICE_ATTR(download, 0644, gsm_read, gsm_write);
#ifdef CONFIG_PM
+
+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
@@ -189,11 +195,22 @@ 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;
}
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. */
@@ -279,6 +296,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, &gta01_gsm_attr_group);
}