diff mbox

[v3,07/13] pm: at91: remove the config item CONFIG_AT91_SLOW_CLOCK

Message ID 1422338247-5945-1-git-send-email-wenyou.yang@atmel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Wenyou Yang Jan. 27, 2015, 5:57 a.m. UTC
The slow clock always exists, for the suspend to memory mode,
the master clock always switch to the slow clock.

To simplify the PM config, remove this config item, remove
the definition code as well.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
 arch/arm/mach-at91/Kconfig  |   13 -------------
 arch/arm/mach-at91/Makefile |    2 +-
 arch/arm/mach-at91/pm.c     |    7 -------
 3 files changed, 1 insertion(+), 21 deletions(-)

Comments

Sylvain Rochet Jan. 27, 2015, 9:55 a.m. UTC | #1
Hello Wenyou,

On Tue, Jan 27, 2015 at 01:57:27PM +0800, Wenyou Yang wrote:
>  
>  static void __init at91_pm_init(void)
>  {
> -#ifdef CONFIG_AT91_SLOW_CLOCK
>  	at91_pm_sram_init();
> -#endif
>  
>  	pr_info("AT91: Power Management%s\n", (slow_clock ? " (with slow clock mode)" : ""));

Details, but the ternary operation can be removed here, slow_clock now 
defines whether we have PM support at all, not whether we have 
slow_clock mode available.

Maybe we should not even display this message on the console if we 
failed to allocate sram for slow_clock, we already fired a message 
saying that PM is not available at all in at91_pm_sram_init().

Sylvain
Alexandre Belloni Jan. 27, 2015, 10:07 a.m. UTC | #2
Hi,

On 27/01/2015 at 10:55:15 +0100, Sylvain Rochet wrote :
> Hello Wenyou,
> 
> On Tue, Jan 27, 2015 at 01:57:27PM +0800, Wenyou Yang wrote:
> >  
> >  static void __init at91_pm_init(void)
> >  {
> > -#ifdef CONFIG_AT91_SLOW_CLOCK
> >  	at91_pm_sram_init();
> > -#endif
> >  
> >  	pr_info("AT91: Power Management%s\n", (slow_clock ? " (with slow clock mode)" : ""));
> 
> Details, but the ternary operation can be removed here, slow_clock now 
> defines whether we have PM support at all, not whether we have 
> slow_clock mode available.
> 
> Maybe we should not even display this message on the console if we 
> failed to allocate sram for slow_clock, we already fired a message 
> saying that PM is not available at all in at91_pm_sram_init().
> 

That is done in patch 10/13.
Sylvain Rochet Jan. 27, 2015, 10:13 a.m. UTC | #3
Hi,

On Tue, Jan 27, 2015 at 11:07:42AM +0100, Alexandre Belloni wrote:
> Hi,
> 
> On 27/01/2015 at 10:55:15 +0100, Sylvain Rochet wrote :
> > Hello Wenyou,
> > 
> > On Tue, Jan 27, 2015 at 01:57:27PM +0800, Wenyou Yang wrote:
> > >  
> > >  static void __init at91_pm_init(void)
> > >  {
> > > -#ifdef CONFIG_AT91_SLOW_CLOCK
> > >  	at91_pm_sram_init();
> > > -#endif
> > >  
> > >  	pr_info("AT91: Power Management%s\n", (slow_clock ? " (with slow clock mode)" : ""));
> > 
> > Details, but the ternary operation can be removed here, slow_clock now 
> > defines whether we have PM support at all, not whether we have 
> > slow_clock mode available.
> > 
> > Maybe we should not even display this message on the console if we 
> > failed to allocate sram for slow_clock, we already fired a message 
> > saying that PM is not available at all in at91_pm_sram_init().
> 
> That is done in patch 10/13.

Indeed… I missed that because 10/13 is a rename patch, this should be 
done here IMHO :)

Sylvain
diff mbox

Patch

diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index cbaf0c8..0af6744 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -160,19 +160,6 @@  endif # SOC_SAM_V4_V5
 
 comment "AT91 Feature Selections"
 
-config AT91_SLOW_CLOCK
-	bool "Suspend-to-RAM disables main oscillator"
-	depends on SUSPEND
-	help
-	  Select this if you want Suspend-to-RAM to save the most power
-	  possible (without powering off the CPU) by disabling the PLLs
-	  and main oscillator so that only the 32 KiHz clock is available.
-
-	  When only that slow-clock is available, some peripherals lose
-	  functionality.  Many can't issue wakeup events unless faster
-	  clocks are available.  Some lose their operating state and
-	  need to be completely re-initialized.
-
 config AT91_TIMER_HZ
        int "Kernel HZ (jiffies per second)"
        range 32 1024
diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
index 8ef7d9a..13dd3e6 100644
--- a/arch/arm/mach-at91/Makefile
+++ b/arch/arm/mach-at91/Makefile
@@ -27,7 +27,7 @@  obj-$(CONFIG_SOC_SAMA5)		+= board-dt-sama5.o
 
 # Power Management
 obj-$(CONFIG_PM)		+= pm.o
-obj-$(CONFIG_AT91_SLOW_CLOCK)	+= pm_slowclock.o
+obj-$(CONFIG_PM)		+= pm_slowclock.o
 
 ifeq ($(CONFIG_PM_DEBUG),y)
 CFLAGS_pm.o += -DDEBUG
diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
index 6b08098..0377c0d 100644
--- a/arch/arm/mach-at91/pm.c
+++ b/arch/arm/mach-at91/pm.c
@@ -133,11 +133,9 @@  EXPORT_SYMBOL(at91_suspend_entering_slow_clock);
 static void (*slow_clock)(void __iomem *pmc, void __iomem *ramc0,
 			  void __iomem *ramc1, int memctrl);
 
-#ifdef CONFIG_AT91_SLOW_CLOCK
 extern void at91_slow_clock(void __iomem *pmc, void __iomem *ramc0,
 			    void __iomem *ramc1, int memctrl);
 extern u32 at91_slow_clock_sz;
-#endif
 
 static int at91_pm_enter(suspend_state_t state)
 {
@@ -232,7 +230,6 @@  void at91_pm_set_standby(void (*at91_standby)(void))
 	}
 }
 
-#ifdef CONFIG_AT91_SLOW_CLOCK
 static void __init at91_pm_sram_init(void)
 {
 	struct gen_pool *sram_pool;
@@ -274,14 +271,10 @@  static void __init at91_pm_sram_init(void)
 put_node:
 	of_node_put(node);
 }
-#endif
-
 
 static void __init at91_pm_init(void)
 {
-#ifdef CONFIG_AT91_SLOW_CLOCK
 	at91_pm_sram_init();
-#endif
 
 	pr_info("AT91: Power Management%s\n", (slow_clock ? " (with slow clock mode)" : ""));