diff options
| author | Arnd Bergmann <arnd@arndb.de> | 2012-11-15 17:38:24 +0100 | 
|---|---|---|
| committer | Arnd Bergmann <arnd@arndb.de> | 2012-11-15 17:38:24 +0100 | 
| commit | fb6842a7bc44bf719bfe85d5819a153d7c215510 (patch) | |
| tree | d68f98b9a905557ad95ba97090e99087da30fabd /arch/arm/mach-omap2/omap_hwmod.c | |
| parent | 89ab216b33ba9405880fd3d89531305a931bc70f (diff) | |
| parent | 558a0780b0a04862a678f7823215424b4e5501f9 (diff) | |
| download | olio-linux-3.10-fb6842a7bc44bf719bfe85d5819a153d7c215510.tar.xz olio-linux-3.10-fb6842a7bc44bf719bfe85d5819a153d7c215510.zip  | |
Merge tag 'omap-for-v3.8/clock-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/clk
From Tony Lindgren <tony@atomide.com>:
Common clock framework for omap2+ via Paul Walmsley <paul@pwsan.com>:
Convert the OMAP2+ clock code and data to rely on the common
clock framework for internal bookkeeping and the driver API.
Basic test logs for this branch on top of Tony's cleanup-prcm branch
at commit c9d501e5cb0238910337213e12a09127221c35d8 are here:
http://www.pwsan.com/omap/testlogs/common_clk_devel_3.8_rebase/20121112192516/
However, cleanup-prcm at c9d501e5 does not include some fixes
that are needed for a successful test.  With several reverts,
fixes, and workarounds applied, the following test logs were
obtained:
http://www.pwsan.com/omap/testlogs/TEST_common_clk_devel_3.8_rebase/20121112192300/
which indicate that the series tests cleanly.
N.B. The common clock data addition patches result in many
checkpatch warnings of the form "WARNING: static const char *
array should probably be static const char * const".  However, it
appears that resolving these would require changes to the CCF
itself.  So the resolution of these warnings is being postponed
until that can be coordinated.
These patches result in a ~55KiB increase in runtime kernel memory
usage when booting omap2plus_defconfig kernels.
Conflicts:
	arch/arm/mach-omap2/clock33xx_data.c
	arch/arm/mach-omap2/clock3xxx_data.c
	arch/arm/mach-omap2/clock44xx_data.c
Note that this is based on a merge of the omap-for-v3.8/cleanup-prcm
and omap-for-v3.8/pm as otherwise merged in with the pm changes it
would automatically resolve into a non-booting merge for omap3 as
the smartreflex clock names were changed in the pm branch.
* tag 'omap-for-v3.8/clock-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: (27 commits)
  ARM: OMAP2+: clock: Cleanup !CONFIG_COMMON_CLK parts
  ARM: OMAP2xxx: clock: drop obsolete clock data
  ARM: OMAP2: clock: Cleanup !CONFIG_COMMON_CLK parts
  ARM: OMAP3+: DPLL: drop !CONFIG_COMMON_CLK sections
  ARM: AM33xx: clock: drop obsolete clock data
  ARM: OMAP3xxx: clk: drop obsolete clock data
  ARM: OMAP3: clock: Cleanup !CONFIG_COMMON_CLK parts
  ARM: OMAP44xx: clock: drop obsolete clock data
  ARM: OMAP4: clock: Cleanup !CONFIG_COMMON_CLK parts
  ARM: OMAP: hwmod: Cleanup !CONFIG_COMMON_CLK parts
  ARM: OMAP: clock: Switch to COMMON clk
  ARM: OMAP2: clock: Add 24xx data using common struct clk
  ARM: OMAP3: clock: Add 3xxx data using common struct clk
  ARM: AM33XX: clock: add clock data in common clock format
  ARM: OMAP4: clock: Add 44xx data using common struct clk
  ARM: OMAP2+: clock: add OMAP CCF convenience macros to mach-omap2/clock.h
  ARM: OMAP: clock: Get rid of some clkdm assocations within clks
  ARM: OMAP2+: clockdomain: bypass clockdomain handling when disabling unused clks
  ARM: OMAP2+: hwmod: Invoke init_clkdm before other init functions
  ARM: OMAP: clock: Define a function to enable clocks at init
  ...
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/arm/mach-omap2/omap_hwmod.c')
| -rw-r--r-- | arch/arm/mach-omap2/omap_hwmod.c | 63 | 
1 files changed, 46 insertions, 17 deletions
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index 139adca3bda..68616b2b5b9 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c @@ -130,7 +130,7 @@  #include <linux/kernel.h>  #include <linux/errno.h>  #include <linux/io.h> -#include <linux/clk.h> +#include <linux/clk-provider.h>  #include <linux/delay.h>  #include <linux/err.h>  #include <linux/list.h> @@ -614,6 +614,19 @@ static int _disable_wakeup(struct omap_hwmod *oh, u32 *v)  	return 0;  } +static struct clockdomain *_get_clkdm(struct omap_hwmod *oh) +{ +	struct clk_hw_omap *clk; + +	if (oh->clkdm) { +		return oh->clkdm; +	} else if (oh->_clk) { +		clk = to_clk_hw_omap(__clk_get_hw(oh->_clk)); +		return  clk->clkdm; +	} +	return NULL; +} +  /**   * _add_initiator_dep: prevent @oh from smart-idling while @init_oh is active   * @oh: struct omap_hwmod * @@ -629,13 +642,18 @@ static int _disable_wakeup(struct omap_hwmod *oh, u32 *v)   */  static int _add_initiator_dep(struct omap_hwmod *oh, struct omap_hwmod *init_oh)  { -	if (!oh->_clk) +	struct clockdomain *clkdm, *init_clkdm; + +	clkdm = _get_clkdm(oh); +	init_clkdm = _get_clkdm(init_oh); + +	if (!clkdm || !init_clkdm)  		return -EINVAL; -	if (oh->_clk->clkdm && oh->_clk->clkdm->flags & CLKDM_NO_AUTODEPS) +	if (clkdm && clkdm->flags & CLKDM_NO_AUTODEPS)  		return 0; -	return clkdm_add_sleepdep(oh->_clk->clkdm, init_oh->_clk->clkdm); +	return clkdm_add_sleepdep(clkdm, init_clkdm);  }  /** @@ -653,13 +671,18 @@ static int _add_initiator_dep(struct omap_hwmod *oh, struct omap_hwmod *init_oh)   */  static int _del_initiator_dep(struct omap_hwmod *oh, struct omap_hwmod *init_oh)  { -	if (!oh->_clk) +	struct clockdomain *clkdm, *init_clkdm; + +	clkdm = _get_clkdm(oh); +	init_clkdm = _get_clkdm(init_oh); + +	if (!clkdm || !init_clkdm)  		return -EINVAL; -	if (oh->_clk->clkdm && oh->_clk->clkdm->flags & CLKDM_NO_AUTODEPS) +	if (clkdm && clkdm->flags & CLKDM_NO_AUTODEPS)  		return 0; -	return clkdm_del_sleepdep(oh->_clk->clkdm, init_oh->_clk->clkdm); +	return clkdm_del_sleepdep(clkdm, init_clkdm);  }  /** @@ -693,7 +716,7 @@ static int _init_main_clk(struct omap_hwmod *oh)  	 */  	clk_prepare(oh->_clk); -	if (!oh->_clk->clkdm) +	if (!_get_clkdm(oh))  		pr_debug("omap_hwmod: %s: missing clockdomain for %s.\n",  			   oh->name, oh->main_clk); @@ -1276,6 +1299,7 @@ static void _enable_sysc(struct omap_hwmod *oh)  	u8 idlemode, sf;  	u32 v;  	bool clkdm_act; +	struct clockdomain *clkdm;  	if (!oh->class->sysc)  		return; @@ -1283,11 +1307,9 @@ static void _enable_sysc(struct omap_hwmod *oh)  	v = oh->_sysc_cache;  	sf = oh->class->sysc->sysc_flags; +	clkdm = _get_clkdm(oh);  	if (sf & SYSC_HAS_SIDLEMODE) { -		clkdm_act = ((oh->clkdm && -			      oh->clkdm->flags & CLKDM_ACTIVE_WITH_MPU) || -			     (oh->_clk && oh->_clk->clkdm && -			      oh->_clk->clkdm->flags & CLKDM_ACTIVE_WITH_MPU)); +		clkdm_act = (clkdm && clkdm->flags & CLKDM_ACTIVE_WITH_MPU);  		if (clkdm_act && !(oh->class->sysc->idlemodes &  				   (SIDLE_SMART | SIDLE_SMART_WKUP)))  			idlemode = HWMOD_IDLEMODE_FORCE; @@ -1489,11 +1511,12 @@ static int _init_clocks(struct omap_hwmod *oh, void *data)  	pr_debug("omap_hwmod: %s: looking up clocks\n", oh->name); +	if (soc_ops.init_clkdm) +		ret |= soc_ops.init_clkdm(oh); +  	ret |= _init_main_clk(oh);  	ret |= _init_interface_clks(oh);  	ret |= _init_opt_clks(oh); -	if (soc_ops.init_clkdm) -		ret |= soc_ops.init_clkdm(oh);  	if (!ret)  		oh->_state = _HWMOD_STATE_CLKS_INITED; @@ -3556,10 +3579,15 @@ struct powerdomain *omap_hwmod_get_pwrdm(struct omap_hwmod *oh)  {  	struct clk *c;  	struct omap_hwmod_ocp_if *oi; +	struct clockdomain *clkdm; +	struct clk_hw_omap *clk;  	if (!oh)  		return NULL; +	if (oh->clkdm) +		return oh->clkdm->pwrdm.ptr; +  	if (oh->_clk) {  		c = oh->_clk;  	} else { @@ -3569,11 +3597,12 @@ struct powerdomain *omap_hwmod_get_pwrdm(struct omap_hwmod *oh)  		c = oi->_clk;  	} -	if (!c->clkdm) +	clk = to_clk_hw_omap(__clk_get_hw(c)); +	clkdm = clk->clkdm; +	if (!clkdm)  		return NULL; -	return c->clkdm->pwrdm.ptr; - +	return clkdm->pwrdm.ptr;  }  /**  |