linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Magnus Damm <magnus.damm@gmail.com>
To: linux-sh@vger.kernel.org
Subject: Re: [PATCH 2/2][RFC] ARM: mach-shmobile: clock-sh7372: FSI parent
Date: Wed, 15 Sep 2010 08:31:23 +0000	[thread overview]
Message-ID: <AANLkTimdAsv62BPYODTGe0sKQ2ojqX3UYmeMotW2tXcW@mail.gmail.com> (raw)
In-Reply-To: <w3pd3sfwlxm.wl%kuninori.morimoto.gx@renesas.com>

Hi Morimoto-san,

On Wed, Sep 15, 2010 at 3:38 PM, Kuninori Morimoto
<kuninori.morimoto.gx@renesas.com> wrote:
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---

Thanks for your work on this.

> I need some comment/advice

Sure, I'll try to help! =)

> @@ -818,6 +797,38 @@ out:
>
>  device_initcall(hdmi_init_pm_clock);
>
> +static int __init fsi_init_pm_clock(void)
> +{
> +       struct clk *fsia_ick = clk_get(&fsi_device.dev, "icka");
> +       int ret;
> +
> +       /* change parent of FSI A */
> +
> +       if (IS_ERR(fsia_ick)) {
> +               ret = PTR_ERR(fsia_ick);
> +               pr_err("Cannot get FSI ICK: %d\n", ret);
> +               return ret;
> +       }
> +
> +       /* select FSIACK for AK4642 */
> +       ret = clk_set_parent(fsia_ick, &fsiack_clk);
> +       if (ret < 0) {
> +               pr_err("Cannot set FSI-A parent: %d\n", ret);
> +               goto out;
> +       }
> +
> +       /* no divide */
> +       ret = clk_set_rate(fsia_ick, 0);
> +       if (ret < 0)
> +               pr_err("Cannot set FSI-A rate: %d\n", ret);

This rate setting looks a bit strange to me. It looks like you select
the external pin as parent, and then you try to set the rate to zero.
What is the clock rate of the external pin?

> diff --git a/arch/arm/mach-shmobile/clock-sh7372.c b/arch/arm/mach-shmobile/clock-sh7372.c
> index ea384e1..0a22648 100644
> --- a/arch/arm/mach-shmobile/clock-sh7372.c
> +++ b/arch/arm/mach-shmobile/clock-sh7372.c
> @@ -59,6 +59,13 @@ static struct clk r_clk = {
>        .rate           = 32768,
>  };
>
> +/* External input clock (pin name: FSIACK/FSIBCK ) */
> +struct clk fsiack_clk = {
> +};
> +
> +struct clk fsibck_clk = {
> +};
> +
>  /*
>  * 26MHz default rate for the EXTAL1 root input clock.
>  * If needed, reset this with clk_set_rate() from the platform code.
> @@ -295,6 +302,8 @@ struct clk pllc2_clk = {
>  static struct clk *main_clks[] = {
>        &dv_clki_clk,
>        &r_clk,
> +       &fsiack_clk,
> +       &fsibck_clk,
>        &sh7372_extal1_clk,
>        &sh7372_extal2_clk,
>        &dv_clki_div2_clk,

I'd prefer to keep r_clk and extal clocks together since they are the
main inputs to the cpu. Put the new clocks at the end of the list
please.

> diff --git a/arch/arm/mach-shmobile/include/mach/sh7372.h b/arch/arm/mach-shmobile/include/mach/sh7372.h
> index 33e9700..4d93c17 100644
> --- a/arch/arm/mach-shmobile/include/mach/sh7372.h
> +++ b/arch/arm/mach-shmobile/include/mach/sh7372.h
> @@ -460,5 +460,7 @@ enum {
>  extern struct clk dv_clki_clk;
>  extern struct clk dv_clki_div2_clk;
>  extern struct clk pllc2_clk;
> +extern struct clk fsiack_clk;
> +extern struct clk fsibck_clk;

I would prefer that the global clocks came with a sh7372 prefix,
please add "sh7372_" before the variable names.

Thanks,

/ magnus

  reply	other threads:[~2010-09-15  8:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-15  6:38 [PATCH 2/2][RFC] ARM: mach-shmobile: clock-sh7372: FSI parent select Kuninori Morimoto
2010-09-15  8:31 ` Magnus Damm [this message]
2010-09-16  1:18 ` [PATCH 2/2][RFC] ARM: mach-shmobile: clock-sh7372: FSI parent 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=AANLkTimdAsv62BPYODTGe0sKQ2ojqX3UYmeMotW2tXcW@mail.gmail.com \
    --to=magnus.damm@gmail.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;
as well as URLs for NNTP newsgroup(s).