diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mtd/maps/physmap.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/drivers/mtd/maps/physmap.c b/drivers/mtd/maps/physmap.c index 7799a25a7f2a..bc7cc71788bc 100644 --- a/drivers/mtd/maps/physmap.c +++ b/drivers/mtd/maps/physmap.c | |||
@@ -158,9 +158,42 @@ err_out: | |||
158 | return err; | 158 | return err; |
159 | } | 159 | } |
160 | 160 | ||
161 | #ifdef CONFIG_PM | ||
162 | static int physmap_flash_suspend(struct platform_device *dev, pm_message_t state) | ||
163 | { | ||
164 | struct physmap_flash_info *info = platform_get_drvdata(dev); | ||
165 | int ret = 0; | ||
166 | |||
167 | if (info) | ||
168 | ret = info->mtd->suspend(info->mtd); | ||
169 | |||
170 | return ret; | ||
171 | } | ||
172 | |||
173 | static int physmap_flash_resume(struct platform_device *dev) | ||
174 | { | ||
175 | struct physmap_flash_info *info = platform_get_drvdata(dev); | ||
176 | if (info) | ||
177 | info->mtd->resume(info->mtd); | ||
178 | return 0; | ||
179 | } | ||
180 | |||
181 | static void physmap_flash_shutdown(struct platform_device *dev) | ||
182 | { | ||
183 | struct physmap_flash_info *info = platform_get_drvdata(dev); | ||
184 | if (info && info->mtd->suspend(info->mtd) == 0) | ||
185 | info->mtd->resume(info->mtd); | ||
186 | } | ||
187 | #endif | ||
188 | |||
161 | static struct platform_driver physmap_flash_driver = { | 189 | static struct platform_driver physmap_flash_driver = { |
162 | .probe = physmap_flash_probe, | 190 | .probe = physmap_flash_probe, |
163 | .remove = physmap_flash_remove, | 191 | .remove = physmap_flash_remove, |
192 | #ifdef CONFIG_PM | ||
193 | .suspend = physmap_flash_suspend, | ||
194 | .resume = physmap_flash_resume, | ||
195 | .shutdown = physmap_flash_shutdown, | ||
196 | #endif | ||
164 | .driver = { | 197 | .driver = { |
165 | .name = "physmap-flash", | 198 | .name = "physmap-flash", |
166 | }, | 199 | }, |