diff options
| author | Koen Kooi <koen@openembedded.org> | 2007-05-19 09:38:22 +0000 |
|---|---|---|
| committer | Koen Kooi <koen@openembedded.org> | 2007-05-19 09:38:22 +0000 |
| commit | c50fe0c5f0eb2e243a4921e8576ba49db26483fc (patch) | |
| tree | 45fbe157b566abc7dc092d7d1b5d34d0cdfec4ba /packages/linux | |
| parent | a338dfb607b7a17292b6ec719c2db6528e6a87ad (diff) | |
linux-ezx 2.6.21: update to r2011:
r2011: call send_readurb on bp_rdy signal from BP to keep BP communication active
add asoc pxa2xx-ssp.c driver from asoc-v0.13rc3
r2010: * pxa-kbd.patch: Fix pxakbd bug: direct keys were not passed to userspace
* a780-kbd.patch: Cleanup keycodes definition for a780, use unique keycodes so
to avoid the double event problem occurring when the same keycode is used more
than once.
r2003: core: EZX subsystem
ezx-phone.c file for each phone
BP handshake code on a platform_driver (and another .patch)
pm: fully functional suspend/resume (except for BP)
reboot/poweroff
new: a780 flip
e680 lock switch
bp: Kconfig entry to disable BP handshake (the watchdog dont start if we dont try to handshake)
other: delete obsolete files
r2002: * Implement vibrator handling for a780 using the leds class.
r1999: * Port and readapt ezx-backlight patch. Let's use again the backlight class
to handle lcd brightness.
r1998: * Port leds patches for A780 and E680 (we still pollute ezx.c for now)
Diffstat (limited to 'packages/linux')
22 files changed, 4382 insertions, 633 deletions
diff --git a/packages/linux/linux-ezx-2.6.21/a780-flip.patch b/packages/linux/linux-ezx-2.6.21/a780-flip.patch new file mode 100644 index 0000000000..56f1e4336d --- /dev/null +++ b/packages/linux/linux-ezx-2.6.21/a780-flip.patch @@ -0,0 +1,43 @@ +Index: linux-2.6.21/arch/arm/mach-pxa/ezx-a780.c +=================================================================== +--- linux-2.6.21.orig/arch/arm/mach-pxa/ezx-a780.c 2007-05-08 13:23:57.000000000 -0300 ++++ linux-2.6.21/arch/arm/mach-pxa/ezx-a780.c 2007-05-08 13:26:53.000000000 -0300 +@@ -17,6 +17,7 @@ + #include <linux/mmc/host.h> + #include <linux/irq.h> + #include <linux/input.h> ++#include <linux/gpio_keys.h> + + #include <asm/mach-types.h> + #include <asm/mach/arch.h> +@@ -193,7 +194,30 @@ + }, + }; + ++static struct gpio_keys_button a780flip_buttons[] = { ++ [0] = { ++ .keycode = KEY_SLEEP, ++ .gpio = GPIO_FLIP_PIN, ++ .desc = "A780 flip", ++ }, ++}; ++ ++static struct gpio_keys_platform_data a780flip_platform_data = { ++ .buttons = a780flip_buttons, ++ .nbuttons = 1, ++}; ++ ++static struct platform_device a780flip_device = { ++ .name = "gpio-keys", ++ .id = -1, ++ .dev = { ++ .platform_data = &a780flip_platform_data, ++ }, ++}; ++ ++ + static struct platform_device *devices[] __initdata = { ++ &a780flip_device, + }; + + static void __init a780_init(void) diff --git a/packages/linux/linux-ezx-2.6.21/a780-kbd.patch b/packages/linux/linux-ezx-2.6.21/a780-kbd.patch new file mode 100644 index 0000000000..383839d639 --- /dev/null +++ b/packages/linux/linux-ezx-2.6.21/a780-kbd.patch @@ -0,0 +1,90 @@ +Index: linux-2.6.21/arch/arm/mach-pxa/ezx-a780.c +=================================================================== +--- linux-2.6.21.orig/arch/arm/mach-pxa/ezx-a780.c 2007-05-17 22:04:57.000000000 +0200 ++++ linux-2.6.21/arch/arm/mach-pxa/ezx-a780.c 2007-05-17 22:05:05.000000000 +0200 +@@ -16,18 +16,21 @@ + #include <linux/fb.h> + #include <linux/mmc/host.h> + #include <linux/irq.h> ++#include <linux/input.h> + + #include <asm/mach-types.h> + #include <asm/mach/arch.h> + #include <asm/arch/pxa-regs.h> + #include <asm/arch/pxafb.h> + #include <asm/arch/mmc.h> ++#include <asm/arch/kbd.h> + + #include "generic.h" + #include "ezx.h" + + extern void ezx_lcd_power(int, struct fb_var_screeninfo *); + extern void ezx_backlight_power(int); ++extern void __init pxa_set_kbd_info(struct pxakbd_platform_data *); + + #ifdef CONFIG_EZX_PCAP + extern int ezx_pcap_mmcsd_power(int); +@@ -141,6 +144,55 @@ + .pxafb_lcd_power = &ezx_lcd_power, + }; + ++static unsigned char a780_keycode[] = { ++ /* row 0 */ ++ KEY_PHONE, KEY_MENU, KEY_CANCEL, KEY_PAGEUP, KEY_UP, ++ /* row 1 */ ++ KEY_KP1, KEY_KP2, KEY_KP3, KEY_ENTER, KEY_KPENTER, /*center joypad */ ++ /* row 2 */ ++ KEY_KP4, KEY_KP5, KEY_KP6, KEY_RECORD, KEY_LEFT, ++ /* row 3 */ ++ KEY_KP7, KEY_KP8, KEY_KP9, KEY_HOME, KEY_RIGHT, ++ /* row 4 */ ++ KEY_KPASTERISK, KEY_KP0, KEY_KPDOT, KEY_PAGEDOWN, KEY_DOWN, ++}; ++ ++static unsigned char a780_direct_keycode[] = { ++ KEY_CAMERA, ++}; ++ ++static int a780_kbd_init(void) ++{ ++ pxa_gpio_mode(93 | GPIO_ALT_FN_1_IN); /* KP_DKIN<0>, voice_rec */ ++ pxa_gpio_mode(97 | GPIO_ALT_FN_3_IN); /* KP_MKIN<3> */ ++ pxa_gpio_mode(98 | GPIO_ALT_FN_3_IN); /* KP_MKIN<4> */ ++ pxa_gpio_mode(100 | GPIO_ALT_FN_1_IN); /* KP_MKIN<0> */ ++ pxa_gpio_mode(101 | GPIO_ALT_FN_1_IN); /* KP_MKIN<1> */ ++ pxa_gpio_mode(102 | GPIO_ALT_FN_1_IN); /* KP_MKIN<2> */ ++ pxa_gpio_mode(103 | GPIO_ALT_FN_2_OUT); /* KP_MKOUT<0> */ ++ pxa_gpio_mode(104 | GPIO_ALT_FN_2_OUT); /* KP_MKOUT<1> */ ++ pxa_gpio_mode(105 | GPIO_ALT_FN_2_OUT); /* KP_MKOUT<2> */ ++ pxa_gpio_mode(106 | GPIO_ALT_FN_2_OUT); /* KP_MKOUT<3> */ ++ pxa_gpio_mode(107 | GPIO_ALT_FN_2_OUT); /* KP_MKOUT<4> */ ++ PKWR = 0xec400; ++ PGSR3 |= 0xf80; ++ return 0; ++} ++ ++static struct pxakbd_platform_data a780_kbd_platform_data = { ++ .init = &a780_kbd_init, ++ .scan_interval = HZ/40, ++ .matrix = { ++ .keycode = a780_keycode, ++ .cols = 5, ++ .rows = 5, ++ }, ++ .direct = { ++ .keycode = a780_direct_keycode, ++ .num = 1, ++ }, ++}; ++ + static struct platform_device *devices[] __initdata = { + }; + +@@ -159,6 +211,7 @@ + + set_pxa_fb_info(&a780_fb_info); + pxa_set_mci_info(&a780_mci_platform_data); ++ pxa_set_kbd_info(&a780_kbd_platform_data); + + platform_add_devices(devices, ARRAY_SIZE(devices)); + } diff --git a/packages/linux/linux-ezx-2.6.21/a780-leds.patch b/packages/linux/linux-ezx-2.6.21/a780-leds.patch new file mode 100644 index 0000000000..09913df2ca --- /dev/null +++ b/packages/linux/linux-ezx-2.6.21/a780-leds.patch @@ -0,0 +1,181 @@ + +# +# Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher +# + +Index: linux-2.6.21/drivers/leds/Kconfig +=================================================================== +--- linux-2.6.21.orig/drivers/leds/Kconfig 2007-05-08 04:09:08.000000000 -0300 ++++ linux-2.6.21/drivers/leds/Kconfig 2007-05-08 14:09:03.000000000 -0300 +@@ -104,6 +104,13 @@ + These triggers allow kernel events to drive the LEDs and can + be configured via sysfs. If unsure, say Y. + ++config LEDS_A780 ++ tristate "LED 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. ++ + config LEDS_TRIGGER_TIMER + tristate "LED Timer Trigger" + depends on LEDS_TRIGGERS +Index: linux-2.6.21/drivers/leds/Makefile +=================================================================== +--- linux-2.6.21.orig/drivers/leds/Makefile 2007-05-08 04:09:08.000000000 -0300 ++++ linux-2.6.21/drivers/leds/Makefile 2007-05-08 14:09:03.000000000 -0300 +@@ -16,6 +16,7 @@ + obj-$(CONFIG_LEDS_WRAP) += leds-wrap.o + obj-$(CONFIG_LEDS_H1940) += leds-h1940.o + obj-$(CONFIG_LEDS_COBALT) += leds-cobalt.o ++obj-$(CONFIG_LEDS_A780) += leds-a780.o + + # LED Triggers + obj-$(CONFIG_LEDS_TRIGGER_TIMER) += ledtrig-timer.o +Index: linux-2.6.21/drivers/leds/leds-a780.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-2.6.21/drivers/leds/leds-a780.c 2007-05-08 14:09:03.000000000 -0300 +@@ -0,0 +1,122 @@ ++/* ++ * EZX Platform LED Driver for the Motorola A780 GSM Phone ++ * ++ * Copyright 2006 Vanille-Media ++ * ++ * Author: Michael Lauer <mickey@Vanille.de> ++ * ++ * Based on keylight.c by Motorola and leds-corgi.c by Richard Purdie ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ * ++ */ ++ ++#include <linux/kernel.h> ++#include <linux/platform_device.h> ++#include <linux/leds.h> ++#include <asm/arch/ezx-pcap.h> ++ ++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 ); ++ 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); ++ ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_PERIPH_BL_CTRL3, value & 0x08); ++ ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_PERIPH_BL_CTRL4, value & 0x10); ++} ++ ++static void a780led_aux_set(struct led_classdev *led_cdev, enum led_brightness value) ++{ ++ if ( value > 31 ) value = 31; ++ printk( KERN_DEBUG "a780led_aux_set: %d\n", value ); ++ 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); ++ ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_PERIPH_BL2_CTRL3, value & 0x08); ++ ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_PERIPH_BL2_CTRL4, value & 0x10); ++} ++ ++static struct led_classdev a780_main_led = { ++ .name = "a780:main", ++ .default_trigger = "none", ++ .brightness_set = a780led_main_set, ++}; ++ ++static struct led_classdev a780_aux_led = { ++ .name = "a780:aux", ++ .default_trigger = "none", ++ .brightness_set = a780led_aux_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); ++ return 0; ++} ++ ++static int a780led_resume(struct platform_device *dev) ++{ ++ led_classdev_resume(&a780_main_led); ++ led_classdev_resume(&a780_aux_led); ++ return 0; ++} ++#endif ++ ++static int a780led_probe(struct platform_device *pdev) ++{ ++ int ret; ++ ++ ret = led_classdev_register(&pdev->dev, &a780_main_led); ++ if (ret < 0) ++ return ret; ++ ++ ret = led_classdev_register(&pdev->dev, &a780_aux_led); ++ if (ret < 0) ++ led_classdev_unregister(&a780_main_led); ++ ++ return ret; ++} ++ ++static int a780led_remove(struct platform_device *pdev) ++{ ++ led_classdev_unregister(&a780_main_led); ++ led_classdev_unregister(&a780_aux_led); ++ return 0; ++} ++ ++static struct platform_driver a780led_driver = { ++ .probe = a780led_probe, ++ .remove = a780led_remove, ++#ifdef CONFIG_PM ++ .suspend = a780led_suspend, ++ .resume = a780led_resume, ++#endif ++ .driver = { ++ .name = "a780-led", ++ }, ++}; ++ ++static int __init a780led_init(void) ++{ ++ return platform_driver_register(&a780led_driver); ++} ++ ++static void __exit a780led_exit(void) ++{ ++ a780led_main_set( &a780_main_led, 0 ); ++ a780led_aux_set( &a780_aux_led, 0 ); ++ platform_driver_unregister(&a780led_driver); ++} ++ ++module_init(a780led_init); ++module_exit(a780led_exit); ++ ++MODULE_AUTHOR("Michael Lauer <mickey@Vanille.de>"); ++MODULE_DESCRIPTION("Motorola A780 LED driver"); ++MODULE_LICENSE("GPL"); +Index: linux-2.6.21/arch/arm/mach-pxa/ezx-a780.c +=================================================================== +--- linux-2.6.21.orig/arch/arm/mach-pxa/ezx-a780.c 2007-05-08 14:09:13.000000000 -0300 ++++ linux-2.6.21/arch/arm/mach-pxa/ezx-a780.c 2007-05-08 14:11:37.000000000 -0300 +@@ -215,9 +215,14 @@ + }, + }; + ++static struct platform_device a780led_device = { ++ .name = "a780-led", ++ .id = -1, ++}; + + static struct platform_device *devices[] __initdata = { + &a780flip_device, ++ &a780led_device, + }; + + static void __init a780_init(void) diff --git a/packages/linux/linux-ezx-2.6.21/a780-mci.patch b/packages/linux/linux-ezx-2.6.21/a780-mci.patch new file mode 100644 index 0000000000..b9d601856a --- /dev/null +++ b/packages/linux/linux-ezx-2.6.21/a780-mci.patch @@ -0,0 +1,123 @@ +Index: linux-2.6.21/arch/arm/mach-pxa/ezx-a780.c +=================================================================== +--- linux-2.6.21.orig/arch/arm/mach-pxa/ezx-a780.c 2007-05-08 03:46:17.000000000 -0300 ++++ linux-2.6.21/arch/arm/mach-pxa/ezx-a780.c 2007-05-08 04:05:48.000000000 -0300 +@@ -14,11 +14,14 @@ + #include <linux/init.h> + #include <linux/platform_device.h> + #include <linux/fb.h> ++#include <linux/mmc/host.h> ++#include <linux/irq.h> + + #include <asm/mach-types.h> + #include <asm/mach/arch.h> + #include <asm/arch/pxa-regs.h> + #include <asm/arch/pxafb.h> ++#include <asm/arch/mmc.h> + + #include "generic.h" + #include "ezx.h" +@@ -26,6 +29,95 @@ + extern void ezx_lcd_power(int, struct fb_var_screeninfo *); + extern void ezx_backlight_power(int); + ++#ifdef CONFIG_EZX_PCAP ++extern int ezx_pcap_mmcsd_power(int); ++extern void ezx_pcap_mmcsd_voltage(u_int32_t); ++#else ++#define ezx_pcap_mmcsd_voltage(x) {} ++#define ezx_pcap_mmcsd_power(x) {} ++#endif ++ ++static struct pxamci_platform_data a780_mci_platform_data; ++ ++static u_int8_t mmc_voltage[] = { ++ [MMC_VDD_160] = 5, ++ [MMC_VDD_170] = 5, ++ [MMC_VDD_180] = 6, ++ [MMC_VDD_190] = 6, ++ [MMC_VDD_200] = 7, ++ [MMC_VDD_210] = 7, ++ [MMC_VDD_220] = 8, ++ [MMC_VDD_230] = 8, ++ [MMC_VDD_240] = 9, ++ [MMC_VDD_250] = 9, ++ [MMC_VDD_260] = 10, ++ [MMC_VDD_270] = 10, ++ [MMC_VDD_280] = 11, ++ [MMC_VDD_290] = 11, ++ [MMC_VDD_300] = 12, ++ [MMC_VDD_310] = 12, ++ [MMC_VDD_320] = 13, ++ [MMC_VDD_330] = 13, ++ [MMC_VDD_340] = 14, ++ [MMC_VDD_350] = 14, ++ [MMC_VDD_360] = 15, ++}; ++ ++static int a780_mci_init(struct device *dev, ++ irqreturn_t (*ezx_detect_int)(int, void *), ++ void *data) ++{ ++ int err; ++ ++ /* Setup GPIO for PXA27x MMC/SD controller */ ++ pxa_gpio_mode(GPIO32_MMCCLK_MD); ++ pxa_gpio_mode(GPIO112_MMCCMD_MD); ++ pxa_gpio_mode(GPIO92_MMCDAT0_MD); ++ pxa_gpio_mode(GPIO109_MMCDAT1_MD); ++ pxa_gpio_mode(GPIO110_MMCDAT2_MD); ++ pxa_gpio_mode(GPIO111_MMCDAT3_MD); ++ ++ ezx_pcap_mmcsd_power(1); ++ ++ a780_mci_platform_data.detect_delay = msecs_to_jiffies(250); ++ ++ err = request_irq(0x49, ezx_detect_int, SA_INTERRUPT, ++ "MMC card detect", data); ++ if (err) { ++ printk(KERN_ERR "ezx_mci_detect: MMC/SD: can't request " ++ "MMC card detect IRQ\n"); ++ return -1; ++ } ++ ++ set_irq_type(0x0b, IRQT_BOTHEDGE); ++ ++ return 0; ++} ++ ++static void a780_mci_setpower(struct device *dev, unsigned int vdd) ++{ ++ if (vdd <= MMC_VDD_360) ++ ezx_pcap_mmcsd_voltage(mmc_voltage[vdd]); ++ ++ ezx_pcap_mmcsd_power(1); ++} ++ ++static void a780_mci_exit(struct device *dev, void *data) ++{ ++ ezx_pcap_mmcsd_power(0); ++ free_irq(0x49, data); ++} ++ ++static struct pxamci_platform_data a780_mci_platform_data = { ++ .ocr_mask = MMC_VDD_160_165|MMC_VDD_18_19|MMC_VDD_20_21 ++ |MMC_VDD_22_23|MMC_VDD_24_25|MMC_VDD_26_27 ++ |MMC_VDD_28_29|MMC_VDD_30_31|MMC_VDD_32_33 ++ |MMC_VDD_34_35|MMC_VDD_35_36, ++ .init = a780_mci_init, ++ .setpower = a780_mci_setpower, ++ .exit = a780_mci_exit, ++}; ++ + static struct pxafb_mode_info mode_a780 = { + .pixclock = 150000, + .xres = 240, +@@ -66,6 +158,7 @@ + PSLR = 0x05800f00; + + set_pxa_fb_info(&a780_fb_info); ++ pxa_set_mci_info(&a780_mci_platform_data); + + platform_add_devices(devices, ARRAY_SIZE(devices)); + } diff --git a/packages/linux/linux-ezx-2.6.21/a780-vibrator.patch b/packages/linux/linux-ezx-2.6.21/a780-vibrator.patch new file mode 100644 index 0000000000..7436c40f5f --- /dev/null +++ b/packages/linux/linux-ezx-2.6.21/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" diff --git a/packages/linux/linux-ezx-2.6.21/asoc-pxa-ssp.patch b/packages/linux/linux-ezx-2.6.21/asoc-pxa-ssp.patch new file mode 100644 index 0000000000..1fc8283ca2 --- /dev/null +++ b/packages/linux/linux-ezx-2.6.21/asoc-pxa-ssp.patch @@ -0,0 +1,755 @@ +Index: linux-2.6.21/sound/soc/pxa/pxa2xx-ssp.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-2.6.21/sound/soc/pxa/pxa2xx-ssp.c 2007-05-14 21:14:38.000000000 -0300 +@@ -0,0 +1,671 @@ ++/* ++ * pxa2xx-ssp.c -- ALSA Soc Audio Layer ++ * ++ * Copyright 2005 Wolfson Microelectronics PLC. ++ * Author: Liam Girdwood ++ * liam.girdwood@wolfsonmicro.com or linux@wolfsonmicro.com ++ * ++ * This program is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License as published by the ++ * Free Software Foundation; either version 2 of the License, or (at your ++ * option) any later version. ++ * ++ * Revision history ++ * 12th Aug 2005 Initial version. ++ * ++ * TODO: ++ * o The SSP driver _mostly_ works, however is in need of testing and ++ * someone with time to complete it. ++ * o Test network mode for > 16bit sample size ++ */ ++ ++#include <linux/init.h> ++#include <linux/module.h> ++#include <linux/platform_device.h> ++ ++#include <sound/driver.h> ++#include <sound/core.h> ++#include <sound/pcm.h> ++#include <sound/initval.h> ++#include <sound/pcm_params.h> ++#include <sound/soc.h> ++ ++#include <asm/hardware.h> ++#include <asm/arch/pxa-regs.h> ++#include <asm/arch/audio.h> ++#include <asm/arch/ssp.h> ++ ++#include "pxa2xx-pcm.h" ++#include "pxa2xx-ssp.h" ++ ++#define PXA_SSP_DEBUG 1 ++ ++/* ++ * The following should be defined in pxa-regs.h ++ */ ++#define SSCR0_ACS (1 << 30) /* Audio Clock Select */ ++#define SSACD_SCDB (1 << 3) /* SSPSYSCLK Divider Bypass (SSCR0[ACS] must be set) */ ++#define SSACD_ACPS(x) (x << 4) /* Audio clock PLL select */ ++#define SSACD_ACDS(x) (x << 0) /* Audio clock divider select */ ++ ++/* ++ * SSP audio private data ++ */ ++struct ssp_priv { ++ unsigned int sysclk; ++}; ++ ++static struct ssp_priv ssp_clk[3]; ++static struct ssp_dev ssp[3]; ++#ifdef CONFIG_PM ++static struct ssp_state ssp_state[3]; ++#endif ++ ++static struct pxa2xx_pcm_dma_params pxa2xx_ssp1_pcm_mono_out = { ++ .name = "SSP1 PCM Mono out", ++ .dev_addr = __PREG(SSDR_P1), ++ .drcmr = &DRCMRTXSSDR, ++ .dcmd = DCMD_INCSRCADDR | DCMD_FLOWTRG | ++ DCMD_BURST16 | DCMD_WIDTH2, ++}; ++ ++static struct pxa2xx_pcm_dma_params pxa2xx_ssp1_pcm_mono_in = { ++ .name = "SSP1 PCM Mono in", ++ .dev_addr = __PREG(SSDR_P1), ++ .drcmr = &DRCMRRXSSDR, ++ .dcmd = DCMD_INCTRGADDR | DCMD_FLOWSRC | ++ DCMD_BURST16 | DCMD_WIDTH2, ++}; ++ ++static struct pxa2xx_pcm_dma_params pxa2xx_ssp1_pcm_stereo_out = { ++ .name = "SSP1 PCM Stereo out", ++ .dev_addr = __PREG(SSDR_P1), ++ .drcmr = &DRCMRTXSSDR, ++ .dcmd = DCMD_INCSRCADDR | DCMD_FLOWTRG | ++ DCMD_BURST16 | DCMD_WIDTH4, ++}; ++ ++static struct pxa2xx_pcm_dma_params pxa2xx_ssp1_pcm_stereo_in = { ++ .name = "SSP1 PCM Stereo in", ++ .dev_addr = __PREG(SSDR_P1), ++ .drcmr = &DRCMRRXSSDR, ++ .dcmd = DCMD_INCTRGADDR | DCMD_FLOWSRC | ++ DCMD_BURST16 | DCMD_WIDTH4, ++}; ++ ++static struct pxa2xx_pcm_dma_params pxa2xx_ssp2_pcm_mono_out = { ++ .name = "SSP2 PCM Mono out", ++ .dev_addr = __PREG(SSDR_P2), ++ .drcmr = &DRCMRTXSS2DR, ++ .dcmd = DCMD_INCSRCADDR | DCMD_FLOWTRG | ++ DCMD_BURST16 | DCMD_WIDTH2, ++}; ++ ++static struct pxa2xx_pcm_dma_params pxa2xx_ssp2_pcm_mono_in = { ++ .name = "SSP2 PCM Mono in", ++ .dev_addr = __PREG(SSDR_P2), ++ .drcmr = &DRCMRRXSS2DR, ++ .dcmd = DCMD_INCTRGADDR | DCMD_FLOWSRC | ++ DCMD_BURST16 | DCMD_WIDTH2, ++}; ++ ++static struct pxa2xx_pcm_dma_params pxa2xx_ssp2_pcm_stereo_out = { ++ .name = "SSP2 PCM Stereo out", ++ .dev_addr = __PREG(SSDR_P2), ++ .drcmr = &DRCMRTXSS2DR, ++ .dcmd = DCMD_INCSRCADDR | DCMD_FLOWTRG | ++ DCMD_BURST16 | DCMD_WIDTH4, ++}; ++ ++static struct pxa2xx_pcm_dma_params pxa2xx_ssp2_pcm_stereo_in = { ++ .name = "SSP2 PCM Stereo in", ++ .dev_addr = __PREG(SSDR_P2), ++ .drcmr = &DRCMRRXSS2DR, ++ .dcmd = DCMD_INCTRGADDR | DCMD_FLOWSRC | ++ DCMD_BURST16 | DCMD_WIDTH4, ++}; ++ ++static struct pxa2xx_pcm_dma_params pxa2xx_ssp3_pcm_mono_out = { ++ .name = "SSP3 PCM Mono out", ++ .dev_addr = __PREG(SSDR_P3), ++ .drcmr = &DRCMRTXSS3DR, ++ .dcmd = DCMD_INCSRCADDR | DCMD_FLOWTRG | ++ DCMD_BURST16 | DCMD_WIDTH2, ++}; ++ ++static struct pxa2xx_pcm_dma_params pxa2xx_ssp3_pcm_mono_in = { ++ .name = "SSP3 PCM Mono in", ++ .dev_addr = __PREG(SSDR_P3), ++ .drcmr = &DRCMRRXSS3DR, ++ .dcmd = DCMD_INCTRGADDR | DCMD_FLOWSRC | ++ DCMD_BURST16 | DCMD_WIDTH2, ++}; ++ ++static struct pxa2xx_pcm_dma_params pxa2xx_ssp3_pcm_stereo_out = { ++ .name = "SSP3 PCM Stereo out", ++ .dev_addr = __PREG(SSDR_P3), ++ .drcmr = &DRCMRTXSS3DR, ++ .dcmd = DCMD_INCSRCADDR | DCMD_FLOWTRG | ++ DCMD_BURST16 | DCMD_WIDTH4, ++}; ++ ++static struct pxa2xx_pcm_dma_params pxa2xx_ssp3_pcm_stereo_in = { ++ .name = "SSP3 PCM Stereo in", ++ .dev_addr = __PREG(SSDR_P3), ++ .drcmr = &DRCMRRXSS3DR, ++ .dcmd = DCMD_INCTRGADDR | DCMD_FLOWSRC | ++ DCMD_BURST16 | DCMD_WIDTH4, ++}; ++ ++static struct pxa2xx_pcm_dma_params *ssp_dma_params[3][4] = { ++ {&pxa2xx_ssp1_pcm_mono_out, &pxa2xx_ssp1_pcm_mono_in, ++ &pxa2xx_ssp1_pcm_stereo_out,&pxa2xx_ssp1_pcm_stereo_in,}, ++ {&pxa2xx_ssp2_pcm_mono_out, &pxa2xx_ssp2_pcm_mono_in, ++ &pxa2xx_ssp2_pcm_stereo_out, &pxa2xx_ssp2_pcm_stereo_in,}, ++ {&pxa2xx_ssp3_pcm_mono_out, &pxa2xx_ssp3_pcm_mono_in, ++ &pxa2xx_ssp3_pcm_stereo_out,&pxa2xx_ssp3_pcm_stereo_in,}, ++}; ++ ++static int pxa2xx_ssp_startup(struct snd_pcm_substream *substream) ++{ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_cpu_dai *cpu_dai = rtd->dai->cpu_dai; ++ int ret = 0; ++ ++ if (!rtd->dai->cpu_dai->active) { ++ ret = ssp_init (&ssp[cpu_dai->id], cpu_dai->id + 1, ++ SSP_NO_IRQ); ++ if (ret < 0) ++ return ret; ++ ssp_disable(&ssp[cpu_dai->id]); ++ } ++ return ret; ++} ++ ++static void pxa2xx_ssp_shutdown(struct snd_pcm_substream *substream) ++{ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_cpu_dai *cpu_dai = rtd->dai->cpu_dai; ++ ++ if (!cpu_dai->active) { ++ ssp_disable(&ssp[cpu_dai->id]); ++ ssp_exit(&ssp[cpu_dai->id]); ++ } ++} ++ ++#if defined (CONFIG_PXA27x) ++static int cken[3] = {CKEN23_SSP1, CKEN3_SSP2, CKEN4_SSP3}; ++#else ++static int cken[3] = {CKEN3_SSP, CKEN9_NSSP, CKEN10_ASSP}; ++#endif ++ ++#ifdef CONFIG_PM ++ ++static int pxa2xx_ssp_suspend(struct platform_device *pdev, ++ struct snd_soc_cpu_dai *dai) ++{ ++ if (!dai->active) ++ return 0; ++ ++ ssp_save_state(&ssp[dai->id], &ssp_state[dai->id]); ++ pxa_set_cken(cken[dai->id], 0); ++ return 0; ++} ++ ++static int pxa2xx_ssp_resume(struct platform_device *pdev, ++ struct snd_soc_cpu_dai *dai) ++{ ++ if (!dai->active) ++ return 0; ++ ++ pxa_set_cken(cken[dai->id], 1); ++ ssp_restore_state(&ssp[dai->id], &ssp_state[dai->id]); ++ ssp_enable(&ssp[dai->id]); ++ |
