All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 6/9] ARM: DaVinci: ASoC: Adds McASP clock support for TI DM646X processor
@ 2009-03-16 12:05 Naresh Medisetty
  2009-03-16 15:20 ` Mark Brown
  0 siblings, 1 reply; 7+ messages in thread
From: Naresh Medisetty @ 2009-03-16 12:05 UTC (permalink / raw)
  To: davinci-linux-open-source; +Cc: alsa-devel, Naresh Medisetty

Adds McASP clock support for TI DM646X processor

Signed-off-by: Naresh Medisetty <naresh@ti.com>
---
This patch applies to the DaVinci git tree available at http://git.kernel.org/?p=linux/kernel/git/khilman/linux-davinci.git;a=commit;h=486afa37130356662213cc1a2199a285b4fd72af.

 arch/arm/mach-davinci/dm646x.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-davinci/dm646x.c b/arch/arm/mach-davinci/dm646x.c
index af040cf..0aee774 100644
--- a/arch/arm/mach-davinci/dm646x.c
+++ b/arch/arm/mach-davinci/dm646x.c
@@ -185,6 +185,18 @@ static struct clk gpio_clk = {
 	.lpsc = DM646X_LPSC_GPIO,
 };
 
+static struct clk mcasp0_clk = {
+	.name = "mcasp0",
+	.parent = &pll1_sysclk3,
+	.lpsc = DM646X_LPSC_McASP0,
+};
+
+static struct clk mcasp1_clk = {
+	.name = "mcasp0",
+	.parent = &pll1_sysclk3,
+	.lpsc = DM646X_LPSC_McASP1,
+};
+
 static struct clk aemif_clk = {
 	.name = "aemif",
 	.parent = &pll1_sysclk3,
@@ -253,6 +265,8 @@ struct davinci_clk dm646x_clks[] = {
 	CLK(NULL, "uart2", &uart2_clk),
 	CLK("i2c_davinci.1", NULL, &i2c_clk),
 	CLK(NULL, "gpio", &gpio_clk),
+	CLK("soc-audio.0", NULL, &mcasp0_clk),
+	CLK("soc-audio.1", NULL, &mcasp1_clk),
 	CLK(NULL, "aemif", &aemif_clk),
 	CLK("davinci_emac.1", NULL, &emac_clk),
 	CLK(NULL, "pwm0", &pwm0_clk),
-- 
1.5.6

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 6/9] ARM: DaVinci: ASoC: Adds McASP clock support for TI DM646X processor
  2009-03-16 12:05 Naresh Medisetty
@ 2009-03-16 15:20 ` Mark Brown
  0 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2009-03-16 15:20 UTC (permalink / raw)
  To: Naresh Medisetty; +Cc: davinci-linux-open-source, alsa-devel

On Mon, Mar 16, 2009 at 08:05:25AM -0400, Naresh Medisetty wrote:

> +	CLK("soc-audio.0", NULL, &mcasp0_clk),
> +	CLK("soc-audio.1", NULL, &mcasp1_clk),

Assuming this is a shorthand for defining two platform devices for two
ASoC cards I'd suggest that you instead move towards registering clocks
for the DAIs and probing them as platform devices - take a look at how
the PXA AC97 driver now does this for an example.  The soc-audio device
will hopefully get removed at some point and you can't guarantee that
the user won't want to put the two DAIs into a single sound card.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 6/9] ARM: DaVinci: ASoC: Adds McASP clock support for TI DM646X processor
@ 2009-03-18 12:11 Medisetty, Naresh
  2009-03-19 17:38 ` Kevin Hilman
  0 siblings, 1 reply; 7+ messages in thread
From: Medisetty, Naresh @ 2009-03-18 12:11 UTC (permalink / raw)
  To: Mark Brown
  Cc: davinci-linux-open-source@linux.davincidsp.com,
	alsa-devel@alsa-project.org

> On Mon, Mar 16, 2009 at 08:05:25AM -0400, Naresh Medisetty wrote:
>
> > +     CLK("soc-audio.0", NULL, &mcasp0_clk),
> > +     CLK("soc-audio.1", NULL, &mcasp1_clk),
>
> Assuming this is a shorthand for defining two platform devices for two
> ASoC cards I'd suggest that you instead move towards registering clocks
> for the DAIs and probing them as platform devices - take a look at how
> the PXA AC97 driver now does this for an example.  The soc-audio device
> will hopefully get removed at some point and you can't guarantee that
> the user won't want to put the two DAIs into a single sound card.

Yes, This is a shorthand for defining two platform devices for two
ASoC cards.

I will re-work on this and submit a patch

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 6/9] ARM: DaVinci: ASoC: Adds McASP clock support for TI DM646X processor
  2009-03-18 12:11 [PATCH 6/9] ARM: DaVinci: ASoC: Adds McASP clock support for TI DM646X processor Medisetty, Naresh
@ 2009-03-19 17:38 ` Kevin Hilman
  2009-03-19 19:09   ` Mark Brown
  0 siblings, 1 reply; 7+ messages in thread
From: Kevin Hilman @ 2009-03-19 17:38 UTC (permalink / raw)
  To: Medisetty, Naresh
  Cc: davinci-linux-open-source@linux.davincidsp.com, Mark Brown,
	alsa-devel@alsa-project.org

"Medisetty, Naresh" <naresh@ti.com> writes:

>> On Mon, Mar 16, 2009 at 08:05:25AM -0400, Naresh Medisetty wrote:
>>
>> > +     CLK("soc-audio.0", NULL, &mcasp0_clk),
>> > +     CLK("soc-audio.1", NULL, &mcasp1_clk),
>>
>> Assuming this is a shorthand for defining two platform devices for two
>> ASoC cards I'd suggest that you instead move towards registering clocks
>> for the DAIs and probing them as platform devices - take a look at how
>> the PXA AC97 driver now does this for an example.  The soc-audio device
>> will hopefully get removed at some point and you can't guarantee that
>> the user won't want to put the two DAIs into a single sound card.
>
> Yes, This is a shorthand for defining two platform devices for two
> ASoC cards.
>

Naresh,

When you move to platform device/data way of handling the clocks
(which I would prefer as well) then these clock definitions can 
use the physical clock name:


    CLK(NULL, "mcasp0" &mcasp0_clk),
    CLK(NULL, "mcasp1", &mcasp1_clk),

The platform code can do a clk_get(<physcial name>) and pass that
clk in with the platform data.

Kevin

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 6/9] ARM: DaVinci: ASoC: Adds McASP clock support for TI DM646X processor
  2009-03-19 17:38 ` Kevin Hilman
@ 2009-03-19 19:09   ` Mark Brown
  2009-03-19 21:14     ` Kevin Hilman
  0 siblings, 1 reply; 7+ messages in thread
From: Mark Brown @ 2009-03-19 19:09 UTC (permalink / raw)
  To: Kevin Hilman
  Cc: Medisetty, Naresh, davinci-linux-open-source@linux.davincidsp.com,
	alsa-devel@alsa-project.org

On Thu, Mar 19, 2009 at 10:38:03AM -0700, Kevin Hilman wrote:

>     CLK(NULL, "mcasp0" &mcasp0_clk),
>     CLK(NULL, "mcasp1", &mcasp1_clk),

Exactly.

> The platform code can do a clk_get(<physcial name>) and pass that
> clk in with the platform data.

There should be no need to do this - the McASP DAI driver can just be a
regular platform device, probe as normal and register the DAI with the
ASoC core once it has done so.  This is, in fact, the preferred method
for doing this though support for htis is recent so only one CPU DAI
driver does it so far.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 6/9] ARM: DaVinci: ASoC: Adds McASP clock support for TI DM646X processor
  2009-03-19 19:09   ` Mark Brown
@ 2009-03-19 21:14     ` Kevin Hilman
  2009-03-19 21:28       ` David Brownell
  0 siblings, 1 reply; 7+ messages in thread
From: Kevin Hilman @ 2009-03-19 21:14 UTC (permalink / raw)
  To: Mark Brown
  Cc: Medisetty, Naresh, davinci-linux-open-source@linux.davincidsp.com,
	alsa-devel@alsa-project.org

Mark Brown <broonie@sirena.org.uk> writes:

> On Thu, Mar 19, 2009 at 10:38:03AM -0700, Kevin Hilman wrote:
>
>>     CLK(NULL, "mcasp0" &mcasp0_clk),
>>     CLK(NULL, "mcasp1", &mcasp1_clk),
>
> Exactly.
>
>> The platform code can do a clk_get(<physcial name>) and pass that
>> clk in with the platform data.
>
> There should be no need to do this - the McASP DAI driver can just be a
> regular platform device, probe as normal and register the DAI with the
> ASoC core once it has done so.  This is, in fact, the preferred method
> for doing this though support for htis is recent so only one CPU DAI
> driver does it so far.

Sure, but what I don't want in that DAI driver is conditional code
because of different clock names on different chips.  For example,
some devices may only have one clk, so the hardware name is actualy
"mcasp" instead of "mcasp0" etc.

IOW, there will always be conditional code, I would prefer it not to
be in sound/soc/* and rather see it in the chip/board specific init
code.

Kevin

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 6/9] ARM: DaVinci: ASoC: Adds McASP clock support for TI DM646X processor
  2009-03-19 21:14     ` Kevin Hilman
@ 2009-03-19 21:28       ` David Brownell
  0 siblings, 0 replies; 7+ messages in thread
From: David Brownell @ 2009-03-19 21:28 UTC (permalink / raw)
  To: Kevin Hilman
  Cc: davinci-linux-open-source, alsa-devel@alsa-project.org,
	Mark Brown, Medisetty, Naresh

On Thursday 19 March 2009, Kevin Hilman wrote:
> Sure, but what I don't want in that DAI driver is conditional code
> because of different clock names on different chips.  For example,
> some devices may only have one clk, so the hardware name is actualy
> "mcasp" instead of "mcasp0" etc.

Agreed that the clock setup should be in the arch/arm/mach-davinci
part of the tree ... but, for the record, I wouldn't find it at all
strange to see all such clocks named "mcasp0" instead of having some
boards use "mcasp" if there's only one.  :)

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-03-19 21:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-18 12:11 [PATCH 6/9] ARM: DaVinci: ASoC: Adds McASP clock support for TI DM646X processor Medisetty, Naresh
2009-03-19 17:38 ` Kevin Hilman
2009-03-19 19:09   ` Mark Brown
2009-03-19 21:14     ` Kevin Hilman
2009-03-19 21:28       ` David Brownell
  -- strict thread matches above, loose matches on Subject: below --
2009-03-16 12:05 Naresh Medisetty
2009-03-16 15:20 ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.