Index: linux-2.6.24.2/drivers/leds/leds-a910.c =================================================================== --- linux-2.6.24.2.orig/drivers/leds/leds-a910.c +++ linux-2.6.24.2/drivers/leds/leds-a910.c @@ -26,22 +26,41 @@ ezx_pcap_bit_set(PCAP_BIT_AUXVREG_VAUX4_EN, value); } +static void a910vibrator_set(struct led_classdev *led_cdev, enum led_brightness value) +{ + if (value > 4) value = 4; + printk( KERN_DEBUG "a910vibrator_set: %d\n", value ); + ezx_pcap_vibrator_level(value-1); + if (value == 0) + ezx_pcap_bit_set(PCAP_BIT_AUXVREG_V_VIB_EN, 0); + else + ezx_pcap_bit_set(PCAP_BIT_AUXVREG_V_VIB_EN, 1); +} + static struct led_classdev a910_keypad_led = { .name = "a910:keypad", .default_trigger = "none", .brightness_set = a910led_keypad_set, }; +static struct led_classdev a910_vibrator = { + .name = "a910:vibrator", + .default_trigger = "none", + .brightness_set = a910vibrator_set, +}; + #ifdef CONFIG_PM static int a910led_suspend(struct platform_device *dev, pm_message_t state) { led_classdev_suspend(&a910_keypad_led); + led_classdev_suspend(&a910_vibrator); return 0; } static int a910led_resume(struct platform_device *dev) { led_classdev_resume(&a910_keypad_led); + led_classdev_resume(&a910_vibrator); return 0; } #endif @@ -54,12 +73,17 @@ if (ret < 0) return ret; + ret = led_classdev_register(&pdev->dev, &a910_vibrator); + if (ret < 0) + led_classdev_unregister(&a910_keypad_led); + return ret; } static int a910led_remove(struct platform_device *pdev) { led_classdev_unregister(&a910_keypad_led); + led_classdev_unregister(&a910_vibrator); return 0; } @@ -86,6 +110,7 @@ static void __exit a910led_exit(void) { a910led_keypad_set( &a910_keypad_led, 0 ); + a910vibrator_set( &a910_vibrator, 0 ); platform_driver_unregister(&a910led_driver); } Index: linux-2.6.24.2/drivers/leds/Kconfig =================================================================== --- linux-2.6.24.2.orig/drivers/leds/Kconfig +++ linux-2.6.24.2/drivers/leds/Kconfig @@ -138,11 +138,11 @@ Motorola E680(i) GSM Phone. config LEDS_A910 - tristate "LED Support for the Motorola A910 GSM Phone" + tristate "LED/Vibrator Support for the Motorola A910 GSM Phone" depends on LEDS_CLASS && PXA_EZX_A910 help - This option enables support for the LEDs on the - Motorola A910 GSM Phone. + This option enables support for the LEDs and the + vibrator on the Motorola A910 GSM Phone. config LEDS_TRIGGER_TIMER tristate "LED Timer Trigger"