]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
OMAP2+: powerdomain: move header file from plat-omap to mach-omap2
authorPaul Walmsley <paul@pwsan.com>
Wed, 22 Dec 2010 04:05:16 +0000 (21:05 -0700)
committerPaul Walmsley <paul@pwsan.com>
Wed, 22 Dec 2010 04:05:16 +0000 (21:05 -0700)
The OMAP powerdomain code and data is all OMAP2+-specific.  This seems
unlikely to change any time soon.  Move plat-omap/include/plat/powerdomain.h
to mach-omap2/powerdomain.h.  The primary point of doing this is to remove
the temptation for unrelated upper-layer code to access powerdomain code
and data directly.

As part of this process, remove the references to powerdomain data
from the GPIO "driver" and the OMAP PM no-op layer, both in plat-omap.
Change the DSPBridge code to point to the new location for the
powerdomain headers.  The DSPBridge code should not be including the
powerdomain headers; these should be removed.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
Cc: Omar Ramirez Luna <omar.ramirez@ti.com>
Cc: Felipe Contreras <felipe.contreras@gmail.com>
Cc: Greg Kroah-Hartman <greg@kroah.com>
27 files changed:
arch/arm/mach-omap2/clockdomain.c
arch/arm/mach-omap2/clockdomain.h
arch/arm/mach-omap2/cpuidle34xx.c
arch/arm/mach-omap2/io.c
arch/arm/mach-omap2/omap_hwmod.c
arch/arm/mach-omap2/pm-debug.c
arch/arm/mach-omap2/pm.c
arch/arm/mach-omap2/pm.h
arch/arm/mach-omap2/pm24xx.c
arch/arm/mach-omap2/pm34xx.c
arch/arm/mach-omap2/pm44xx.c
arch/arm/mach-omap2/powerdomain-common.c
arch/arm/mach-omap2/powerdomain.c
arch/arm/mach-omap2/powerdomain.h [moved from arch/arm/plat-omap/include/plat/powerdomain.h with 92% similarity]
arch/arm/mach-omap2/powerdomain2xxx_3xxx.c
arch/arm/mach-omap2/powerdomain44xx.c
arch/arm/mach-omap2/powerdomains.h [deleted file]
arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.c
arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.h
arch/arm/mach-omap2/powerdomains2xxx_data.c
arch/arm/mach-omap2/powerdomains3xxx_data.c
arch/arm/mach-omap2/powerdomains44xx_data.c
arch/arm/plat-omap/gpio.c
arch/arm/plat-omap/include/plat/gpio.h
arch/arm/plat-omap/include/plat/omap-pm.h
arch/arm/plat-omap/omap-pm-noop.c
drivers/staging/tidspbridge/core/_tiomap.h

index 650bf685dd99325102ebe6c5bbeb7e6c0e3f199e..e20b98636ab444b1d6e21b4e00ab9ab5eb980a67 100644 (file)
@@ -34,7 +34,7 @@
 #include "prcm44xx.h"
 
 #include <plat/clock.h>
-#include <plat/powerdomain.h>
+#include "powerdomain.h"
 #include "clockdomain.h"
 #include <plat/prcm.h>
 
index 372c64669868db8a6f6d48e895d32da2025d5c3a..de3faa20b46b658eb53daa4d7af90388ad6a5d58 100644 (file)
@@ -18,7 +18,7 @@
 
 #include <linux/init.h>
 
-#include <plat/powerdomain.h>
+#include "powerdomain.h"
 #include <plat/clock.h>
 #include <plat/cpu.h>
 
index f518270b3e83084320f411f9ebe5891b4a1f4f0f..f3e043fe5eb8023a75e394a759fddcbdda27fde1 100644 (file)
@@ -27,7 +27,7 @@
 
 #include <plat/prcm.h>
 #include <plat/irqs.h>
-#include <plat/powerdomain.h>
+#include "powerdomain.h"
 #include "clockdomain.h"
 #include <plat/serial.h>
 
index 545182d9faa68d3b76c6c4dce49095176a4de5bb..e66687b0b9de02450a952ed78c7bedaa086c755c 100644 (file)
@@ -39,7 +39,7 @@
 #include "io.h"
 
 #include <plat/omap-pm.h>
-#include <plat/powerdomain.h>
+#include "powerdomain.h"
 
 #include "clockdomain.h"
 #include <plat/omap_hwmod.h>
index e1358ba513951a7e99412232a28af08dd65dd194..12856eb7b179761617f2145045080f173c098dbb 100644 (file)
 #include <plat/common.h>
 #include <plat/cpu.h>
 #include "clockdomain.h"
-#include <plat/powerdomain.h>
+#include "powerdomain.h"
 #include <plat/clock.h>
 #include <plat/omap_hwmod.h>
 #include <plat/prcm.h>
index 3f989896a36cc164c1810f6b8d059804388ef45f..e535082b0c2e443fa6c9a056c01d2859aebcedf2 100644 (file)
@@ -29,7 +29,7 @@
 
 #include <plat/clock.h>
 #include <plat/board.h>
-#include <plat/powerdomain.h>
+#include "powerdomain.h"
 #include "clockdomain.h"
 #include <plat/dmtimer.h>
 
index 24228e9dd49633c3ee2428ec189519f418cedcfa..227a211921c3f3f648975f2b603d40b2b01b31d0 100644 (file)
@@ -18,7 +18,7 @@
 #include <plat/omap_device.h>
 #include <plat/common.h>
 
-#include <plat/powerdomain.h>
+#include "powerdomain.h"
 #include "clockdomain.h"
 
 static struct omap_device_pm_latency *pm_lats;
index 8b4f45eba1b5d5843ceeb908ad232dee7d29be8e..482df7fc158594b245b0c3717fa53388e7b7bbd7 100644 (file)
@@ -11,7 +11,7 @@
 #ifndef __ARCH_ARM_MACH_OMAP2_PM_H
 #define __ARCH_ARM_MACH_OMAP2_PM_H
 
-#include <plat/powerdomain.h>
+#include "powerdomain.h"
 
 extern void *omap3_secure_ram_storage;
 extern void omap3_pm_off_mode_enable(int);
index f6aef7687b8aee4167e4982513bd583629f2fbf5..2844b84f8d46cdb21b85e153b659ab3329b68fcf 100644 (file)
@@ -50,7 +50,7 @@
 #include "pm.h"
 #include "control.h"
 
-#include <plat/powerdomain.h>
+#include "powerdomain.h"
 #include "clockdomain.h"
 
 #ifdef CONFIG_SUSPEND
@@ -120,7 +120,7 @@ static void omap2_enter_full_retention(void)
        l = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0) | OMAP24XX_USBSTANDBYCTRL;
        omap_ctrl_writel(l, OMAP2_CONTROL_DEVCONF0);
 
-       omap2_gpio_prepare_for_idle(PWRDM_POWER_RET);
+       omap2_gpio_prepare_for_idle(0);
 
        if (omap2_pm_debug) {
                omap2_pm_dump(0, 0, 0);
index 0fae3d6b76e8ef4f4aed9616478618bd505f8cc7..5efd1fb8c6402a47896ba0a03c545f1f696409ab 100644 (file)
@@ -32,7 +32,7 @@
 
 #include <plat/sram.h>
 #include "clockdomain.h"
-#include <plat/powerdomain.h>
+#include "powerdomain.h"
 #include <plat/serial.h>
 #include <plat/sdrc.h>
 #include <plat/prcm.h>
@@ -360,6 +360,7 @@ void omap_sram_idle(void)
        int mpu_next_state = PWRDM_POWER_ON;
        int per_next_state = PWRDM_POWER_ON;
        int core_next_state = PWRDM_POWER_ON;
+       int per_going_off;
        int core_prev_state, per_prev_state;
        u32 sdrc_pwr = 0;
 
@@ -411,9 +412,10 @@ void omap_sram_idle(void)
 
        /* PER */
        if (per_next_state < PWRDM_POWER_ON) {
+               per_going_off = (per_next_state == PWRDM_POWER_OFF) ? 1 : 0;
                omap_uart_prepare_idle(2);
                omap_uart_prepare_idle(3);
-               omap2_gpio_prepare_for_idle(per_next_state);
+               omap2_gpio_prepare_for_idle(per_going_off);
                if (per_next_state == PWRDM_POWER_OFF)
                                omap3_per_save_context();
        }
index 6aff9961e35d51fce552362809c256e3c1e89ca8..e9f4862c4de4f4e2f54d1162ff536c05ac67af73 100644 (file)
@@ -16,7 +16,7 @@
 #include <linux/err.h>
 #include <linux/slab.h>
 
-#include <plat/powerdomain.h>
+#include "powerdomain.h"
 #include <mach/omap4-common.h>
 
 struct power_state {
index cb01c7a3689a2ce03ab3325d82eaa7b74c801aeb..171fccd208c730e7f003f06de576c6f2a166694c 100644 (file)
@@ -20,7 +20,6 @@
 #include "cm-regbits-44xx.h"
 #include "prm-regbits-34xx.h"
 #include "prm-regbits-44xx.h"
-#include "powerdomains.h"
 
 /*
  * OMAP3 and OMAP4 specific register bit initialisations
index 7eb7ba49d6bf11430b8bf86dae2cd2c9f95ac9fb..06ef60eebebde358899e9b49f564cfb7ee37d2a2 100644 (file)
@@ -26,7 +26,7 @@
 #include "prm44xx.h"
 
 #include <plat/cpu.h>
-#include <plat/powerdomain.h>
+#include "powerdomain.h"
 #include "clockdomain.h"
 #include <plat/prcm.h>
 
similarity index 92%
rename from arch/arm/plat-omap/include/plat/powerdomain.h
rename to arch/arm/mach-omap2/powerdomain.h
index a0d3a30de9fd952a8c49782240bb0454fc69244f..35b5b4800a43fa95c0f2969111099f2fbc006443 100644 (file)
@@ -1,10 +1,10 @@
 /*
  * OMAP2/3/4 powerdomain control
  *
- * Copyright (C) 2007-2008 Texas Instruments, Inc.
+ * Copyright (C) 2007-2008, 2010 Texas Instruments, Inc.
  * Copyright (C) 2007-2010 Nokia Corporation
  *
- * Written by Paul Walmsley
+ * Paul Walmsley
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
  * opportunity.
  */
 
-#ifndef ASM_ARM_PLAT_OMAP_INCLUDE_PLAT_POWERDOMAIN
-#define ASM_ARM_PLAT_OMAP_INCLUDE_PLAT_POWERDOMAIN
+#ifndef __ARCH_ARM_MACH_OMAP2_POWERDOMAIN_H
+#define __ARCH_ARM_MACH_OMAP2_POWERDOMAIN_H
 
 #include <linux/types.h>
 #include <linux/list.h>
 
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 
 #include <plat/cpu.h>
 
@@ -216,4 +216,17 @@ extern void omap2xxx_powerdomains_init(void);
 extern void omap3xxx_powerdomains_init(void);
 extern void omap44xx_powerdomains_init(void);
 
+extern struct pwrdm_ops omap2_pwrdm_operations;
+extern struct pwrdm_ops omap3_pwrdm_operations;
+extern struct pwrdm_ops omap4_pwrdm_operations;
+
+/* Common Internal functions used across OMAP rev's */
+extern u32 omap2_pwrdm_get_mem_bank_onstate_mask(u8 bank);
+extern u32 omap2_pwrdm_get_mem_bank_retst_mask(u8 bank);
+extern u32 omap2_pwrdm_get_mem_bank_stst_mask(u8 bank);
+
+extern struct powerdomain wkup_omap2_pwrdm;
+extern struct powerdomain gfx_omap2_pwrdm;
+
+
 #endif
index b5e9e4d18b8c6a9fca8783e3f15629dd588d721c..d5233890370cb18ecd021fdcd9313877c5dc0c7d 100644 (file)
@@ -18,8 +18,8 @@
 
 #include <plat/prcm.h>
 
+#include "powerdomain.h"
 #include "prm-regbits-34xx.h"
-#include "powerdomains.h"
 #include "prm.h"
 #include "prm-regbits-24xx.h"
 #include "prm-regbits-34xx.h"
index 28bf5e3b000c46f81059e296f2d0a9ec242f722a..a7880af4b3d9f18164e48e6497587a2ed45f24a3 100644 (file)
 #include <linux/errno.h>
 #include <linux/delay.h>
 
-#include <plat/powerdomain.h>
+#include "powerdomain.h"
 #include <plat/prcm.h>
 #include "prm2xxx_3xxx.h"
 #include "prm44xx.h"
 #include "prminst44xx.h"
 #include "prm-regbits-44xx.h"
-#include "powerdomains.h"
 
 static int omap4_pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
 {
diff --git a/arch/arm/mach-omap2/powerdomains.h b/arch/arm/mach-omap2/powerdomains.h
deleted file mode 100644 (file)
index f83adaf..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * OMAP2+ powerdomain prototypes
- *
- * Copyright (C) 2010 Texas Instruments, Inc.
- *
- * Rajendra Nayak <rnayak@ti.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#ifndef ARCH_ARM_MACH_OMAP2_POWERDOMAINS_H
-#define ARCH_ARM_MACH_OMAP2_POWERDOMAINS_H
-
-#include <plat/powerdomain.h>
-
-extern struct pwrdm_ops omap2_pwrdm_operations;
-extern struct pwrdm_ops omap3_pwrdm_operations;
-extern struct pwrdm_ops omap4_pwrdm_operations;
-
-/* Common Internal functions used across OMAP rev's */
-extern u32 omap2_pwrdm_get_mem_bank_onstate_mask(u8 bank);
-extern u32 omap2_pwrdm_get_mem_bank_retst_mask(u8 bank);
-extern u32 omap2_pwrdm_get_mem_bank_stst_mask(u8 bank);
-
-extern struct powerdomain wkup_omap2_pwrdm;
-extern struct powerdomain gfx_omap2_pwrdm;
-
-#endif
index 14c6ef7e01e36e64fbf138874a4ab021dc1bc8ad..5b4dd971320a1f86498a1ee87e731470a9a4ba34 100644 (file)
  * address offset is different between the C55 and C64 DSPs.
  */
 
-#include <plat/powerdomain.h>
+#include "powerdomain.h"
 
 #include "prcm-common.h"
 #include "prm.h"
 
-#include "powerdomains.h"
-
 /* OMAP2/3-common powerdomains */
 
 /*
index 45d684a3bf2b785ad882c5b241fc2797b9e898c2..fa311669d53d05e3d3e57316461f5fa82cd7a2b9 100644 (file)
@@ -14,7 +14,7 @@
 #ifndef __ARCH_ARM_MACH_OMAP2_POWERDOMAINS2XXX_3XXX_DATA_H
 #define __ARCH_ARM_MACH_OMAP2_POWERDOMAINS2XXX_3XXX_DATA_H
 
-#include <plat/powerdomain.h>
+#include "powerdomain.h"
 
 extern struct powerdomain gfx_omap2_pwrdm;
 extern struct powerdomain wkup_omap2_pwrdm;
index e136895e0a37f27c9d555cb346ec84eeeb6b18a9..9b1a33500577a6023d082f19a40fddd5462bab27 100644 (file)
@@ -14,9 +14,8 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 
-#include <plat/powerdomain.h>
+#include "powerdomain.h"
 #include "powerdomains2xxx_3xxx_data.h"
-#include "powerdomains.h"
 
 #include "prcm-common.h"
 #include "prm2xxx_3xxx.h"
index 1830c63ae676ff9f29a2173cb9feddb5a962a433..e1bec562625b2194419b59bb40a6c3ea4b890d9f 100644 (file)
@@ -14,9 +14,8 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 
-#include <plat/powerdomain.h>
+#include "powerdomain.h"
 #include "powerdomains2xxx_3xxx_data.h"
-#include "powerdomains.h"
 
 #include "prcm-common.h"
 #include "prm2xxx_3xxx.h"
index 823f4770f9474e1d7f13e62b04627fd49ac6de3f..5fdf485a022a5d0210dec009f169f095328deadf 100644 (file)
@@ -22,8 +22,7 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 
-#include <plat/powerdomain.h>
-#include "powerdomains.h"
+#include "powerdomain.h"
 
 #include "prcm-common.h"
 #include "prcm44xx.h"
index 8d493b992e703b65ed904c80017c46c61f7f59d8..1f98e0b948478dc92abccc71580c66b02223e73e 100644 (file)
@@ -29,7 +29,6 @@
 #include <mach/irqs.h>
 #include <mach/gpio.h>
 #include <asm/mach/irq.h>
-#include <plat/powerdomain.h>
 
 /*
  * OMAP1510 GPIO registers
@@ -1864,7 +1863,7 @@ static struct sys_device omap_gpio_device = {
 
 static int workaround_enabled;
 
-void omap2_gpio_prepare_for_idle(int power_state)
+void omap2_gpio_prepare_for_idle(int off_mode)
 {
        int i, c = 0;
        int min = 0;
@@ -1880,7 +1879,7 @@ void omap2_gpio_prepare_for_idle(int power_state)
                for (j = 0; j < hweight_long(bank->dbck_enable_mask); j++)
                        clk_disable(bank->dbck);
 
-               if (power_state > PWRDM_POWER_OFF)
+               if (!off_mode)
                        continue;
 
                /* If going to OFF, remove triggering for all
index 41ff2f8943f07545281db357d5f4b925b4d79b94..d6f9fa0f62af3887fb02cf54f4dd765136fea1b8 100644 (file)
@@ -82,7 +82,7 @@ struct omap_gpio_platform_data {
 /* TODO: Analyze removing gpio_bank_count usage from driver code */
 extern int gpio_bank_count;
 
-extern void omap2_gpio_prepare_for_idle(int power_state);
+extern void omap2_gpio_prepare_for_idle(int off_mode);
 extern void omap2_gpio_resume_after_idle(void);
 extern void omap_set_gpio_debounce(int gpio, int enable);
 extern void omap_set_gpio_debounce_time(int gpio, int enable);
index 62c3fe918ab21674fed25f99d7dbce020066f0b4..47d61107ccdab607878aef1b087d30e3202bea03 100644 (file)
@@ -19,8 +19,6 @@
 #include <linux/clk.h>
 #include <linux/opp.h>
 
-#include "powerdomain.h"
-
 /*
  * agent_id values for use with omap_pm_set_min_bus_tput():
  *
index ca75abb18068da5a3554f34eebe0dd6f2c7654ba..19cb9f5a9f04e541b9abceb9ee18394b9a7f3a19 100644 (file)
@@ -24,8 +24,6 @@
 /* Interface documentation is in mach/omap-pm.h */
 #include <plat/omap-pm.h>
 
-#include <plat/powerdomain.h>
-
 /*
  * Device-driver-originated constraints (via board-*.c files)
  */
index a3190e74ff744eb604b8df8798ea20a62d84082f..1159a500f49db0e64a82022bf68b72ae56705645 100644 (file)
@@ -24,7 +24,7 @@
  * be removed.  No driver should call pwrdm_* or clkdm_* functions
  * directly; they should rely on OMAP core code to do this.
  */
-#include <plat/powerdomain.h>
+#include <mach-omap2/powerdomain.h>
 #include <mach-omap2/clockdomain.h>
 /*
  * XXX These mach-omap2/ includes are wrong and should be removed.  No