diff options
Diffstat (limited to 'drivers/leds')
-rw-r--r-- | drivers/leds/Kconfig | 7 | ||||
-rw-r--r-- | drivers/leds/Makefile | 1 | ||||
-rw-r--r-- | drivers/leds/led-class.c | 11 | ||||
-rw-r--r-- | drivers/leds/leds-tosa.c | 132 |
4 files changed, 3 insertions, 148 deletions
diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig index 91d36d07e6ae..eb97c4113d78 100644 --- a/drivers/leds/Kconfig +++ b/drivers/leds/Kconfig | |||
@@ -45,13 +45,6 @@ config LEDS_SPITZ | |||
45 | This option enables support for the LEDs on Sharp Zaurus | 45 | This option enables support for the LEDs on Sharp Zaurus |
46 | SL-Cxx00 series (C1000, C3000, C3100). | 46 | SL-Cxx00 series (C1000, C3000, C3100). |
47 | 47 | ||
48 | config LEDS_TOSA | ||
49 | tristate "LED Support for the Sharp SL-6000 series" | ||
50 | depends on LEDS_CLASS && PXA_SHARPSL | ||
51 | help | ||
52 | This option enables support for the LEDs on Sharp Zaurus | ||
53 | SL-6000 series. | ||
54 | |||
55 | config LEDS_S3C24XX | 48 | config LEDS_S3C24XX |
56 | tristate "LED Support for Samsung S3C24XX GPIO LEDs" | 49 | tristate "LED Support for Samsung S3C24XX GPIO LEDs" |
57 | depends on LEDS_CLASS && ARCH_S3C2410 | 50 | depends on LEDS_CLASS && ARCH_S3C2410 |
diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile index 84ced3b1a13d..e54f42da21a2 100644 --- a/drivers/leds/Makefile +++ b/drivers/leds/Makefile | |||
@@ -9,7 +9,6 @@ obj-$(CONFIG_LEDS_ATMEL_PWM) += leds-atmel-pwm.o | |||
9 | obj-$(CONFIG_LEDS_CORGI) += leds-corgi.o | 9 | obj-$(CONFIG_LEDS_CORGI) += leds-corgi.o |
10 | obj-$(CONFIG_LEDS_LOCOMO) += leds-locomo.o | 10 | obj-$(CONFIG_LEDS_LOCOMO) += leds-locomo.o |
11 | obj-$(CONFIG_LEDS_SPITZ) += leds-spitz.o | 11 | obj-$(CONFIG_LEDS_SPITZ) += leds-spitz.o |
12 | obj-$(CONFIG_LEDS_TOSA) += leds-tosa.o | ||
13 | obj-$(CONFIG_LEDS_S3C24XX) += leds-s3c24xx.o | 12 | obj-$(CONFIG_LEDS_S3C24XX) += leds-s3c24xx.o |
14 | obj-$(CONFIG_LEDS_AMS_DELTA) += leds-ams-delta.o | 13 | obj-$(CONFIG_LEDS_AMS_DELTA) += leds-ams-delta.o |
15 | obj-$(CONFIG_LEDS_NET48XX) += leds-net48xx.o | 14 | obj-$(CONFIG_LEDS_NET48XX) += leds-net48xx.o |
diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c index 4a938780dfc3..63aad90247c4 100644 --- a/drivers/leds/led-class.c +++ b/drivers/leds/led-class.c | |||
@@ -139,12 +139,10 @@ EXPORT_SYMBOL_GPL(led_classdev_register); | |||
139 | /** | 139 | /** |
140 | * __led_classdev_unregister - unregisters a object of led_properties class. | 140 | * __led_classdev_unregister - unregisters a object of led_properties class. |
141 | * @led_cdev: the led device to unregister | 141 | * @led_cdev: the led device to unregister |
142 | * @suspended: indicates whether system-wide suspend or resume is in progress | ||
143 | * | 142 | * |
144 | * Unregisters a previously registered via led_classdev_register object. | 143 | * Unregisters a previously registered via led_classdev_register object. |
145 | */ | 144 | */ |
146 | void __led_classdev_unregister(struct led_classdev *led_cdev, | 145 | void led_classdev_unregister(struct led_classdev *led_cdev) |
147 | bool suspended) | ||
148 | { | 146 | { |
149 | device_remove_file(led_cdev->dev, &dev_attr_brightness); | 147 | device_remove_file(led_cdev->dev, &dev_attr_brightness); |
150 | #ifdef CONFIG_LEDS_TRIGGERS | 148 | #ifdef CONFIG_LEDS_TRIGGERS |
@@ -155,16 +153,13 @@ void __led_classdev_unregister(struct led_classdev *led_cdev, | |||
155 | up_write(&led_cdev->trigger_lock); | 153 | up_write(&led_cdev->trigger_lock); |
156 | #endif | 154 | #endif |
157 | 155 | ||
158 | if (suspended) | 156 | device_unregister(led_cdev->dev); |
159 | device_pm_schedule_removal(led_cdev->dev); | ||
160 | else | ||
161 | device_unregister(led_cdev->dev); | ||
162 | 157 | ||
163 | down_write(&leds_list_lock); | 158 | down_write(&leds_list_lock); |
164 | list_del(&led_cdev->node); | 159 | list_del(&led_cdev->node); |
165 | up_write(&leds_list_lock); | 160 | up_write(&leds_list_lock); |
166 | } | 161 | } |
167 | EXPORT_SYMBOL_GPL(__led_classdev_unregister); | 162 | EXPORT_SYMBOL_GPL(led_classdev_unregister); |
168 | 163 | ||
169 | static int __init leds_init(void) | 164 | static int __init leds_init(void) |
170 | { | 165 | { |
diff --git a/drivers/leds/leds-tosa.c b/drivers/leds/leds-tosa.c deleted file mode 100644 index 7ebecc41a9be..000000000000 --- a/drivers/leds/leds-tosa.c +++ /dev/null | |||
@@ -1,132 +0,0 @@ | |||
1 | /* | ||
2 | * LED Triggers Core | ||
3 | * | ||
4 | * Copyright 2005 Dirk Opfer | ||
5 | * | ||
6 | * Author: Dirk Opfer <Dirk@Opfer-Online.de> | ||
7 | * based on spitz.c | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License version 2 as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | */ | ||
14 | |||
15 | #include <linux/kernel.h> | ||
16 | #include <linux/init.h> | ||
17 | #include <linux/platform_device.h> | ||
18 | #include <linux/leds.h> | ||
19 | #include <asm/hardware/scoop.h> | ||
20 | #include <asm/mach-types.h> | ||
21 | #include <asm/arch/hardware.h> | ||
22 | #include <asm/arch/pxa-regs.h> | ||
23 | #include <asm/arch/tosa.h> | ||
24 | |||
25 | static void tosaled_amber_set(struct led_classdev *led_cdev, | ||
26 | enum led_brightness value) | ||
27 | { | ||
28 | if (value) | ||
29 | set_scoop_gpio(&tosascoop_jc_device.dev, | ||
30 | TOSA_SCOOP_JC_CHRG_ERR_LED); | ||
31 | else | ||
32 | reset_scoop_gpio(&tosascoop_jc_device.dev, | ||
33 | TOSA_SCOOP_JC_CHRG_ERR_LED); | ||
34 | } | ||
35 | |||
36 | static void tosaled_green_set(struct led_classdev *led_cdev, | ||
37 | enum led_brightness value) | ||
38 | { | ||
39 | if (value) | ||
40 | set_scoop_gpio(&tosascoop_jc_device.dev, | ||
41 | TOSA_SCOOP_JC_NOTE_LED); | ||
42 | else | ||
43 | reset_scoop_gpio(&tosascoop_jc_device.dev, | ||
44 | TOSA_SCOOP_JC_NOTE_LED); | ||
45 | } | ||
46 | |||
47 | static struct led_classdev tosa_amber_led = { | ||
48 | .name = "tosa:amber:charge", | ||
49 | .default_trigger = "sharpsl-charge", | ||
50 | .brightness_set = tosaled_amber_set, | ||
51 | }; | ||
52 | |||
53 | static struct led_classdev tosa_green_led = { | ||
54 | .name = "tosa:green:mail", | ||
55 | .default_trigger = "nand-disk", | ||
56 | .brightness_set = tosaled_green_set, | ||
57 | }; | ||
58 | |||
59 | #ifdef CONFIG_PM | ||
60 | static int tosaled_suspend(struct platform_device *dev, pm_message_t state) | ||
61 | { | ||
62 | #ifdef CONFIG_LEDS_TRIGGERS | ||
63 | if (tosa_amber_led.trigger && strcmp(tosa_amber_led.trigger->name, | ||
64 | "sharpsl-charge")) | ||
65 | #endif | ||
66 | led_classdev_suspend(&tosa_amber_led); | ||
67 | led_classdev_suspend(&tosa_green_led); | ||
68 | return 0; | ||
69 | } | ||
70 | |||
71 | static int tosaled_resume(struct platform_device *dev) | ||
72 | { | ||
73 | led_classdev_resume(&tosa_amber_led); | ||
74 | led_classdev_resume(&tosa_green_led); | ||
75 | return 0; | ||
76 | } | ||
77 | #else | ||
78 | #define tosaled_suspend NULL | ||
79 | #define tosaled_resume NULL | ||
80 | #endif | ||
81 | |||
82 | static int tosaled_probe(struct platform_device *pdev) | ||
83 | { | ||
84 | int ret; | ||
85 | |||
86 | ret = led_classdev_register(&pdev->dev, &tosa_amber_led); | ||
87 | if (ret < 0) | ||
88 | return ret; | ||
89 | |||
90 | ret = led_classdev_register(&pdev->dev, &tosa_green_led); | ||
91 | if (ret < 0) | ||
92 | led_classdev_unregister(&tosa_amber_led); | ||
93 | |||
94 | return ret; | ||
95 | } | ||
96 | |||
97 | static int tosaled_remove(struct platform_device *pdev) | ||
98 | { | ||
99 | led_classdev_unregister(&tosa_amber_led); | ||
100 | led_classdev_unregister(&tosa_green_led); | ||
101 | |||
102 | return 0; | ||
103 | } | ||
104 | |||
105 | static struct platform_driver tosaled_driver = { | ||
106 | .probe = tosaled_probe, | ||
107 | .remove = tosaled_remove, | ||
108 | .suspend = tosaled_suspend, | ||
109 | .resume = tosaled_resume, | ||
110 | .driver = { | ||
111 | .name = "tosa-led", | ||
112 | .owner = THIS_MODULE, | ||
113 | }, | ||
114 | }; | ||
115 | |||
116 | static int __init tosaled_init(void) | ||
117 | { | ||
118 | return platform_driver_register(&tosaled_driver); | ||
119 | } | ||
120 | |||
121 | static void __exit tosaled_exit(void) | ||
122 | { | ||
123 | platform_driver_unregister(&tosaled_driver); | ||
124 | } | ||
125 | |||
126 | module_init(tosaled_init); | ||
127 | module_exit(tosaled_exit); | ||
128 | |||
129 | MODULE_AUTHOR("Dirk Opfer <Dirk@Opfer-Online.de>"); | ||
130 | MODULE_DESCRIPTION("Tosa LED driver"); | ||
131 | MODULE_LICENSE("GPL"); | ||
132 | MODULE_ALIAS("platform:tosa-led"); | ||