public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] Add i.MX1/L power management driver
@ 2008-06-02 16:36 Paulius Zaleckas
  0 siblings, 0 replies; only message in thread
From: Paulius Zaleckas @ 2008-06-02 16:36 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: linux-pm

[-- Attachment #1: patch-pm-imx --]
[-- Type: text/plain, Size: 2107 bytes --]

Add power management support for i.MX1/L

v2:
- simplified imx_pm_valid_state()
- removed not needed info message from imx_pm_init()

Signed-off-by: Paulius Zaleckas <paulius.zaleckas@teltonika.lt>

Index: linux-2.6.26-rc1/arch/arm/mach-imx/Makefile
===================================================================
--- linux-2.6.26-rc1.orig/arch/arm/mach-imx/Makefile
+++ linux-2.6.26-rc1/arch/arm/mach-imx/Makefile
@@ -6,8 +6,14 @@
 
 obj-y			+= irq.o time.o dma.o generic.o
 
+# Power management
+obj-$(CONFIG_PM)		+= pm.o
 obj-$(CONFIG_CPU_FREQ_IMX)	+= cpufreq.o
 
+ifeq ($(CONFIG_PM_DEBUG),y)
+CFLAGS_pm.o += -DDEBUG
+endif
+
 # Specific board support
 obj-$(CONFIG_ARCH_MX1ADS) += mx1ads.o
 
Index: linux-2.6.26-rc1/arch/arm/mach-imx/pm.c
===================================================================
--- /dev/null
+++ linux-2.6.26-rc1/arch/arm/mach-imx/pm.c
@@ -0,0 +1,48 @@
+/*
+ * i.MX Power Management
+ *
+ * Copyright (c) 2008 Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
+ *
+ * This file may be distributed under the terms of the GNU General
+ * Public License, version 2.
+ */
+
+#include <linux/suspend.h>
+#include <asm/arch/hardware.h>
+
+static int imx_pm_valid_state(suspend_state_t state)
+{
+	return state == PM_SUSPEND_STANDBY;
+}
+
+static int imx_pm_enter(suspend_state_t state)
+{
+	switch (state) {
+	case PM_SUSPEND_STANDBY:
+		/* disable System PLL and MCU PLL */
+		CSCR &= ~(CSCR_SPEN | CSCR_MPEN);
+		break;
+	default:
+		pr_debug("i.MX: PM - bogus suspend state %d\n", state);
+		goto exit;
+	}
+
+	pr_debug("i.MX: PM - wakeup\n");
+
+exit:
+	return 0;
+}
+
+static struct platform_suspend_ops imx_pm_ops ={
+	.valid	= imx_pm_valid_state,
+	.enter	= imx_pm_enter,
+};
+
+static int __init imx_pm_init(void)
+{
+	suspend_set_ops(&imx_pm_ops);
+
+	return 0;
+}
+
+arch_initcall(imx_pm_init);
-------------------------------------------------------------------
List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel
FAQ:        http://www.arm.linux.org.uk/mailinglists/faq.php
Etiquette:  http://www.arm.linux.org.uk/mailinglists/etiquette.php

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-06-02 16:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-02 16:36 [PATCH v2] Add i.MX1/L power management driver Paulius Zaleckas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox