From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: linux-sh@vger.kernel.org
Subject: Re: [PATCH] ARM: shmobile: r8a7790: add audio clocks
Date: Wed, 08 Jan 2014 00:40:01 +0000 [thread overview]
Message-ID: <3406611.oXWTaphSN4@avalon> (raw)
In-Reply-To: <8738l1jzfv.wl%kuninori.morimoto.gx@gmail.com>
Hi Morimoto-san,
On Tuesday 07 January 2014 16:22:27 Kuninori Morimoto wrote:
> Hi Laurent
>
> Thank you for your review
You're welcome.
> > > + audio_clk_a: audio_clk_a {
> > > + compatible = "fixed-clock";
> > > + #clock-cells = <0>;
> > > + /* This value can be overriden by the board if exist */
> > > + clock-frequency = <0>;
> > > + clock-output-names = "audio_clk_a";
> > > + };
> > > + audio_clk_b: audio_clk_b {
> > > + compatible = "fixed-clock";
> > > + #clock-cells = <0>;
> > > + /* This value can be overriden by the board if exist */
> > > + clock-frequency = <0>;
> > > + clock-output-names = "audio_clk_b";
> > > + };
> > > + audio_clk_c: audio_clk_c {
> > > + compatible = "fixed-clock";
> > > + #clock-cells = <0>;
> > > + /* This value can be overriden by the board if exist */
> > > + clock-frequency = <0>;
> > > + clock-output-names = "audio_clk_c";
> > > + };
> >
> > There three clocks could be provided by an external clock generator, so
> > "fixed-clock" might not be the right compatible string and might need to
> > be overriden by the board as well. I would thus replace the three comments
> > by a single one on top of the audio_clk_* nodes that goes like
> >
> > "The external audio clocks are configured as 0 Hz fixed frequency clocks
> > by default. Boards that provide audio clocks should override them."
>
> I see. will fix in v2
>
> > > + audio_clk_internal: audio_clk_internal {
> > > + compatible = "fixed-factor-clock";
> > > + clocks = <&m2_clk>;
> > > + #clock-cells = <0>;
> > > + clock-div = <1>;
> > > + clock-mult = <1>;
> > > + clock-output-names = "audio_clk_internal";
> > > + };
> >
> > Do you really need an internal clock, can't you reference m2_clk directly
> > instead ?
>
> Unfortunately, it is impossible.
> "audio_clk_internal = m2_clk" is only R-car H2 or Gen2.
> It is "clks1" in Gen1 case.
> So, sound driver is assuming that
> it can get internal clock as "audio_clk_internal"
I believe this should be fixed in the audio driver. Instead of doing
adg->clk[CLKA] = clk_get(NULL, "audio_clk_a");
adg->clk[CLKB] = clk_get(NULL, "audio_clk_b");
adg->clk[CLKC] = clk_get(NULL, "audio_clk_c");
adg->clk[CLKI] = clk_get(NULL, "audio_clk_internal");
it should do something like
adg->clk[CLKA] = clk_get(&pdev->dev, "clk_a");
adg->clk[CLKB] = clk_get(&pdev->dev, "clk_b");
adg->clk[CLKC] = clk_get(&pdev->dev, "clk_c");
adg->clk[CLKI] = clk_get(&pdev->dev, "internal");
The audio device DT node should then reference the clocks
clocks = <&audio_clk_a &audio_clk_b &audio_clk_c &m2_clk>;
clock-names = "clk_a", "clk_b", "clk_c", "internal";
On Gen1 that would become
clocks = <&audio_clk_a &audio_clk_b &audio_clk_c &clks1>;
clock-names = "clk_a", "clk_b", "clk_c", "internal";
Of course this will require DT bindings for the audio driver. Until you get
that you can create clock aliases as done for the CMT and SCI devices on Lager
and Koelsch. See the lager_add_standard_devices() function in arch/arm/mach-
shmobile/board-lager-reference.c for instance.
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2014-01-08 0:40 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-06 8:18 [PATCH] ARM: shmobile: r8a7790: add audio clocks Kuninori Morimoto
2014-01-07 9:34 ` Laurent Pinchart
2014-01-08 0:22 ` Kuninori Morimoto
2014-01-08 0:40 ` Laurent Pinchart [this message]
2014-01-08 2:07 ` Kuninori Morimoto
2014-01-08 2:39 ` Kuninori Morimoto
2014-01-08 8:04 ` Laurent Pinchart
2014-01-08 9:11 ` Kuninori Morimoto
2014-01-09 18:32 ` Laurent Pinchart
2014-01-10 0:19 ` Kuninori Morimoto
2014-01-10 0:24 ` Laurent Pinchart
2014-01-10 0:51 ` Kuninori Morimoto
2014-01-10 1:08 ` Simon Horman
2014-01-10 10:47 ` Laurent Pinchart
2014-01-14 0:15 ` Kuninori Morimoto
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3406611.oXWTaphSN4@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=linux-sh@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox