diff options
author | Antonio Ospite <ospite@studenti.unina.it> | 2007-06-22 07:11:50 +0000 |
---|---|---|
committer | Koen Kooi <koen@openembedded.org> | 2007-06-22 07:11:50 +0000 |
commit | 005b94b2d0208080b63ccd708fd354cf5717b84c (patch) | |
tree | 10c19cf8f411fc4554908c1cfae9d4b8e309c8a9 /packages/linux/linux-ezx-2.6.21/patches/a780-vibrator.patch | |
parent | 5d946375b12e7f15a42f47cdf922f170dce9c718 (diff) |
linux-ezx: remove old kernel, update 2.6.21 and add script to generate SRC_URI from the quilt series in svn
Diffstat (limited to 'packages/linux/linux-ezx-2.6.21/patches/a780-vibrator.patch')
-rwxr-xr-x | packages/linux/linux-ezx-2.6.21/patches/a780-vibrator.patch | 151 |
1 files changed, 151 insertions, 0 deletions
diff --git a/packages/linux/linux-ezx-2.6.21/patches/a780-vibrator.patch b/packages/linux/linux-ezx-2.6.21/patches/a780-vibrator.patch new file mode 100755 index 0000000000..7436c40f5f --- /dev/null +++ b/packages/linux/linux-ezx-2.6.21/patches/a780-vibrator.patch @@ -0,0 +1,151 @@ +Index: linux-2.6.21/drivers/leds/leds-a780.c +=================================================================== +--- linux-2.6.21.orig/drivers/leds/leds-a780.c 2007-05-08 15:09:26.000000000 -0300 ++++ linux-2.6.21/drivers/leds/leds-a780.c 2007-05-08 15:19:26.000000000 -0300 +@@ -18,10 +18,13 @@ + #include <linux/leds.h> + #include <asm/arch/ezx-pcap.h> + ++extern void ezx_pcap_vibrator_level(u_int32_t); ++ + static void a780led_main_set(struct led_classdev *led_cdev, enum led_brightness value) + { + if ( value > 31 ) value = 31; + printk( KERN_DEBUG "a780led_main_set: %d\n", value ); ++#warning FIXME: use read/write operations + ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_PERIPH_BL_CTRL0, value & 0x01); + ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_PERIPH_BL_CTRL1, value & 0x02); + ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_PERIPH_BL_CTRL2, value & 0x04); +@@ -33,6 +36,7 @@ + { + if ( value > 31 ) value = 31; + printk( KERN_DEBUG "a780led_aux_set: %d\n", value ); ++#warning FIXME: use read/write operations + ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_PERIPH_BL2_CTRL0, value & 0x01); + ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_PERIPH_BL2_CTRL1, value & 0x02); + ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_PERIPH_BL2_CTRL2, value & 0x04); +@@ -40,6 +44,43 @@ + ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_PERIPH_BL2_CTRL4, value & 0x10); + } + ++static void a780vibrator_set(struct led_classdev *led_cdev, enum led_brightness value) ++{ ++ if ( value > 4 ) value = 4; ++ printk( KERN_DEBUG "a780vibrator_set: %d\n", value ); ++ ++ switch(value) ++ { ++ case 0: ++ /* turn off vibrator */ ++ ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_AUX_VREG_V_VIB_EN, 0); ++ break; ++ ++ case 1: ++ ezx_pcap_vibrator_level(PCAP_VIBRATOR_VOLTAGE_LEVEL0); ++ ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_AUX_VREG_V_VIB_EN, 1); ++ break; ++ ++ case 2: ++ ezx_pcap_vibrator_level(PCAP_VIBRATOR_VOLTAGE_LEVEL1); ++ ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_AUX_VREG_V_VIB_EN, 1); ++ break; ++ ++ case 3: ++ ezx_pcap_vibrator_level(PCAP_VIBRATOR_VOLTAGE_LEVEL2); ++ ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_AUX_VREG_V_VIB_EN, 1); ++ break; ++ ++ case 4: ++ ezx_pcap_vibrator_level(PCAP_VIBRATOR_VOLTAGE_LEVEL3); ++ ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_AUX_VREG_V_VIB_EN, 1); ++ break; ++ ++ default: ++ break; ++ } ++} ++ + static struct led_classdev a780_main_led = { + .name = "a780:main", + .default_trigger = "none", +@@ -52,11 +93,18 @@ + .brightness_set = a780led_aux_set, + }; + ++static struct led_classdev a780_vibrator = { ++ .name = "a780:vibrator", ++ .default_trigger = "none", ++ .brightness_set = a780vibrator_set, ++}; ++ + #ifdef CONFIG_PM + static int a780led_suspend(struct platform_device *dev, pm_message_t state) + { + led_classdev_suspend(&a780_main_led); + led_classdev_suspend(&a780_aux_led); ++ led_classdev_suspend(&a780_vibrator); + return 0; + } + +@@ -64,6 +112,7 @@ + { + led_classdev_resume(&a780_main_led); + led_classdev_resume(&a780_aux_led); ++ led_classdev_resume(&a780_vibrator); + return 0; + } + #endif +@@ -77,8 +126,16 @@ + return ret; + + ret = led_classdev_register(&pdev->dev, &a780_aux_led); +- if (ret < 0) ++ if (ret < 0) { ++ led_classdev_unregister(&a780_main_led); ++ return ret; ++ } ++ ++ ret = led_classdev_register(&pdev->dev, &a780_vibrator); ++ if (ret < 0) { + led_classdev_unregister(&a780_main_led); ++ led_classdev_unregister(&a780_aux_led); ++ } + + return ret; + } +@@ -87,6 +144,7 @@ + { + led_classdev_unregister(&a780_main_led); + led_classdev_unregister(&a780_aux_led); ++ led_classdev_unregister(&a780_vibrator); + return 0; + } + +@@ -111,6 +169,8 @@ + { + a780led_main_set( &a780_main_led, 0 ); + a780led_aux_set( &a780_aux_led, 0 ); ++ a780vibrator_set( &a780_vibrator, 0 ); ++ + platform_driver_unregister(&a780led_driver); + } + +Index: linux-2.6.21/drivers/leds/Kconfig +=================================================================== +--- linux-2.6.21.orig/drivers/leds/Kconfig 2007-05-08 15:09:26.000000000 -0300 ++++ linux-2.6.21/drivers/leds/Kconfig 2007-05-08 15:09:26.000000000 -0300 +@@ -105,11 +105,11 @@ + be configured via sysfs. If unsure, say Y. + + config LEDS_A780 +- tristate "LED Support for the Motorola A780 GSM Phone" ++ tristate "LED/Vibrator Support for the Motorola A780 GSM Phone" + depends LEDS_CLASS && PXA_EZX_A780 + help +- This option enables support for the LEDs on the +- Motorola A780 GSM Phone. ++ This option enables support for the LEDs and the ++ vibrator on the Motorola A780 GSM Phone. + + config LEDS_E680 + tristate "LED Support for the Motorola E680(i) GSM Phone" |