summaryrefslogtreecommitdiff
path: root/packages/linux/linux-ezx-2.6.21/patches/a780-vibrator.patch
diff options
context:
space:
mode:
Diffstat (limited to 'packages/linux/linux-ezx-2.6.21/patches/a780-vibrator.patch')
-rwxr-xr-xpackages/linux/linux-ezx-2.6.21/patches/a780-vibrator.patch83
1 files changed, 17 insertions, 66 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
index 7436c40f5f..aa903feea7 100755
--- a/packages/linux/linux-ezx-2.6.21/patches/a780-vibrator.patch
+++ b/packages/linux/linux-ezx-2.6.21/patches/a780-vibrator.patch
@@ -1,74 +1,26 @@
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);
+--- linux-2.6.21.orig/drivers/leds/leds-a780.c 2007-09-01 00:15:03.000000000 -0300
++++ linux-2.6.21/drivers/leds/leds-a780.c 2007-09-01 00:23:39.000000000 -0300
+@@ -40,6 +40,17 @@
+ ezx_pcap_bit_set(PCAP_BIT_PERIPH_BL2_CTRL4, value & 0x10);
}
+static void a780vibrator_set(struct led_classdev *led_cdev, enum led_brightness value)
+{
-+ if ( value > 4 ) value = 4;
++ 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;
-+ }
++ 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 a780_main_led = {
.name = "a780:main",
.default_trigger = "none",
-@@ -52,11 +93,18 @@
+@@ -52,11 +63,18 @@
.brightness_set = a780led_aux_set,
};
@@ -87,7 +39,7 @@ Index: linux-2.6.21/drivers/leds/leds-a780.c
return 0;
}
-@@ -64,6 +112,7 @@
+@@ -64,6 +82,7 @@
{
led_classdev_resume(&a780_main_led);
led_classdev_resume(&a780_aux_led);
@@ -95,7 +47,7 @@ Index: linux-2.6.21/drivers/leds/leds-a780.c
return 0;
}
#endif
-@@ -77,8 +126,16 @@
+@@ -77,8 +96,16 @@
return ret;
ret = led_classdev_register(&pdev->dev, &a780_aux_led);
@@ -113,7 +65,7 @@ Index: linux-2.6.21/drivers/leds/leds-a780.c
return ret;
}
-@@ -87,6 +144,7 @@
+@@ -87,6 +114,7 @@
{
led_classdev_unregister(&a780_main_led);
led_classdev_unregister(&a780_aux_led);
@@ -121,19 +73,18 @@ Index: linux-2.6.21/drivers/leds/leds-a780.c
return 0;
}
-@@ -111,6 +169,8 @@
+@@ -111,6 +139,7 @@
{
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
+--- linux-2.6.21.orig/drivers/leds/Kconfig 2007-09-01 00:15:03.000000000 -0300
++++ linux-2.6.21/drivers/leds/Kconfig 2007-09-01 00:15:08.000000000 -0300
@@ -105,11 +105,11 @@
be configured via sysfs. If unsure, say Y.