diff mbox

[6/7] OMAP4: hwmod data: TEMP: Fix timer1 main_clk

Message ID 1309192391-12410-7-git-send-email-b-cousson@ti.com (mailing list archive)
State New, archived
Delegated to: Benoit Cousson
Headers show

Commit Message

Benoit Cousson June 27, 2011, 4:33 p.m. UTC
Since the timer is still not pm_runtime adapted, it is still
using directly the physical clock nodes at init time.

Replace the clock node by the original one in the clock data
file.

Keep the original name until the driver is fixed.

Signed-off-by: Benoit Cousson <b-cousson@ti.com>
Cc: Paul Walmsley <paul@pwsan.com>
Cc: Rajendra Nayak <rnayak@ti.com>
---
 arch/arm/mach-omap2/clock44xx_data.c       |   12 ++++++++----
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c |    2 +-
 2 files changed, 9 insertions(+), 5 deletions(-)

Comments

Kevin Hilman June 28, 2011, 12:19 a.m. UTC | #1
Benoit Cousson <b-cousson@ti.com> writes:

> Since the timer is still not pm_runtime adapted, it is still
> using directly the physical clock nodes at init time.
>
> Replace the clock node by the original one in the clock data
> file.
>
> Keep the original name until the driver is fixed.

Is this still needed when used with Tony's devel-timer branch?  

I assume not.

Kevin
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Benoit Cousson June 28, 2011, 9:27 a.m. UTC | #2
On 6/28/2011 2:19 AM, Hilman, Kevin wrote:
> Benoit Cousson<b-cousson@ti.com>  writes:
> 
>> Since the timer is still not pm_runtime adapted, it is still
>> using directly the physical clock nodes at init time.
>>
>> Replace the clock node by the original one in the clock data
>> file.
>>
>> Keep the original name until the driver is fixed.
> 
> Is this still needed when used with Tony's devel-timer branch?

I didn't follow what Tony did, but I'm not sure he is fixing that part.
 
> I assume not.

After checking the new timer.c file, we still have the problematic part. Only the migration to hwmod will fix that:

static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer,
						int gptimer_id,
						const char *fck_source)
{

[...]

	/* After the dmtimer is using hwmod these clocks won't be needed */
	sprintf(name, "gpt%d_fck", gptimer_id);
	timer->fclk = clk_get(NULL, name);
	if (IS_ERR(timer->fclk))
		return -ENODEV;

	sprintf(name, "gpt%d_ick", gptimer_id);
	timer->iclk = clk_get(NULL, name);
	if (IS_ERR(timer->iclk)) {
		clk_put(timer->fclk);
		return -ENODEV;
	}

There is even a comment that confirm the issue:-)

Regards,
Benoit
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Kevin Hilman June 28, 2011, 3:17 p.m. UTC | #3
"Cousson, Benoit" <b-cousson@ti.com> writes:

> On 6/28/2011 2:19 AM, Hilman, Kevin wrote:
>> Benoit Cousson<b-cousson@ti.com>  writes:
>> 
>>> Since the timer is still not pm_runtime adapted, it is still
>>> using directly the physical clock nodes at init time.
>>>
>>> Replace the clock node by the original one in the clock data
>>> file.
>>>
>>> Keep the original name until the driver is fixed.
>> 
>> Is this still needed when used with Tony's devel-timer branch?
>
> I didn't follow what Tony did, but I'm not sure he is fixing that part.
>  
>> I assume not.
>
> After checking the new timer.c file, we still have the problematic part. Only the migration to hwmod will fix that:
>
> static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer,
> 						int gptimer_id,
> 						const char *fck_source)
> {
>
> [...]
>
> 	/* After the dmtimer is using hwmod these clocks won't be needed */
> 	sprintf(name, "gpt%d_fck", gptimer_id);
> 	timer->fclk = clk_get(NULL, name);
> 	if (IS_ERR(timer->fclk))
> 		return -ENODEV;
>
> 	sprintf(name, "gpt%d_ick", gptimer_id);
> 	timer->iclk = clk_get(NULL, name);
> 	if (IS_ERR(timer->iclk)) {
> 		clk_put(timer->fclk);
> 		return -ENODEV;
> 	}
>
> There is even a comment that confirm the issue:-)

Well, I'm not sure that comment is correct either.

Tony's series converts the driver to use hwmod.  The problem is the
clocks are still needed for changing the parent, so there is still
a clk_disable, clk_set_parent, clk_enable sequence used.

Kevin
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/arm/mach-omap2/clock44xx_data.c b/arch/arm/mach-omap2/clock44xx_data.c
index 547f02b..f1cfa3c 100644
--- a/arch/arm/mach-omap2/clock44xx_data.c
+++ b/arch/arm/mach-omap2/clock44xx_data.c
@@ -1765,15 +1765,19 @@  static struct clk dmic_sync_mux_ck = {
 	.recalc		= &omap2_clksel_recalc,
 };
 
-static struct clk dmt1_clk_mux_ck = {
-	.name		= "dmt1_clk_mux_ck",
+/* Merged dmt1_clk_mux into timer1 */
+static struct clk timer1_fck = {
+	.name		= "timer1_fck",
 	.parent		= &sys_clkin_ck,
 	.clksel		= abe_dpll_bypass_clk_mux_sel,
 	.init		= &omap2_init_clksel_parent,
 	.clksel_reg	= OMAP4430_CM_WKUP_TIMER1_CLKCTRL,
 	.clksel_mask	= OMAP4430_CLKSEL_MASK,
-	.ops		= &clkops_null,
+	.ops		= &clkops_omap2_dflt,
 	.recalc		= &omap2_clksel_recalc,
+	.enable_reg	= OMAP4430_CM_WKUP_TIMER1_CLKCTRL,
+	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
+	.clkdm_name	= "l4_wkup_clkdm",
 };
 
 static const struct clksel fdif_fclk_div[] = {
@@ -2527,7 +2531,7 @@  static struct omap_clk omap44xx_clks[] = {
 	CLK(NULL,	"cm2_dm4_mux_ck",		&cm2_dm4_mux_ck,	CK_44XX),
 	CLK(NULL,	"cm2_dm9_mux_ck",		&cm2_dm9_mux_ck,	CK_44XX),
 	CLK(NULL,	"dmic_sync_mux_ck",		&dmic_sync_mux_ck,	CK_44XX),
-	CLK(NULL,	"dmt1_clk_mux_ck",		&dmt1_clk_mux_ck,	CK_44XX),
+	CLK(NULL,	"gpt1_fck",			&timer1_fck,	CK_44XX),
 	CLK(NULL,	"fdif_fclk",			&fdif_fclk,	CK_44XX),
 	CLK(NULL,	"func_dmic_abe_gfclk",		&func_dmic_abe_gfclk,	CK_44XX),
 	CLK(NULL,	"mcasp_sync_mux_ck",		&mcasp_sync_mux_ck,	CK_44XX),
diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
index 5c196a1..729b371 100644
--- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
@@ -4249,7 +4249,7 @@  static struct omap_hwmod omap44xx_timer1_hwmod = {
 	.clkdm_name	= "l4_wkup_clkdm",
 	.mpu_irqs	= omap44xx_timer1_irqs,
 	.mpu_irqs_cnt	= ARRAY_SIZE(omap44xx_timer1_irqs),
-	.main_clk	= "dmt1_clk_mux_ck",
+	.main_clk	= "timer1_fck",
 	.prcm = {
 		.omap4 = {
 			.clkctrl_offs = OMAP4_CM_WKUP_TIMER1_CLKCTRL_OFFSET,