Skip to contentSkip to conversation

ARM: OMAP4: clock: Add aliases for McBSP fclk clocks

PATCH New Peter Ujfalusi 3 participants 7 messages Mar 6, 2012 – Mar 12, 2012

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: OMAP4: clock: Add aliases for McBSP fclk clocks

CLKS signal for McBSP ports can be selected from internal (PRCM) or external (ABE_CLKS pin) source.
To be able to use existing code we need to create clock aliases consistent among OMAP2/3/4.

---

Hi,

this patch should fix the clock reparenting on OMAP4 for McBSP ports.

Regards,
Peter

 arch/arm/mach-omap2/clock44xx_data.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/clock44xx_data.c +8 -0
index 08e86d7..7e76ac3 100644
@@ -3120,6 +3120,10 @@ static struct clk auxclkreq5_ck = {
 static struct omap_clk omap44xx_clks[] = {
 	CLK(NULL,	"extalt_clkin_ck",		&extalt_clkin_ck,	CK_443X),
 	CLK(NULL,	"pad_clks_ck",			&pad_clks_ck,	CK_443X),
+	CLK("omap-mcbsp.1",	"pad_fck",		&pad_clks_ck,	CK_443X),
+	CLK("omap-mcbsp.2",	"pad_fck",		&pad_clks_ck,	CK_443X),
+	CLK("omap-mcbsp.3",	"pad_fck",		&pad_clks_ck,	CK_443X),
+	CLK("omap-mcbsp.4",	"pad_fck",		&pad_clks_ck,	CK_443X),
 	CLK(NULL,	"pad_slimbus_core_clks_ck",	&pad_slimbus_core_clks_ck,	CK_443X),
 	CLK(NULL,	"secure_32k_clk_src_ck",	&secure_32k_clk_src_ck,	CK_443X),
 	CLK(NULL,	"slimbus_clk",			&slimbus_clk,	CK_443X),
@@ -3254,12 +3258,16 @@ static struct omap_clk omap44xx_clks[] = {
 	CLK(NULL,	"mcasp_sync_mux_ck",		&mcasp_sync_mux_ck,	CK_443X),
 	CLK(NULL,	"mcasp_fck",			&mcasp_fck,	CK_443X),
 	CLK(NULL,	"mcbsp1_sync_mux_ck",		&mcbsp1_sync_mux_ck,	CK_443X),
+	CLK("omap-mcbsp.1",	"prcm_fck",		&mcbsp1_sync_mux_ck,	CK_443X),
 	CLK(NULL,	"mcbsp1_fck",			&mcbsp1_fck,	CK_443X),
 	CLK(NULL,	"mcbsp2_sync_mux_ck",		&mcbsp2_sync_mux_ck,	CK_443X),
+	CLK("omap-mcbsp.2",	"prcm_fck",		&mcbsp2_sync_mux_ck,	CK_443X),
 	CLK(NULL,	"mcbsp2_fck",			&mcbsp2_fck,	CK_443X),
 	CLK(NULL,	"mcbsp3_sync_mux_ck",		&mcbsp3_sync_mux_ck,	CK_443X),
+	CLK("omap-mcbsp.3",	"prcm_fck",		&mcbsp3_sync_mux_ck,	CK_443X),
 	CLK(NULL,	"mcbsp3_fck",			&mcbsp3_fck,	CK_443X),
 	CLK(NULL,	"mcbsp4_sync_mux_ck",		&mcbsp4_sync_mux_ck,	CK_443X),
+	CLK("omap-mcbsp.4",	"prcm_fck",		&mcbsp4_sync_mux_ck,	CK_443X),
 	CLK(NULL,	"mcbsp4_fck",			&mcbsp4_fck,	CK_443X),
 	CLK(NULL,	"mcpdm_fck",			&mcpdm_fck,	CK_443X),
 	CLK(NULL,	"mcspi1_fck",			&mcspi1_fck,	CK_443X),
Signature · 1 line
1.7.8.5
#1 lore raw

PATCH 1/1 ARM: OMAP4: clock: Add aliases for McBSP fclk clocks

Hi Paul, Tony,

Quoted 4 lines · Peter Ujfalusi

CLKS signal for McBSP ports can be selected from internal (PRCM) or external (ABE_CLKS pin) source.
To be able to use existing code we need to create clock aliases consistent among OMAP2/3/4.

Would you be able to take a look at this patch?

Thanks,
P?ter

maintainer
#2 lore raw

PATCH 1/1 ARM: OMAP4: clock: Add aliases for McBSP fclk clocks

Quoted 9 lines · Peter Ujfalusi

Hi Paul, Tony,

Quoted 4 lines · Peter Ujfalusi

CLKS signal for McBSP ports can be selected from internal (PRCM) or external (ABE_CLKS pin) source.
To be able to use existing code we need to create clock aliases consistent among OMAP2/3/4.

Would you be able to take a look at this patch?

To me this looks safe to merge via ASoC tree, assuming Paul acks it too, and it does not cause merge conflicts with Paul's changes:

maintainer
#3 lore raw

PATCH 1/1 ARM: OMAP4: clock: Add aliases for McBSP fclk clocks

Quoted 9 lines · Tony Lindgren
Quoted 8 lines · Peter Ujfalusi

Hi Paul, Tony,

Quoted 4 lines · Peter Ujfalusi

CLKS signal for McBSP ports can be selected from internal (PRCM) or external (ABE_CLKS pin) source.
To be able to use existing code we need to create clock aliases consistent among OMAP2/3/4.

Quoted 7 lines
Quoted 1 line

Would you be able to take a look at this patch?

To me this looks safe to merge via ASoC tree, assuming Paul acks it too, and it does not cause merge conflicts with Paul's changes:

Please let's not merge this one yet. It should not be necessary to change the clkdev aliases, this change should occur in the hwmod code.

- Paul

maintainer
#4 lore raw

PATCH 1/1 ARM: OMAP4: clock: Add aliases for McBSP fclk clocks

Quoted 2 lines · Paul Walmsley

Please let's not merge this one yet. It should not be necessary to change the clkdev aliases, this change should occur in the hwmod code.

Sorry, sent this too quickly. Not the hwmod code, but the opt_clks aliases in the hwmod data.

- Paul

maintainer
#5 lore raw

PATCH 1/1 ARM: OMAP4: clock: Add aliases for McBSP fclk clocks

Hello P?ter

could you please try this patch instead of the clkdev change?

It is based on my 'hwmod_enable_remaining_hwmods_devel_3.4' branch, but the basic idea should work on v3.3-rc6 as well.

If it works for you, please let us know and we can queue this up along with the hwmod data changes. Probably we should replace the changelog also with the one from your patch, it might be a little more useful? Suggestions welcome.

- Paul

From: Paul Walmsley <[email protected]>
Date: Fri, 9 Mar 2012 23:28:28 -0700
Subject: [PATCH] ARM: OMAP4: hwmod data: add McBSP parent clock aliases

Add optional parent clocks for the OMAP4 McBSP modules so the driver can switch between parent clocks.

Based on a patch from P?ter Ujfalusi <[email protected]>.

---
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/omap_hwmod_44xx_data.c +28 -0
index e029992..b4a061d 100644
@@ -1921,6 +1921,11 @@ static struct omap_hwmod_dma_info omap44xx_mcbsp1_sdma_reqs[] = {
 	{ .dma_req = -1 }
 };
 
+static struct omap_hwmod_opt_clk mcbsp1_opt_clks[] = {
+	{ .role = "pad_fck", .clk = "pad_clks_ck" },
+	{ .role = "prcm_clk", .clk = "mcbsp1_sync_mux_ck" },
+};
+
 static struct omap_hwmod omap44xx_mcbsp1_hwmod = {
 	.name		= "mcbsp1",
 	.class		= &omap44xx_mcbsp_hwmod_class,
@@ -1935,6 +1940,8 @@ static struct omap_hwmod omap44xx_mcbsp1_hwmod = {
 			.modulemode   = MODULEMODE_SWCTRL,
 		},
 	},
+	.opt_clks	= mcbsp1_opt_clks,
+	.opt_clks_cnt	= ARRAY_SIZE(mcbsp1_opt_clks),
 };
 
 /* mcbsp2 */
@@ -1949,6 +1956,11 @@ static struct omap_hwmod_dma_info omap44xx_mcbsp2_sdma_reqs[] = {
 	{ .dma_req = -1 }
 };
 
+static struct omap_hwmod_opt_clk mcbsp2_opt_clks[] = {
+	{ .role = "pad_fck", .clk = "pad_clks_ck" },
+	{ .role = "prcm_clk", .clk = "mcbsp2_sync_mux_ck" },
+};
+
 static struct omap_hwmod omap44xx_mcbsp2_hwmod = {
 	.name		= "mcbsp2",
 	.class		= &omap44xx_mcbsp_hwmod_class,
@@ -1963,6 +1975,8 @@ static struct omap_hwmod omap44xx_mcbsp2_hwmod = {
 			.modulemode   = MODULEMODE_SWCTRL,
 		},
 	},
+	.opt_clks	= mcbsp2_opt_clks,
+	.opt_clks_cnt	= ARRAY_SIZE(mcbsp2_opt_clks),
 };
 
 /* mcbsp3 */
@@ -1977,6 +1991,11 @@ static struct omap_hwmod_dma_info omap44xx_mcbsp3_sdma_reqs[] = {
 	{ .dma_req = -1 }
 };
 
+static struct omap_hwmod_opt_clk mcbsp3_opt_clks[] = {
+	{ .role = "pad_fck", .clk = "pad_clks_ck" },
+	{ .role = "prcm_clk", .clk = "mcbsp3_sync_mux_ck" },
+};
+
 static struct omap_hwmod omap44xx_mcbsp3_hwmod = {
 	.name		= "mcbsp3",
 	.class		= &omap44xx_mcbsp_hwmod_class,
@@ -1991,6 +2010,8 @@ static struct omap_hwmod omap44xx_mcbsp3_hwmod = {
 			.modulemode   = MODULEMODE_SWCTRL,
 		},
 	},
+	.opt_clks	= mcbsp3_opt_clks,
+	.opt_clks_cnt	= ARRAY_SIZE(mcbsp3_opt_clks),
 };
 
 /* mcbsp4 */
@@ -2005,6 +2026,11 @@ static struct omap_hwmod_dma_info omap44xx_mcbsp4_sdma_reqs[] = {
 	{ .dma_req = -1 }
 };
 
+static struct omap_hwmod_opt_clk mcbsp4_opt_clks[] = {
+	{ .role = "pad_fck", .clk = "pad_clks_ck" },
+	{ .role = "prcm_clk", .clk = "mcbsp4_sync_mux_ck" },
+};
+
 static struct omap_hwmod omap44xx_mcbsp4_hwmod = {
 	.name		= "mcbsp4",
 	.class		= &omap44xx_mcbsp_hwmod_class,
@@ -2019,6 +2045,8 @@ static struct omap_hwmod omap44xx_mcbsp4_hwmod = {
 			.modulemode   = MODULEMODE_SWCTRL,
 		},
 	},
+	.opt_clks	= mcbsp4_opt_clks,
+	.opt_clks_cnt	= ARRAY_SIZE(mcbsp4_opt_clks),
 };
 
 /*
Signature · 1 line
1.7.9.1
#6 lore raw

PATCH 1/1 ARM: OMAP4: clock: Add aliases for McBSP fclk clocks

Hello Paul,

Quoted 5 lines · Paul Walmsley

Hello P?ter

could you please try this patch instead of the clkdev change?

Quoted 7 lines

It is based on my 'hwmod_enable_remaining_hwmods_devel_3.4' branch, but the basic idea should work on v3.3-rc6 as well.

If it works for you, please let us know and we can queue this up along with the hwmod data changes. Probably we should replace the changelog also with the one from your patch, it might be a little more useful? Suggestions welcome.

Unfortunately I can not test the McBSP on OMAP4 at the moment. The patch looks good, and as far as I can see it will be perfect for OMAP4. Thank you.
In case you need:

Quoted 6 lines

From: Paul Walmsley <[email protected]>
Date: Fri, 9 Mar 2012 23:28:28 -0700
Subject: [PATCH] ARM: OMAP4: hwmod data: add McBSP parent clock aliases

Add optional parent clocks for the OMAP4 McBSP modules so the driver can switch between parent clocks.