[PATCH 09/14] Allow disabling of GTA02 vibrator

Sven Rebhan odinshorse at googlemail.com
Sun Feb 22 22:08:18 CET 2009


If the vibrator is disabled we don't need to register a platform device.

Signed-off-by: Sven Rebhan <odinshorse at googlemail.com>

diff --git a/arch/arm/mach-s3c2442/mach-gta02.c b/arch/arm/mach-s3c2442/mach-gta02.c
index 6f32ccf..91e752d 100644
--- a/arch/arm/mach-s3c2442/mach-gta02.c
+++ b/arch/arm/mach-s3c2442/mach-gta02.c
@@ -794,6 +794,8 @@ struct platform_device bq27000_battery_device = {
 };
 #endif
 
+
+#ifdef CONFIG_LEDS_NEO1973_VIBRATOR
 /* vibrator (child of FIQ) */
 
 static struct resource gta02_vibrator_resources[] = {
@@ -816,6 +818,7 @@ static struct platform_device gta02_vibrator_dev = {
 		.platform_data = &gta02_vib_pdata,
 		},
 };
+#endif
 
 /* NOR Flash */
 
@@ -1699,13 +1702,14 @@ static void __init gta02_machine_init(void)
 	pm_power_off = gta02_poweroff;
 
 	/* Register the HDQ and vibrator as children of pwm device */
-	gta02_vibrator_dev.dev.parent = &s3c24xx_pwm_device.dev; 
-	platform_device_register(&gta02_vibrator_dev);
 #ifdef CONFIG_HDQ_GPIO_BITBANG
 	gta02_hdq_device.dev.parent = &s3c24xx_pwm_device.dev;
 	platform_device_register(&gta02_hdq_device);
 #endif
-
+#ifdef CONFIG_LEDS_NEO1973_VIBRATOR
+	gta02_vibrator_dev.dev.parent = &s3c24xx_pwm_device.dev; 
+	platform_device_register(&gta02_vibrator_dev);
+#endif
 }
 
 void DEBUG_LED(int n)
-- 
1.6.0.6




More information about the openmoko-kernel mailing list