summaryrefslogtreecommitdiff
path: root/packages/linux/linux-ezx/led_ezx-r0.patch
blob: 6fc2031d86e8c22cf17852a2115c26698be7a5b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174

#
# Patch managed by http://www.holgerschurig.de/patcher.html
#

--- linux-2.6.16/arch/arm/mach-pxa/ezx.c~led_ezx-r0.patch
+++ linux-2.6.16/arch/arm/mach-pxa/ezx.c
@@ -357,6 +357,15 @@
 	.num_resources	= ARRAY_SIZE(ezx_backlight_resources),
 };
 
+/*
+ * EZX LEDs
+ */
+static struct platform_device ezxled_device = {
+	.name		= "ezx-led",
+	.id		= -1,
+};
+
+
 /* keyboard */
 
 #if defined(CONFIG_PXA_EZX_V700)
@@ -770,6 +779,7 @@
 
 static struct platform_device *devices[] __initdata = {
 	&ezx_bp_device,
+	&ezxled_device,
 };
 
 static void __init
--- linux-2.6.16/drivers/leds/Kconfig~led_ezx-r0.patch
+++ linux-2.6.16/drivers/leds/Kconfig
@@ -59,6 +59,13 @@
 	  This option enables support for the LEDs on Sharp Zaurus
 	  SL-6000 series.
 
+config LEDS_EZX
+	tristate "LED Support for the Motorola EZX Platform"
+	depends LEDS_CLASS && PXA_EZX && PXA_EZX_E680
+	help
+	  This options enables support for the LEDs on Motorola EZX
+	  A780 and E680(i) GSM Phones.
+
 config LEDS_TRIGGER_TIMER
 	tristate "LED Timer Trigger"
 	depends LEDS_TRIGGERS
--- linux-2.6.16/drivers/leds/Makefile~led_ezx-r0.patch
+++ linux-2.6.16/drivers/leds/Makefile
@@ -10,7 +10,8 @@
 obj-$(CONFIG_LEDS_SPITZ)		+= leds-spitz.o
 obj-$(CONFIG_LEDS_IXP4XX)		+= leds-ixp4xx-gpio.o
 obj-$(CONFIG_LEDS_TOSA)			+= leds-tosa.o
+obj-$(CONFIG_LEDS_EZX)			+= leds-ezx.o
 
 # LED Triggers
 obj-$(CONFIG_LEDS_TRIGGER_TIMER)	+= ledtrig-timer.o
-obj-$(CONFIG_LEDS_TRIGGER_IDE_DISK)	+= ledtrig-ide-disk.o
\ Kein Zeilenumbruch am Dateiende.
+obj-$(CONFIG_LEDS_TRIGGER_IDE_DISK)	+= ledtrig-ide-disk.o
--- /dev/null
+++ linux-2.6.16/drivers/leds/leds-ezx.c
@@ -0,0 +1,111 @@
+/*
+ * EZX Platform LED Driver
+ *
+ * Copyright 2006 Vanille-Media
+ *
+ * Author: Michael Lauer <mickey@Vanille.de>
+ *
+ * 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/config.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/leds.h>
+//#include <asm/mach-types.h>
+//#include <asm/arch/hardware.h>
+//#include <asm/arch/pxa-regs.h>
+#include "../misc/ezx/ssp_pcap.h"
+
+static void ezxled_red_set(struct led_classdev *led_cdev, enum led_brightness value)
+{
+	printk( KERN_DEBUG "exzled_red_set: %d", value );
+}
+
+static void ezxled_green_set(struct led_classdev *led_cdev, enum led_brightness value)
+{
+	printk( KERN_DEBUG "exzled_green_set: %d", value );
+}
+
+static struct led_classdev ezx_red_led = {
+	.name			= "ezx:red",
+	.default_trigger	= "timer",
+	.brightness_set		= ezxled_red_set,
+};
+
+static struct led_classdev ezx_green_led = {
+	.name			= "ezx:green",
+	.default_trigger	= "timer",
+	.brightness_set		= ezxled_green_set,
+};
+
+#ifdef CONFIG_PM
+static int ezxled_suspend(struct platform_device *dev, pm_message_t state)
+{
+	led_classdev_suspend(&ezx_red_led);
+	led_classdev_suspend(&ezx_green_led);
+	return 0;
+}
+
+static int ezxled_resume(struct platform_device *dev)
+{
+	led_classdev_resume(&ezx_red_led);
+	led_classdev_resume(&ezx_green_led);
+	return 0;
+}
+#endif
+
+static int ezxled_probe(struct platform_device *pdev)
+{
+	int ret;
+
+	ret = led_classdev_register(&pdev->dev, &ezx_red_led);
+	if (ret < 0)
+		return ret;
+
+	ret = led_classdev_register(&pdev->dev, &ezx_green_led);
+	if (ret < 0)
+		led_classdev_unregister(&ezx_red_led);
+
+	return ret;
+}
+
+static int ezxled_remove(struct platform_device *pdev)
+{
+	led_classdev_unregister(&ezx_red_led);
+	led_classdev_unregister(&ezx_green_led);
+	return 0;
+}
+
+static struct platform_driver ezxled_driver = {
+	.probe		= ezxled_probe,
+	.remove		= ezxled_remove,
+#ifdef CONFIG_PM
+	.suspend	= ezxled_suspend,
+	.resume		= ezxled_resume,
+#endif
+	.driver		= {
+		.name		= "ezx-led",
+	},
+};
+
+static int __init ezxled_init(void)
+{
+	return platform_driver_register(&ezxled_driver);
+}
+
+static void __exit ezxled_exit(void)
+{
+ 	platform_driver_unregister(&ezxled_driver);
+}
+
+module_init(ezxled_init);
+module_exit(ezxled_exit);
+
+MODULE_AUTHOR("Michael Lauer <mickey@Vanille.de>");
+MODULE_DESCRIPTION("EZX LED driver");
+MODULE_LICENSE("GPL");