Re: [PATCH] OMAP: PM: make mach/pm.h OMAP1-specific
Paul Walmsley writes: > mach/pm.h is almost completely OMAP1-specific. Move it to plat-omap1 and > remove the unused OMAP2xxx-specific defines. Many files included mach/pm.h > but did not actually use any symbols; remove those #includes. Any > definitions needed for OMAP2/3 have been moved to mach-omap2/pm.h. > > Boot-tested on OMAP3 Beagle as of the 16-April PM branch. > > Signed-off-by: Paul Walmsley Thanks, pushing to PM branch. Kevin > --- > arch/arm/mach-omap1/pm.c | 11 +++-- > .../{plat-omap/include/mach => mach-omap1}/pm.h| 46 > +++- > arch/arm/mach-omap1/serial.c |3 - > arch/arm/mach-omap1/sleep.S|2 +- > arch/arm/mach-omap2/board-n800-usb.c |3 +- > arch/arm/mach-omap2/cpuidle34xx.c |1 - > arch/arm/mach-omap2/pm.c |1 - > arch/arm/mach-omap2/pm.h | 24 ++ > arch/arm/mach-omap2/pm24xx.c |1 - > arch/arm/mach-omap2/pm34xx.c |1 - > arch/arm/mach-omap2/sleep24xx.S|1 - > arch/arm/mach-omap2/sleep34xx.S|1 - > arch/arm/mach-omap2/usb-ehci.c |1 - > arch/arm/mach-omap2/usb-musb.c |1 - > arch/arm/plat-omap/common.c|1 - > drivers/bluetooth/hci_h4p/core.c |1 - > drivers/mtd/onenand/omap2.c|1 - > 17 files changed, 40 insertions(+), 60 deletions(-) > rename arch/arm/{plat-omap/include/mach => mach-omap1}/pm.h (86%) > > diff --git a/arch/arm/mach-omap1/pm.c b/arch/arm/mach-omap1/pm.c > index 9774c1f..5218943 100644 > --- a/arch/arm/mach-omap1/pm.c > +++ b/arch/arm/mach-omap1/pm.c > @@ -53,11 +53,12 @@ > #include > #include > #include > -#include > #include > #include > #include > > +#include "pm.h" > + > static unsigned int arm_sleep_save[ARM_SLEEP_SAVE_SIZE]; > static unsigned short dsp_sleep_save[DSP_SLEEP_SAVE_SIZE]; > static unsigned short ulpd_sleep_save[ULPD_SLEEP_SAVE_SIZE]; > @@ -101,7 +102,7 @@ static void (*omap_sram_suspend)(unsigned long r0, > unsigned long r1) = NULL; > * going idle we continue to do idle even if we get > * a clock tick interrupt . . > */ > -void omap_pm_idle(void) > +void omap1_pm_idle(void) > { > extern __u32 arm_idlect1_mask; > __u32 use_idlect1 = arm_idlect1_mask; > @@ -222,7 +223,7 @@ static void omap_pm_wakeup_setup(void) > #define EN_APICK 6 /* ARM_IDLECT2 */ > #define DSP_EN 1 /* ARM_RSTCT1 */ > > -void omap_pm_suspend(void) > +void omap1_pm_suspend(void) > { > unsigned long arg0 = 0, arg1 = 0; > > @@ -610,7 +611,7 @@ static int omap_pm_enter(suspend_state_t state) > { > case PM_SUSPEND_STANDBY: > case PM_SUSPEND_MEM: > - omap_pm_suspend(); > + omap1_pm_suspend(); > break; > default: > return -EINVAL; > @@ -683,7 +684,7 @@ static int __init omap_pm_init(void) > return -ENODEV; > } > > - pm_idle = omap_pm_idle; > + pm_idle = omap1_pm_idle; > > if (cpu_is_omap730()) > setup_irq(INT_730_WAKE_UP_REQ, &omap_wakeup_irq); > diff --git a/arch/arm/plat-omap/include/mach/pm.h b/arch/arm/mach-omap1/pm.h > similarity index 86% > rename from arch/arm/plat-omap/include/mach/pm.h > rename to arch/arm/mach-omap1/pm.h > index 4bf1138..9ed5e2c 100644 > --- a/arch/arm/plat-omap/include/mach/pm.h > +++ b/arch/arm/mach-omap1/pm.h > @@ -1,7 +1,7 @@ > /* > - * arch/arm/plat-omap/include/mach/pm.h > + * arch/arm/mach-omap1/pm.h > * > - * Header file for OMAP Power Management Routines > + * Header file for OMAP1 Power Management Routines > * > * Author: MontaVista Software, Inc. > * supp...@mvista.com > @@ -31,8 +31,8 @@ > * 675 Mass Ave, Cambridge, MA 02139, USA. > */ > > -#ifndef __ASM_ARCH_OMAP_PM_H > -#define __ASM_ARCH_OMAP_PM_H > +#ifndef __ARCH_ARM_MACH_OMAP1_PM_H > +#define __ARCH_ARM_MACH_OMAP1_PM_H > > /* > * > > @@ -106,9 +106,7 @@ > > #if !defined(CONFIG_ARCH_OMAP730) && \ > !defined(CONFIG_ARCH_OMAP15XX) && \ > - !defined(CONFIG_ARCH_OMAP16XX) && \ > - !defined(CONFIG_ARCH_OMAP24XX) && \ > - !defined(CONFIG_ARCH_OMAP34XX) > + !defined(CONFIG_ARCH_OMAP16XX) > #warning "Power management for this processor not implemented yet" > #endif > > @@ -121,52 +119,22 @@ extern struct kset power_subsys; > extern void prevent_idle_sleep(void); > extern void allow_idle_sleep(void); > > -/** > - * clk_deny_idle - Prevents the clock from being idled during MPU idle > - * @clk: clock signal handle > - */ > -void clk_deny_idle(struct clk *clk); > +extern void omap1_pm_idle(void); > +extern void omap1_pm_suspend(
[PATCH] OMAP: PM: make mach/pm.h OMAP1-specific
mach/pm.h is almost completely OMAP1-specific. Move it to plat-omap1 and remove the unused OMAP2xxx-specific defines. Many files included mach/pm.h but did not actually use any symbols; remove those #includes. Any definitions needed for OMAP2/3 have been moved to mach-omap2/pm.h. Boot-tested on OMAP3 Beagle as of the 16-April PM branch. Signed-off-by: Paul Walmsley --- arch/arm/mach-omap1/pm.c | 11 +++-- .../{plat-omap/include/mach => mach-omap1}/pm.h| 46 +++- arch/arm/mach-omap1/serial.c |3 - arch/arm/mach-omap1/sleep.S|2 +- arch/arm/mach-omap2/board-n800-usb.c |3 +- arch/arm/mach-omap2/cpuidle34xx.c |1 - arch/arm/mach-omap2/pm.c |1 - arch/arm/mach-omap2/pm.h | 24 ++ arch/arm/mach-omap2/pm24xx.c |1 - arch/arm/mach-omap2/pm34xx.c |1 - arch/arm/mach-omap2/sleep24xx.S|1 - arch/arm/mach-omap2/sleep34xx.S|1 - arch/arm/mach-omap2/usb-ehci.c |1 - arch/arm/mach-omap2/usb-musb.c |1 - arch/arm/plat-omap/common.c|1 - drivers/bluetooth/hci_h4p/core.c |1 - drivers/mtd/onenand/omap2.c|1 - 17 files changed, 40 insertions(+), 60 deletions(-) rename arch/arm/{plat-omap/include/mach => mach-omap1}/pm.h (86%) diff --git a/arch/arm/mach-omap1/pm.c b/arch/arm/mach-omap1/pm.c index 9774c1f..5218943 100644 --- a/arch/arm/mach-omap1/pm.c +++ b/arch/arm/mach-omap1/pm.c @@ -53,11 +53,12 @@ #include #include #include -#include #include #include #include +#include "pm.h" + static unsigned int arm_sleep_save[ARM_SLEEP_SAVE_SIZE]; static unsigned short dsp_sleep_save[DSP_SLEEP_SAVE_SIZE]; static unsigned short ulpd_sleep_save[ULPD_SLEEP_SAVE_SIZE]; @@ -101,7 +102,7 @@ static void (*omap_sram_suspend)(unsigned long r0, unsigned long r1) = NULL; * going idle we continue to do idle even if we get * a clock tick interrupt . . */ -void omap_pm_idle(void) +void omap1_pm_idle(void) { extern __u32 arm_idlect1_mask; __u32 use_idlect1 = arm_idlect1_mask; @@ -222,7 +223,7 @@ static void omap_pm_wakeup_setup(void) #define EN_APICK 6 /* ARM_IDLECT2 */ #define DSP_EN 1 /* ARM_RSTCT1 */ -void omap_pm_suspend(void) +void omap1_pm_suspend(void) { unsigned long arg0 = 0, arg1 = 0; @@ -610,7 +611,7 @@ static int omap_pm_enter(suspend_state_t state) { case PM_SUSPEND_STANDBY: case PM_SUSPEND_MEM: - omap_pm_suspend(); + omap1_pm_suspend(); break; default: return -EINVAL; @@ -683,7 +684,7 @@ static int __init omap_pm_init(void) return -ENODEV; } - pm_idle = omap_pm_idle; + pm_idle = omap1_pm_idle; if (cpu_is_omap730()) setup_irq(INT_730_WAKE_UP_REQ, &omap_wakeup_irq); diff --git a/arch/arm/plat-omap/include/mach/pm.h b/arch/arm/mach-omap1/pm.h similarity index 86% rename from arch/arm/plat-omap/include/mach/pm.h rename to arch/arm/mach-omap1/pm.h index 4bf1138..9ed5e2c 100644 --- a/arch/arm/plat-omap/include/mach/pm.h +++ b/arch/arm/mach-omap1/pm.h @@ -1,7 +1,7 @@ /* - * arch/arm/plat-omap/include/mach/pm.h + * arch/arm/mach-omap1/pm.h * - * Header file for OMAP Power Management Routines + * Header file for OMAP1 Power Management Routines * * Author: MontaVista Software, Inc. *supp...@mvista.com @@ -31,8 +31,8 @@ * 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifndef __ASM_ARCH_OMAP_PM_H -#define __ASM_ARCH_OMAP_PM_H +#ifndef __ARCH_ARM_MACH_OMAP1_PM_H +#define __ARCH_ARM_MACH_OMAP1_PM_H /* * @@ -106,9 +106,7 @@ #if !defined(CONFIG_ARCH_OMAP730) && \ !defined(CONFIG_ARCH_OMAP15XX) && \ - !defined(CONFIG_ARCH_OMAP16XX) && \ - !defined(CONFIG_ARCH_OMAP24XX) && \ - !defined(CONFIG_ARCH_OMAP34XX) + !defined(CONFIG_ARCH_OMAP16XX) #warning "Power management for this processor not implemented yet" #endif @@ -121,52 +119,22 @@ extern struct kset power_subsys; extern void prevent_idle_sleep(void); extern void allow_idle_sleep(void); -/** - * clk_deny_idle - Prevents the clock from being idled during MPU idle - * @clk: clock signal handle - */ -void clk_deny_idle(struct clk *clk); +extern void omap1_pm_idle(void); +extern void omap1_pm_suspend(void); -/** - * clk_allow_idle - Counters previous clk_deny_idle - * @clk: clock signal handle - */ -void clk_allow_idle(struct clk *clk); - -extern void omap_pm_idle(void); -extern void omap_pm_suspend(void); -extern void omap_sram_idle(void); -#ifdef CONFIG_PM -extern void omap2_block_s