aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/leds/leds-wm8350.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-wm8350.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-wm8350.c')
-rw-r--r--drivers/leds/leds-wm8350.c24
1 files changed, 1 insertions, 23 deletions
diff --git a/drivers/leds/leds-wm8350.c b/drivers/leds/leds-wm8350.c
index 846ed978103f..38c6bcb07e6c 100644
--- a/drivers/leds/leds-wm8350.c
+++ b/drivers/leds/leds-wm8350.c
@@ -184,27 +184,6 @@ static void wm8350_led_set(struct led_classdev *led_cdev,
184 spin_unlock_irqrestore(&led->value_lock, flags); 184 spin_unlock_irqrestore(&led->value_lock, flags);
185} 185}
186 186
187#ifdef CONFIG_PM
188static int wm8350_led_suspend(struct platform_device *pdev, pm_message_t state)
189{
190 struct wm8350_led *led = platform_get_drvdata(pdev);
191
192 led_classdev_suspend(&led->cdev);
193 return 0;
194}
195
196static int wm8350_led_resume(struct platform_device *pdev)
197{
198 struct wm8350_led *led = platform_get_drvdata(pdev);
199
200 led_classdev_resume(&led->cdev);
201 return 0;
202}
203#else
204#define wm8350_led_suspend NULL
205#define wm8350_led_resume NULL
206#endif
207
208static void wm8350_led_shutdown(struct platform_device *pdev) 187static void wm8350_led_shutdown(struct platform_device *pdev)
209{ 188{
210 struct wm8350_led *led = platform_get_drvdata(pdev); 189 struct wm8350_led *led = platform_get_drvdata(pdev);
@@ -255,6 +234,7 @@ static int wm8350_led_probe(struct platform_device *pdev)
255 led->cdev.brightness_set = wm8350_led_set; 234 led->cdev.brightness_set = wm8350_led_set;
256 led->cdev.default_trigger = pdata->default_trigger; 235 led->cdev.default_trigger = pdata->default_trigger;
257 led->cdev.name = pdata->name; 236 led->cdev.name = pdata->name;
237 led->cdev.flags |= LED_CORE_SUSPENDRESUME;
258 led->enabled = regulator_is_enabled(isink); 238 led->enabled = regulator_is_enabled(isink);
259 led->isink = isink; 239 led->isink = isink;
260 led->dcdc = dcdc; 240 led->dcdc = dcdc;
@@ -311,8 +291,6 @@ static struct platform_driver wm8350_led_driver = {
311 .probe = wm8350_led_probe, 291 .probe = wm8350_led_probe,
312 .remove = wm8350_led_remove, 292 .remove = wm8350_led_remove,
313 .shutdown = wm8350_led_shutdown, 293 .shutdown = wm8350_led_shutdown,
314 .suspend = wm8350_led_suspend,
315 .resume = wm8350_led_resume,
316}; 294};
317 295
318static int __devinit wm8350_led_init(void) 296static int __devinit wm8350_led_init(void)