diff options
Diffstat (limited to 'drivers/leds/leds-asic3.c')
-rw-r--r-- | drivers/leds/leds-asic3.c | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/drivers/leds/leds-asic3.c b/drivers/leds/leds-asic3.c index 22f847c890c..48d9fe61bdf 100644 --- a/drivers/leds/leds-asic3.c +++ b/drivers/leds/leds-asic3.c | |||
@@ -14,6 +14,7 @@ | |||
14 | 14 | ||
15 | #include <linux/mfd/asic3.h> | 15 | #include <linux/mfd/asic3.h> |
16 | #include <linux/mfd/core.h> | 16 | #include <linux/mfd/core.h> |
17 | #include <linux/module.h> | ||
17 | 18 | ||
18 | /* | 19 | /* |
19 | * The HTC ASIC3 LED GPIOs are inputs, not outputs. | 20 | * The HTC ASIC3 LED GPIOs are inputs, not outputs. |
@@ -107,9 +108,10 @@ static int __devinit asic3_led_probe(struct platform_device *pdev) | |||
107 | } | 108 | } |
108 | 109 | ||
109 | led->cdev->name = led->name; | 110 | led->cdev->name = led->name; |
110 | led->cdev->default_trigger = led->default_trigger; | 111 | led->cdev->flags = LED_CORE_SUSPENDRESUME; |
111 | led->cdev->brightness_set = brightness_set; | 112 | led->cdev->brightness_set = brightness_set; |
112 | led->cdev->blink_set = blink_set; | 113 | led->cdev->blink_set = blink_set; |
114 | led->cdev->default_trigger = led->default_trigger; | ||
113 | 115 | ||
114 | ret = led_classdev_register(&pdev->dev, led->cdev); | 116 | ret = led_classdev_register(&pdev->dev, led->cdev); |
115 | if (ret < 0) | 117 | if (ret < 0) |
@@ -136,12 +138,44 @@ static int __devexit asic3_led_remove(struct platform_device *pdev) | |||
136 | return mfd_cell_disable(pdev); | 138 | return mfd_cell_disable(pdev); |
137 | } | 139 | } |
138 | 140 | ||
141 | static int asic3_led_suspend(struct device *dev) | ||
142 | { | ||
143 | struct platform_device *pdev = to_platform_device(dev); | ||
144 | const struct mfd_cell *cell = mfd_get_cell(pdev); | ||
145 | int ret; | ||
146 | |||
147 | ret = 0; | ||
148 | if (cell->suspend) | ||
149 | ret = (*cell->suspend)(pdev); | ||
150 | |||
151 | return ret; | ||
152 | } | ||
153 | |||
154 | static int asic3_led_resume(struct device *dev) | ||
155 | { | ||
156 | struct platform_device *pdev = to_platform_device(dev); | ||
157 | const struct mfd_cell *cell = mfd_get_cell(pdev); | ||
158 | int ret; | ||
159 | |||
160 | ret = 0; | ||
161 | if (cell->resume) | ||
162 | ret = (*cell->resume)(pdev); | ||
163 | |||
164 | return ret; | ||
165 | } | ||
166 | |||
167 | static const struct dev_pm_ops asic3_led_pm_ops = { | ||
168 | .suspend = asic3_led_suspend, | ||
169 | .resume = asic3_led_resume, | ||
170 | }; | ||
171 | |||
139 | static struct platform_driver asic3_led_driver = { | 172 | static struct platform_driver asic3_led_driver = { |
140 | .probe = asic3_led_probe, | 173 | .probe = asic3_led_probe, |
141 | .remove = __devexit_p(asic3_led_remove), | 174 | .remove = __devexit_p(asic3_led_remove), |
142 | .driver = { | 175 | .driver = { |
143 | .name = "leds-asic3", | 176 | .name = "leds-asic3", |
144 | .owner = THIS_MODULE, | 177 | .owner = THIS_MODULE, |
178 | .pm = &asic3_led_pm_ops, | ||
145 | }, | 179 | }, |
146 | }; | 180 | }; |
147 | 181 | ||