From d50470979090bb5fa6c198d0ef87276658deb5f9 Mon Sep 17 00:00:00 2001 From: Daniel Lezcano Date: Wed, 3 Apr 2013 12:15:15 +0000 Subject: ARM: shmobile: pm: fix init sections Add the __init section for the functions which are called at init time. Signed-off-by: Daniel Lezcano Acked-by: Simon Horman Signed-off-by: Rafael J. Wysocki --- arch/arm/mach-shmobile/cpuidle.c | 4 ++-- arch/arm/mach-shmobile/pm-sh7372.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/mach-shmobile/cpuidle.c b/arch/arm/mach-shmobile/cpuidle.c index 9e050268cde..068f9ca8715 100644 --- a/arch/arm/mach-shmobile/cpuidle.c +++ b/arch/arm/mach-shmobile/cpuidle.c @@ -36,12 +36,12 @@ static struct cpuidle_driver shmobile_cpuidle_default_driver = { static struct cpuidle_driver *cpuidle_drv = &shmobile_cpuidle_default_driver; -void shmobile_cpuidle_set_driver(struct cpuidle_driver *drv) +void __init shmobile_cpuidle_set_driver(struct cpuidle_driver *drv) { cpuidle_drv = drv; } -int shmobile_cpuidle_init(void) +int __init shmobile_cpuidle_init(void) { struct cpuidle_device *dev = &shmobile_cpuidle_dev; diff --git a/arch/arm/mach-shmobile/pm-sh7372.c b/arch/arm/mach-shmobile/pm-sh7372.c index a0826a48dd0..f6b14cac007 100644 --- a/arch/arm/mach-shmobile/pm-sh7372.c +++ b/arch/arm/mach-shmobile/pm-sh7372.c @@ -450,12 +450,12 @@ static struct cpuidle_driver sh7372_cpuidle_driver = { }, }; -static void sh7372_cpuidle_init(void) +static void __init sh7372_cpuidle_init(void) { shmobile_cpuidle_set_driver(&sh7372_cpuidle_driver); } #else -static void sh7372_cpuidle_init(void) {} +static void __init sh7372_cpuidle_init(void) {} #endif #ifdef CONFIG_SUSPEND -- cgit v1.2.3 From 688036b538974de32ce55be8b0e013b003992abc Mon Sep 17 00:00:00 2001 From: Daniel Lezcano Date: Wed, 3 Apr 2013 12:15:16 +0000 Subject: ARM: shmobile: cpuidle: remove useless WFI function Remove the shmobile_enter_wfi function which is the same as the common WFI enter function from the arm cpuidle driver defined with the ARM_CPUIDLE_WFI_STATE macro. Signed-off-by: Daniel Lezcano Acked-by: Simon Horman Signed-off-by: Rafael J. Wysocki --- arch/arm/mach-shmobile/cpuidle.c | 8 -------- 1 file changed, 8 deletions(-) (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/mach-shmobile/cpuidle.c b/arch/arm/mach-shmobile/cpuidle.c index 068f9ca8715..c872ae8c1cb 100644 --- a/arch/arm/mach-shmobile/cpuidle.c +++ b/arch/arm/mach-shmobile/cpuidle.c @@ -16,20 +16,12 @@ #include #include -int shmobile_enter_wfi(struct cpuidle_device *dev, struct cpuidle_driver *drv, - int index) -{ - cpu_do_idle(); - return 0; -} - static struct cpuidle_device shmobile_cpuidle_dev; static struct cpuidle_driver shmobile_cpuidle_default_driver = { .name = "shmobile_cpuidle", .owner = THIS_MODULE, .en_core_tk_irqen = 1, .states[0] = ARM_CPUIDLE_WFI_STATE, - .states[0].enter = shmobile_enter_wfi, .safe_state_index = 0, /* C1 */ .state_count = 1, }; -- cgit v1.2.3 From 38ef8d3fa4a67c07bdfd640833a88baf525f955b Mon Sep 17 00:00:00 2001 From: Daniel Lezcano Date: Fri, 12 Apr 2013 12:35:47 +0000 Subject: ARM: shmobile: cpuidle: remove shmobile_enter_wfi function Remove the shmobile_enter_wfi function which is the same as the common WFI enter function from the arm cpuidle driver defined with the ARM_CPUIDLE_WFI_STATE macro. Signed-off-by: Daniel Lezcano Acked-by: Simon Horman Acked-by: Santosh Shilimkar Signed-off-by: Rafael J. Wysocki --- arch/arm/mach-shmobile/pm-sh7372.c | 1 - 1 file changed, 1 deletion(-) (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/mach-shmobile/pm-sh7372.c b/arch/arm/mach-shmobile/pm-sh7372.c index f6b14cac007..fbef7b933c1 100644 --- a/arch/arm/mach-shmobile/pm-sh7372.c +++ b/arch/arm/mach-shmobile/pm-sh7372.c @@ -414,7 +414,6 @@ static struct cpuidle_driver sh7372_cpuidle_driver = { .state_count = 5, .safe_state_index = 0, /* C1 */ .states[0] = ARM_CPUIDLE_WFI_STATE, - .states[0].enter = shmobile_enter_wfi, .states[1] = { .name = "C2", .desc = "Core Standby Mode", -- cgit v1.2.3 From 80d538b2754f1eed85296f0c7088f7157d543f89 Mon Sep 17 00:00:00 2001 From: Daniel Lezcano Date: Fri, 12 Apr 2013 12:35:48 +0000 Subject: ARM: shmobile: cpuidle: remove shmobile_enter_wfi prototype Commit 688036b538974de32ce55be8b0e013b003992abc removed the function 'shmobile_enter_wfi' but we forgot to remove the definition in the header file. Note this function is just an alias to 'cpu_do_idle()' wrapped into a cpuidle function callback prototype which already exists with the default WFI state and the arm_simple_enter function. Remove the function prototype. Signed-off-by: Daniel Lezcano Acked-by: Simon Horman Signed-off-by: Rafael J. Wysocki --- arch/arm/mach-shmobile/include/mach/common.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/mach-shmobile/include/mach/common.h b/arch/arm/mach-shmobile/include/mach/common.h index e48606d8a2b..362f9b2d2c0 100644 --- a/arch/arm/mach-shmobile/include/mach/common.h +++ b/arch/arm/mach-shmobile/include/mach/common.h @@ -13,9 +13,6 @@ extern int shmobile_clk_init(void); extern void shmobile_handle_irq_intc(struct pt_regs *); extern struct platform_suspend_ops shmobile_suspend_ops; struct cpuidle_driver; -struct cpuidle_device; -extern int shmobile_enter_wfi(struct cpuidle_device *dev, - struct cpuidle_driver *drv, int index); extern void shmobile_cpuidle_set_driver(struct cpuidle_driver *drv); extern void sh7372_init_irq(void); -- cgit v1.2.3 From 554c06ba3ee29cf453fca17e9e61120b75aa476d Mon Sep 17 00:00:00 2001 From: Daniel Lezcano Date: Tue, 23 Apr 2013 08:54:31 +0000 Subject: cpuidle: remove en_core_tk_irqen flag The en_core_tk_irqen flag is set in all the cpuidle driver which means it is not necessary to specify this flag. Remove the flag and the code related to it. Signed-off-by: Daniel Lezcano Acked-by: Kevin Hilman # for mach-omap2/* Signed-off-by: Rafael J. Wysocki --- arch/arm/mach-shmobile/cpuidle.c | 1 - arch/arm/mach-shmobile/pm-sh7372.c | 1 - 2 files changed, 2 deletions(-) (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/mach-shmobile/cpuidle.c b/arch/arm/mach-shmobile/cpuidle.c index c872ae8c1cb..d671ae90c7a 100644 --- a/arch/arm/mach-shmobile/cpuidle.c +++ b/arch/arm/mach-shmobile/cpuidle.c @@ -20,7 +20,6 @@ static struct cpuidle_device shmobile_cpuidle_dev; static struct cpuidle_driver shmobile_cpuidle_default_driver = { .name = "shmobile_cpuidle", .owner = THIS_MODULE, - .en_core_tk_irqen = 1, .states[0] = ARM_CPUIDLE_WFI_STATE, .safe_state_index = 0, /* C1 */ .state_count = 1, diff --git a/arch/arm/mach-shmobile/pm-sh7372.c b/arch/arm/mach-shmobile/pm-sh7372.c index fbef7b933c1..dec9293bb90 100644 --- a/arch/arm/mach-shmobile/pm-sh7372.c +++ b/arch/arm/mach-shmobile/pm-sh7372.c @@ -410,7 +410,6 @@ static int sh7372_enter_a4s(struct cpuidle_device *dev, static struct cpuidle_driver sh7372_cpuidle_driver = { .name = "sh7372_cpuidle", .owner = THIS_MODULE, - .en_core_tk_irqen = 1, .state_count = 5, .safe_state_index = 0, /* C1 */ .states[0] = ARM_CPUIDLE_WFI_STATE, -- cgit v1.2.3 From 3cf4bc36f534550cfd4b0902e1a0408aded33a66 Mon Sep 17 00:00:00 2001 From: Daniel Lezcano Date: Tue, 23 Apr 2013 08:54:38 +0000 Subject: ARM: shmobile: cpuidle: use init/exit common routine Remove the duplicated code and use the cpuidle common code for initialization. Signed-off-by: Daniel Lezcano Acked-by: Simon Horman Signed-off-by: Rafael J. Wysocki --- arch/arm/mach-shmobile/cpuidle.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/mach-shmobile/cpuidle.c b/arch/arm/mach-shmobile/cpuidle.c index d671ae90c7a..0afeb5c7061 100644 --- a/arch/arm/mach-shmobile/cpuidle.c +++ b/arch/arm/mach-shmobile/cpuidle.c @@ -16,7 +16,6 @@ #include #include -static struct cpuidle_device shmobile_cpuidle_dev; static struct cpuidle_driver shmobile_cpuidle_default_driver = { .name = "shmobile_cpuidle", .owner = THIS_MODULE, @@ -34,12 +33,5 @@ void __init shmobile_cpuidle_set_driver(struct cpuidle_driver *drv) int __init shmobile_cpuidle_init(void) { - struct cpuidle_device *dev = &shmobile_cpuidle_dev; - - cpuidle_register_driver(cpuidle_drv); - - dev->state_count = cpuidle_drv->state_count; - cpuidle_register_device(dev); - - return 0; + return cpuidle_register(cpuidle_drv, NULL); } -- cgit v1.2.3