[PATCH] [GTA02]: Require SC32440_C_FIQ for GTA02

andrzej zaborowski balrogg at gmail.com
Mon Oct 13 16:53:22 CEST 2008


Hi,
   I recently was changing something in the config and decided to
build without FIQ and had to make all the changes below to make
things build in that particular configuration,  I'm travelling a bit
this week and won't be able to rediff it if it's outdated but just
posting it to hint on what else needs fixing if we want to allow
building without SC32440_C_FIQ.

Cheers
---
 arch/arm/mach-s3c2440/Kconfig        |    2 +-
 arch/arm/mach-s3c2440/mach-gta02.c   |   13 ++++++++++++-
 drivers/leds/Kconfig                 |    2 +-
 drivers/leds/leds-neo1973-vibrator.c |    8 ++++----
 4 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-s3c2440/Kconfig b/arch/arm/mach-s3c2440/Kconfig
index 1d0ed98..628536f 100644
--- a/arch/arm/mach-s3c2440/Kconfig
+++ b/arch/arm/mach-s3c2440/Kconfig
@@ -86,7 +86,7 @@ config MACH_NEO1973_GTA02
 	select CPU_S3C2442
 	select SENSORS_PCF50633
 	select POWER_SUPPLY
-	select GTA02_HDQ
+	select GTA02_HDQ if S3C2440_C_FIQ
 	help
 	   Say Y here if you are using the FIC Neo1973 GSM Phone
 
diff --git a/arch/arm/mach-s3c2440/mach-gta02.c b/arch/arm/mach-s3c2440/mach-gta02.c
index 49d40cf..bfa7397 100644
--- a/arch/arm/mach-s3c2440/mach-gta02.c
+++ b/arch/arm/mach-s3c2440/mach-gta02.c
@@ -106,6 +106,7 @@ struct resume_dependency resume_dep_glamo_mci_pcf;
 static int gta02_charger_online_status;
 static int gta02_charger_active_status;
 
+#ifdef CONFIG_S3C2440_C_FIQ
 /* define FIQ IPC struct */
 /*
  * contains stuff FIQ ISR modifies and normal kernel code can see and use
@@ -338,6 +339,7 @@ FIQ_HANDLER_ENTRY(256, 512)
 	_fiq_timer_divisor = divisor;
 bail:
 FIQ_HANDLER_END()
+#endif
 
 
 /*
@@ -480,6 +482,7 @@ static int gta02_get_charger_active_status(void)
 }
 
 
+#ifdef CONFIG_GTA02_HDQ
 struct bq27000_platform_data bq27000_pdata = {
 	.name = "bat",
 	.rsense_mohms = 20,
@@ -496,7 +499,7 @@ struct platform_device bq27000_battery_device = {
 		.platform_data = &bq27000_pdata,
 	},
 };
-
+#endif
 
 /* PMU driver info */
 
@@ -529,7 +532,9 @@ static int pmu_callback(struct device *dev, unsigned int feature,
 		break;
 	}
 
+#ifdef CONFIG_GTA02_HDQ
 	bq27000_charging_state_change(&bq27000_battery_device);
+#endif
 	return 0;
 }
 
@@ -757,6 +762,7 @@ struct platform_device gta02_pmu_dev = {
 
 /* FIQ */
 
+#ifdef CONFIG_S3C2440_C_FIQ
 static struct resource sc32440_fiq_resources[] = {
 	[0] = {
 		.flags	= IORESOURCE_IRQ,
@@ -770,6 +776,7 @@ struct platform_device sc32440_fiq_device = {
 	.num_resources	= 1,
 	.resource	= sc32440_fiq_resources,
 };
+#endif
 
 #ifdef CONFIG_GTA02_HDQ
 /* HDQ */
@@ -866,7 +873,9 @@ static struct platform_device *gta02_devices[] __initdata = {
 	&s3c_device_nand,
 	&s3c_device_ts,
 	&gta02_nor_flash,
+#ifdef CONFIG_S3C2440_C_FIQ
 	&sc32440_fiq_device,
+#endif
 	&gta02_version_device,
 	&gta02_memconfig_device,
 	&gta02_resume_reason_device,
diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
index 78640dd..39fd370 100644
--- a/drivers/leds/Kconfig
+++ b/drivers/leds/Kconfig
@@ -165,7 +165,7 @@ config LEDS_PCA955X
 
 config LEDS_NEO1973_VIBRATOR
 	tristate "Vibrator Support for the FIC Neo1973 GSM phone"
-	depends on LEDS_CLASS && MACH_NEO1973
+	depends on LEDS_CLASS && (MACH_NEO1973_GTA01 || (MACH_NEO1973_GTA02 && S3C2440_C_FIQ))
 	help
 	  This option enables support for the vibrator on the FIC Neo1973.
 
diff --git a/drivers/leds/leds-neo1973-vibrator.c b/drivers/leds/leds-neo1973-vibrator.c
index 494fb83..a9888ce 100644
--- a/drivers/leds/leds-neo1973-vibrator.c
+++ b/drivers/leds/leds-neo1973-vibrator.c
@@ -45,7 +45,7 @@ static void neo1973_vib_vib_set(struct led_classdev *led_cdev,
 	struct neo1973_vib_priv *vp =
 		container_of(led_cdev, struct neo1973_vib_priv, cdev);
 
-#ifdef CONFIG_MACH_NEO1973_GTA02
+#if defined(CONFIG_MACH_NEO1973_GTA02) && defined(S3C2440_C_FIQ)
 	if (machine_is_neo1973_gta02()) { /* use FIQ to control GPIO */
 		fiq_ipc.vib_pwm = value; /* set it for FIQ */
 		fiq_kick(); /* start up FIQs if not already going */
@@ -135,7 +135,7 @@ static int __init neo1973_vib_probe(struct platform_device *pdev)
 	neo1973_vib_led.gpio = r->start;
 	platform_set_drvdata(pdev, &neo1973_vib_led);
 
-#ifdef CONFIG_MACH_NEO1973_GTA02
+#if defined(CONFIG_MACH_NEO1973_GTA02) && defined(S3C2440_C_FIQ)
 	if (machine_is_neo1973_gta02()) { /* use FIQ to control GPIO */
 		neo1973_gpb_setpin(neo1973_vib_led.gpio, 0); /* off */
 		s3c2410_gpio_cfgpin(neo1973_vib_led.gpio, S3C2410_GPIO_OUTPUT);
@@ -156,7 +156,7 @@ static int __init neo1973_vib_probe(struct platform_device *pdev)
 		s3c2410_gpio_cfgpin(neo1973_vib_led.gpio, S3C2410_GPB3_TOUT3);
 		neo1973_vib_led.has_pwm = 1;
 	}
-#ifdef CONFIG_MACH_NEO1973_GTA02
+#if defined(CONFIG_MACH_NEO1973_GTA02) && defined(S3C2440_C_FIQ)
 configured:
 #endif
 	spin_lock_init(&neo1973_vib_led.lock);
@@ -166,7 +166,7 @@ configured:
 
 static int neo1973_vib_remove(struct platform_device *pdev)
 {
-#ifdef CONFIG_MACH_NEO1973_GTA02
+#if defined(CONFIG_MACH_NEO1973_GTA02) && defined(S3C2440_C_FIQ)
 	if (machine_is_neo1973_gta02()) /* use FIQ to control GPIO */
 		fiq_ipc.vib_pwm = 0; /* off */
 	/* would only need kick if already off so no kick needed */
-- 
1.5.3.4




More information about the openmoko-kernel mailing list