aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/leds/leds-fsg.c
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2009-01-08 12:55:03 -0500
committerRichard Purdie <rpurdie@linux.intel.com>2009-01-08 12:55:03 -0500
commit859cb7f2a4244ea6da206d3fe9cc8a6810947a68 (patch)
tree3389fe6c191418d6acc30d84e11a0760608f7431 /drivers/leds/leds-fsg.c
parent0081e8020ebd814a99e45720a10e869a54ee08a6 (diff)
leds: Add suspend/resume to the core class
Add suspend/resume to the core class and remove all the now unneeded code from various drivers. Originally the class code couldn't support suspend/resume but since class_device can there is no reason for each driver doing its own suspend/resume anymore.
Diffstat (limited to 'drivers/leds/leds-fsg.c')
-rw-r--r--drivers/leds/leds-fsg.c37
1 files changed, 6 insertions, 31 deletions
diff --git a/drivers/leds/leds-fsg.c b/drivers/leds/leds-fsg.c
index 34935155c1c0..5f7c9c5c09b1 100644
--- a/drivers/leds/leds-fsg.c
+++ b/drivers/leds/leds-fsg.c
@@ -99,64 +99,43 @@ static void fsg_led_ring_set(struct led_classdev *led_cdev,
99} 99}
100 100
101 101
102
103static struct led_classdev fsg_wlan_led = { 102static struct led_classdev fsg_wlan_led = {
104 .name = "fsg:blue:wlan", 103 .name = "fsg:blue:wlan",
105 .brightness_set = fsg_led_wlan_set, 104 .brightness_set = fsg_led_wlan_set,
105 .flags = LED_CORE_SUSPENDRESUME,
106}; 106};
107 107
108static struct led_classdev fsg_wan_led = { 108static struct led_classdev fsg_wan_led = {
109 .name = "fsg:blue:wan", 109 .name = "fsg:blue:wan",
110 .brightness_set = fsg_led_wan_set, 110 .brightness_set = fsg_led_wan_set,
111 .flags = LED_CORE_SUSPENDRESUME,
111}; 112};
112 113
113static struct led_classdev fsg_sata_led = { 114static struct led_classdev fsg_sata_led = {
114 .name = "fsg:blue:sata", 115 .name = "fsg:blue:sata",
115 .brightness_set = fsg_led_sata_set, 116 .brightness_set = fsg_led_sata_set,
117 .flags = LED_CORE_SUSPENDRESUME,
116}; 118};
117 119
118static struct led_classdev fsg_usb_led = { 120static struct led_classdev fsg_usb_led = {
119 .name = "fsg:blue:usb", 121 .name = "fsg:blue:usb",
120 .brightness_set = fsg_led_usb_set, 122 .brightness_set = fsg_led_usb_set,
123 .flags = LED_CORE_SUSPENDRESUME,
121}; 124};
122 125
123static struct led_classdev fsg_sync_led = { 126static struct led_classdev fsg_sync_led = {
124 .name = "fsg:blue:sync", 127 .name = "fsg:blue:sync",
125 .brightness_set = fsg_led_sync_set, 128 .brightness_set = fsg_led_sync_set,
129 .flags = LED_CORE_SUSPENDRESUME,
126}; 130};
127 131
128static struct led_classdev fsg_ring_led = { 132static struct led_classdev fsg_ring_led = {
129 .name = "fsg:blue:ring", 133 .name = "fsg:blue:ring",
130 .brightness_set = fsg_led_ring_set, 134 .brightness_set = fsg_led_ring_set,
135 .flags = LED_CORE_SUSPENDRESUME,
131}; 136};
132 137
133 138
134
135#ifdef CONFIG_PM
136static int fsg_led_suspend(struct platform_device *dev, pm_message_t state)
137{
138 led_classdev_suspend(&fsg_wlan_led);
139 led_classdev_suspend(&fsg_wan_led);
140 led_classdev_suspend(&fsg_sata_led);
141 led_classdev_suspend(&fsg_usb_led);
142 led_classdev_suspend(&fsg_sync_led);
143 led_classdev_suspend(&fsg_ring_led);
144 return 0;
145}
146
147static int fsg_led_resume(struct platform_device *dev)
148{
149 led_classdev_resume(&fsg_wlan_led);
150 led_classdev_resume(&fsg_wan_led);
151 led_classdev_resume(&fsg_sata_led);
152 led_classdev_resume(&fsg_usb_led);
153 led_classdev_resume(&fsg_sync_led);
154 led_classdev_resume(&fsg_ring_led);
155 return 0;
156}
157#endif
158
159
160static int fsg_led_probe(struct platform_device *pdev) 139static int fsg_led_probe(struct platform_device *pdev)
161{ 140{
162 int ret; 141 int ret;
@@ -232,10 +211,6 @@ static int fsg_led_remove(struct platform_device *pdev)
232static struct platform_driver fsg_led_driver = { 211static struct platform_driver fsg_led_driver = {
233 .probe = fsg_led_probe, 212 .probe = fsg_led_probe,
234 .remove = fsg_led_remove, 213 .remove = fsg_led_remove,
235#ifdef CONFIG_PM
236 .suspend = fsg_led_suspend,
237 .resume = fsg_led_resume,
238#endif
239 .driver = { 214 .driver = {
240 .name = "fsg-led", 215 .name = "fsg-led",
241 }, 216 },