[06/19] ASoC: rsnd: add .set_sysclk on snd_soc_dai_ops
diff mbox

Message ID 874n3n90qt.wl%kuninori.morimoto.gx@gmail.com
State New, archived
Headers show

Commit Message

Kuninori Morimoto Feb. 25, 2014, 6:15 a.m. UTC
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

This patch adds struct snd_soc_dai_ops :: set_sysclk.
But, it do nothing, since rsnd sysclk is controlled by ADG.
Without this patch, simple-card init will be failed
if DT case.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/sh/rcar/core.c |    8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Mark Brown March 3, 2014, 1:18 a.m. UTC | #1
On Mon, Feb 24, 2014 at 10:15:25PM -0800, Kuninori Morimoto wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> 
> This patch adds struct snd_soc_dai_ops :: set_sysclk.
> But, it do nothing, since rsnd sysclk is controlled by ADG.
> Without this patch, simple-card init will be failed
> if DT case.

We should fix the simple-card code so that it does not need this rather
than adding empty functions to all the drivers - I'd expect it to handle
-ENOTSUPP as not an error.
Kuninori Morimoto March 3, 2014, 2:08 a.m. UTC | #2
Hi Mark

> > This patch adds struct snd_soc_dai_ops :: set_sysclk.
> > But, it do nothing, since rsnd sysclk is controlled by ADG.
> > Without this patch, simple-card init will be failed
> > if DT case.
> 
> We should fix the simple-card code so that it does not need this rather
> than adding empty functions to all the drivers - I'd expect it to handle
> -ENOTSUPP as not an error.

Ahh...

Current simple-card will get sysclk absolutely in normal (?) way.
Can you see end of asoc_simple_card_sub_parse_of() ?

rsnd got sysclk from it, but it is "module" clock, not "sysclk".

I guess I can avoid this issue if dtsi has

	system-clock-frequency = 0;

but it is strange.
Kuninori Morimoto March 3, 2014, 2:12 a.m. UTC | #3
Hi Mark again

> > > This patch adds struct snd_soc_dai_ops :: set_sysclk.
> > > But, it do nothing, since rsnd sysclk is controlled by ADG.
> > > Without this patch, simple-card init will be failed
> > > if DT case.
> > 
> > We should fix the simple-card code so that it does not need this rather
> > than adding empty functions to all the drivers - I'd expect it to handle
> > -ENOTSUPP as not an error.
> 
> Ahh...
> 
> Current simple-card will get sysclk absolutely in normal (?) way.
> Can you see end of asoc_simple_card_sub_parse_of() ?
> 
> rsnd got sysclk from it, but it is "module" clock, not "sysclk".
> 
> I guess I can avoid this issue if dtsi has
> 
> 	system-clock-frequency = 0;
> 
> but it is strange.

Oops, I was misunderstanding.
I see, I will add -ENOTSUPP support.
Kuninori Morimoto March 3, 2014, 7:45 a.m. UTC | #4
Hi Mark again

> > > We should fix the simple-card code so that it does not need this rather
> > > than adding empty functions to all the drivers - I'd expect it to handle
> > > -ENOTSUPP as not an error.
(snip)
> Oops, I was misunderstanding.
> I see, I will add -ENOTSUPP support.

Current mark/topic/simple already has -ENOTSUPP support.
Thank you

Patch
diff mbox

diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
index f0745af..98771f7 100644
--- a/sound/soc/sh/rcar/core.c
+++ b/sound/soc/sh/rcar/core.c
@@ -571,9 +571,17 @@  static int rsnd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
 	return 0;
 }
 
+static int rsnd_soc_dai_set_sysclk(struct snd_soc_dai *codec_dai,
+				   int clk_id, unsigned int freq, int dir)
+{
+	/* rsnd sysclk is controlled by ADG */
+	return 0;
+}
+
 static const struct snd_soc_dai_ops rsnd_soc_dai_ops = {
 	.trigger	= rsnd_soc_dai_trigger,
 	.set_fmt	= rsnd_soc_dai_set_fmt,
+	.set_sysclk	= rsnd_soc_dai_set_sysclk,
 };
 
 static int rsnd_dai_probe(struct platform_device *pdev,