3 # Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
6 Index: linux-2.6.21/drivers/leds/Kconfig
7 ===================================================================
8 --- linux-2.6.21.orig/drivers/leds/Kconfig 2007-06-08 18:33:45.000000000 +0200
9 +++ linux-2.6.21/drivers/leds/Kconfig 2007-06-08 18:39:04.000000000 +0200
11 These triggers allow kernel events to drive the LEDs and can
12 be configured via sysfs. If unsure, say Y.
15 + tristate "LED Support for the Motorola A780 GSM Phone"
16 + depends LEDS_CLASS && PXA_EZX_A780
18 + This option enables support for the LEDs on the
19 + Motorola A780 GSM Phone.
21 config LEDS_TRIGGER_TIMER
22 tristate "LED Timer Trigger"
23 depends on LEDS_TRIGGERS
24 Index: linux-2.6.21/drivers/leds/Makefile
25 ===================================================================
26 --- linux-2.6.21.orig/drivers/leds/Makefile 2007-06-08 18:33:45.000000000 +0200
27 +++ linux-2.6.21/drivers/leds/Makefile 2007-06-08 18:39:04.000000000 +0200
29 obj-$(CONFIG_LEDS_WRAP) += leds-wrap.o
30 obj-$(CONFIG_LEDS_H1940) += leds-h1940.o
31 obj-$(CONFIG_LEDS_COBALT) += leds-cobalt.o
32 +obj-$(CONFIG_LEDS_A780) += leds-a780.o
35 obj-$(CONFIG_LEDS_TRIGGER_TIMER) += ledtrig-timer.o
36 Index: linux-2.6.21/drivers/leds/leds-a780.c
37 ===================================================================
38 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
39 +++ linux-2.6.21/drivers/leds/leds-a780.c 2007-06-08 18:39:04.000000000 +0200
42 + * EZX Platform LED Driver for the Motorola A780 GSM Phone
44 + * Copyright 2006 Vanille-Media
46 + * Author: Michael Lauer <mickey@Vanille.de>
48 + * Based on keylight.c by Motorola and leds-corgi.c by Richard Purdie
50 + * This program is free software; you can redistribute it and/or modify
51 + * it under the terms of the GNU General Public License version 2 as
52 + * published by the Free Software Foundation.
56 +#include <linux/kernel.h>
57 +#include <linux/platform_device.h>
58 +#include <linux/leds.h>
59 +#include <asm/arch/ezx-pcap.h>
61 +static void a780led_main_set(struct led_classdev *led_cdev, enum led_brightness value)
63 + if ( value > 31 ) value = 31;
64 + printk( KERN_DEBUG "a780led_main_set: %d\n", value );
65 + ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_PERIPH_BL_CTRL0, value & 0x01);
66 + ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_PERIPH_BL_CTRL1, value & 0x02);
67 + ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_PERIPH_BL_CTRL2, value & 0x04);
68 + ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_PERIPH_BL_CTRL3, value & 0x08);
69 + ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_PERIPH_BL_CTRL4, value & 0x10);
72 +static void a780led_aux_set(struct led_classdev *led_cdev, enum led_brightness value)
74 + if ( value > 31 ) value = 31;
75 + printk( KERN_DEBUG "a780led_aux_set: %d\n", value );
76 + ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_PERIPH_BL2_CTRL0, value & 0x01);
77 + ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_PERIPH_BL2_CTRL1, value & 0x02);
78 + ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_PERIPH_BL2_CTRL2, value & 0x04);
79 + ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_PERIPH_BL2_CTRL3, value & 0x08);
80 + ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_PERIPH_BL2_CTRL4, value & 0x10);
83 +static struct led_classdev a780_main_led = {
84 + .name = "a780:main",
85 + .default_trigger = "none",
86 + .brightness_set = a780led_main_set,
89 +static struct led_classdev a780_aux_led = {
91 + .default_trigger = "none",
92 + .brightness_set = a780led_aux_set,
96 +static int a780led_suspend(struct platform_device *dev, pm_message_t state)
98 + led_classdev_suspend(&a780_main_led);
99 + led_classdev_suspend(&a780_aux_led);
103 +static int a780led_resume(struct platform_device *dev)
105 + led_classdev_resume(&a780_main_led);
106 + led_classdev_resume(&a780_aux_led);
111 +static int a780led_probe(struct platform_device *pdev)
115 + ret = led_classdev_register(&pdev->dev, &a780_main_led);
119 + ret = led_classdev_register(&pdev->dev, &a780_aux_led);
121 + led_classdev_unregister(&a780_main_led);
126 +static int a780led_remove(struct platform_device *pdev)
128 + led_classdev_unregister(&a780_main_led);
129 + led_classdev_unregister(&a780_aux_led);
133 +static struct platform_driver a780led_driver = {
134 + .probe = a780led_probe,
135 + .remove = a780led_remove,
137 + .suspend = a780led_suspend,
138 + .resume = a780led_resume,
141 + .name = "a780-led",
145 +static int __init a780led_init(void)
147 + return platform_driver_register(&a780led_driver);
150 +static void __exit a780led_exit(void)
152 + a780led_main_set( &a780_main_led, 0 );
153 + a780led_aux_set( &a780_aux_led, 0 );
154 + platform_driver_unregister(&a780led_driver);
157 +module_init(a780led_init);
158 +module_exit(a780led_exit);
160 +MODULE_AUTHOR("Michael Lauer <mickey@Vanille.de>");
161 +MODULE_DESCRIPTION("Motorola A780 LED driver");
162 +MODULE_LICENSE("GPL");
163 Index: linux-2.6.21/arch/arm/mach-pxa/ezx-a780.c
164 ===================================================================
165 --- linux-2.6.21.orig/arch/arm/mach-pxa/ezx-a780.c 2007-06-08 18:38:50.000000000 +0200
166 +++ linux-2.6.21/arch/arm/mach-pxa/ezx-a780.c 2007-06-08 18:39:04.000000000 +0200
167 @@ -236,10 +236,15 @@
171 +static struct platform_device a780led_device = {
172 + .name = "a780-led",
176 static struct platform_device *devices[] __initdata = {
182 static void __init a780_init(void)