[PATCH] [GTA02] Fix compilation of neo1973_pm_gsm if no GTA02

Harald Welte laforge at openmoko.org
Tue Nov 18 17:36:57 CET 2008


If compiling a kernel with just GTA01 support, we have to
make sure we don't include the GTA02 specific bits in this driver.

Signed-off-by: Harald Welte <laforge at openmoko.org>
---
 arch/arm/plat-s3c24xx/neo1973_pm_gsm.c |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/arch/arm/plat-s3c24xx/neo1973_pm_gsm.c b/arch/arm/plat-s3c24xx/neo1973_pm_gsm.c
index c15998d..a3515ed 100644
--- a/arch/arm/plat-s3c24xx/neo1973_pm_gsm.c
+++ b/arch/arm/plat-s3c24xx/neo1973_pm_gsm.c
@@ -70,15 +70,19 @@ static ssize_t gsm_read(struct device *dev, struct device_attribute *attr,
 	} else if (!strcmp(attr->attr.name, "reset")) {
 		if (machine_is_neo1973_gta01() && s3c2410_gpio_getpin(GTA01_GPIO_MODEM_RST))
 			goto out_1;
+#ifdef CONFIG_MACH_NEO1973_GTA02
 		else if (machine_is_neo1973_gta02() && s3c2410_gpio_getpin(GTA02_GPIO_MODEM_RST))
 			goto out_1;
+#endif
 	} else if (!strcmp(attr->attr.name, "download")) {
 		if (machine_is_neo1973_gta01()) {
 			if (s3c2410_gpio_getpin(GTA01_GPIO_MODEM_DNLOAD))
 				goto out_1;
+#ifdef CONFIG_MACH_NEO1973_GTA02
 		} else if (machine_is_neo1973_gta02()) {
 			if (!s3c2410_gpio_getpin(GTA02_GPIO_nDL_GSM))
 				goto out_1;
+#endif
 		}
 	} else if (!strcmp(attr->attr.name, "flowcontrolled")) {
 		if (s3c2410_gpio_getcfg(S3C2410_GPH1) == S3C2410_GPIO_OUTPUT)
@@ -152,12 +156,14 @@ static ssize_t gsm_write(struct device *dev, struct device_attribute *attr,
 	} else if (!strcmp(attr->attr.name, "reset")) {
 		if (machine_is_neo1973_gta01())
 			neo1973_gpb_setpin(GTA01_GPIO_MODEM_RST, on);
+#ifdef CONFIG_MACH_NEO1973_GTA02
 		else if (machine_is_neo1973_gta02())
 			neo1973_gpb_setpin(GTA02_GPIO_MODEM_RST, on);
+#endif
 	} else if (!strcmp(attr->attr.name, "download")) {
 		if (machine_is_neo1973_gta01())
 			s3c2410_gpio_setpin(GTA01_GPIO_MODEM_DNLOAD, on);
-
+#ifdef CONFIG_MACH_NEO1973_GTA02
 		if (machine_is_neo1973_gta02()) {
 			/*
 			 * the keyboard / buttons driver requests and enables
@@ -181,6 +187,7 @@ static ssize_t gsm_write(struct device *dev, struct device_attribute *attr,
 			gta01_gsm.gpio_ndl_gsm = !on;
 			s3c2410_gpio_setpin(GTA02_GPIO_nDL_GSM, !on);
 		}
+#endif
 	} else if (!strcmp(attr->attr.name, "flowcontrolled")) {
 		if (on) {
 			gta_gsm_interrupts = 0;
@@ -211,9 +218,11 @@ static int gta01_gsm_suspend(struct platform_device *pdev, pm_message_t state)
 			goto busy;
 	}
 
+#ifdef CONFIG_MACH_NEO1973_GTA02
 	/* disable DL GSM to prevent jack_insert becoming 'floating' */
 	if (machine_is_neo1973_gta02())
 		s3c2410_gpio_setpin(GTA02_GPIO_nDL_GSM, 1);
+#endif
 
 	/* register our resume dependency on the appropriate UART being up */
 	resume_dep_gsm_uart.callback = gta01_gsm_resume;
@@ -253,8 +262,10 @@ static int gta01_gsm_resume(struct platform_device *pdev)
 	if (gta01_gsm.con && s3c2410_gpio_getpin(GTA01_GPIO_MODEM_ON))
 		console_stop(gta01_gsm.con);
 
+#ifdef CONFIG_MACH_NEO1973_GTA02
 	if (machine_is_neo1973_gta02())
 		s3c2410_gpio_setpin(GTA02_GPIO_nDL_GSM, gta01_gsm.gpio_ndl_gsm);
+#endif
 
 	return 0;
 }
@@ -329,8 +340,10 @@ static int __init gta01_gsm_probe(struct platform_device *pdev)
 
 	/* note that download initially disabled, and enforce that */
 	gta01_gsm.gpio_ndl_gsm = 1;
+#ifdef CONFIG_MACH_NEO1973_GTA02
 	if (machine_is_neo1973_gta02())
 		s3c2410_gpio_setpin(GTA02_GPIO_nDL_GSM, 1);
+#endif
 
 	init_resume_dependency_list(&resume_dep_gsm_uart);
 
-- 
1.5.6.5




More information about the openmoko-kernel mailing list