linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: Atmel: ClassD: Set GCK's parent clock
@ 2015-11-19  3:26 Songjun Wu
  2015-11-20 18:08 ` Mark Brown
  0 siblings, 1 reply; 3+ messages in thread
From: Songjun Wu @ 2015-11-19  3:26 UTC (permalink / raw)
  To: broonie
  Cc: linux-arm-kernel, Songjun Wu, Nicolas Ferre, Liam Girdwood,
	Jaroslav Kysela, Takashi Iwai, alsa-devel, linux-kernel

Set GCK's parent clock as audio clock, make
sure the GCK's parent clock is audio clock.

Signed-off-by: Songjun Wu <songjun.wu@atmel.com>
---

 sound/soc/atmel/atmel-classd.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/sound/soc/atmel/atmel-classd.c b/sound/soc/atmel/atmel-classd.c
index 8276675..2f5190b 100644
--- a/sound/soc/atmel/atmel-classd.c
+++ b/sound/soc/atmel/atmel-classd.c
@@ -588,6 +588,12 @@ static int atmel_classd_probe(struct platform_device *pdev)
 		return ret;
 	}
 
+	ret = clk_set_parent(dd->gclk, dd->aclk);
+	if (ret) {
+		dev_err(dev, "failed to set GCK parent clock: %d\n", ret);
+		return ret;
+	}
+
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!res) {
 		dev_err(dev, "no memory resource\n");
-- 
1.7.9.5


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

* Re: [PATCH] ASoC: Atmel: ClassD: Set GCK's parent clock
  2015-11-19  3:26 [PATCH] ASoC: Atmel: ClassD: Set GCK's parent clock Songjun Wu
@ 2015-11-20 18:08 ` Mark Brown
  2015-11-23  3:01   ` Wu, Songjun
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Brown @ 2015-11-20 18:08 UTC (permalink / raw)
  To: Songjun Wu
  Cc: linux-arm-kernel, Nicolas Ferre, Liam Girdwood, Jaroslav Kysela,
	Takashi Iwai, alsa-devel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 526 bytes --]

On Thu, Nov 19, 2015 at 11:26:30AM +0800, Songjun Wu wrote:
> Set GCK's parent clock as audio clock, make
> sure the GCK's parent clock is audio clock.

> +	ret = clk_set_parent(dd->gclk, dd->aclk);
> +	if (ret) {
> +		dev_err(dev, "failed to set GCK parent clock: %d\n", ret);
> +		return ret;
> +	}

Why are we doing this in the driver?  This should be done by whatever
creates the clock tree, not by the driver that uses the clocks - that
way if some future SoC has a different clock tree the driver will
continue to work.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [PATCH] ASoC: Atmel: ClassD: Set GCK's parent clock
  2015-11-20 18:08 ` Mark Brown
@ 2015-11-23  3:01   ` Wu, Songjun
  0 siblings, 0 replies; 3+ messages in thread
From: Wu, Songjun @ 2015-11-23  3:01 UTC (permalink / raw)
  To: Mark Brown
  Cc: linux-arm-kernel, Nicolas Ferre, Liam Girdwood, Jaroslav Kysela,
	Takashi Iwai, alsa-devel, linux-kernel



On 11/21/2015 02:08, Mark Brown wrote:
> On Thu, Nov 19, 2015 at 11:26:30AM +0800, Songjun Wu wrote:
>> Set GCK's parent clock as audio clock, make
>> sure the GCK's parent clock is audio clock.
>
>> +	ret = clk_set_parent(dd->gclk, dd->aclk);
>> +	if (ret) {
>> +		dev_err(dev, "failed to set GCK parent clock: %d\n", ret);
>> +		return ret;
>> +	}
>
> Why are we doing this in the driver?  This should be done by whatever
> creates the clock tree, not by the driver that uses the clocks - that
> way if some future SoC has a different clock tree the driver will
> continue to work.
>

You are right. The GCK's parent clock should be assigned in device tree, 
not in the driver. The DT binding for classD should be modified to set 
the GCK's parent clock as audio clock.
Thank you.

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

end of thread, other threads:[~2015-11-23  3:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-19  3:26 [PATCH] ASoC: Atmel: ClassD: Set GCK's parent clock Songjun Wu
2015-11-20 18:08 ` Mark Brown
2015-11-23  3:01   ` Wu, Songjun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).