|
@@ -9,6 +9,7 @@
|
|
|
#include <linux/module.h>
|
|
|
#include <linux/kernel.h>
|
|
|
#include <linux/init.h>
|
|
|
+#include <linux/sysdev.h>
|
|
|
|
|
|
#include <mach/pxa2xx-regs.h>
|
|
|
|
|
@@ -28,3 +29,28 @@ const struct clkops clk_pxa2xx_cken_ops = {
|
|
|
.enable = clk_pxa2xx_cken_enable,
|
|
|
.disable = clk_pxa2xx_cken_disable,
|
|
|
};
|
|
|
+
|
|
|
+#ifdef CONFIG_PM
|
|
|
+static uint32_t saved_cken;
|
|
|
+
|
|
|
+static int pxa2xx_clock_suspend(struct sys_device *d, pm_message_t state)
|
|
|
+{
|
|
|
+ saved_cken = CKEN;
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+static int pxa2xx_clock_resume(struct sys_device *d)
|
|
|
+{
|
|
|
+ CKEN = saved_cken;
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+#else
|
|
|
+#define pxa2xx_clock_suspend NULL
|
|
|
+#define pxa2xx_clock_resume NULL
|
|
|
+#endif
|
|
|
+
|
|
|
+struct sysdev_class pxa2xx_clock_sysclass = {
|
|
|
+ .name = "pxa2xx-clock",
|
|
|
+ .suspend = pxa2xx_clock_suspend,
|
|
|
+ .resume = pxa2xx_clock_resume,
|
|
|
+};
|