devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Turquette <mturquette@linaro.org>
To: horms@verge.net.au
Cc: linux-sh@vger.kernel.org, magnus.damm@gmail.com,
	Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
	devicetree@vger.kernel.org,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Ulrich Hecht <ulrich.hecht@gmail.com>,
	Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
Subject: Re: [PATCH v4] clk: shmobile: div6: support selectable-input clocks
Date: Mon, 01 Sep 2014 17:23:29 -0700	[thread overview]
Message-ID: <20140902002329.5251.82127@quantum> (raw)
In-Reply-To: <1409238671-30452-1-git-send-email-ulrich.hecht+renesas@gmail.com>

Quoting Ulrich Hecht (2014-08-28 08:11:11)
> From: Ulrich Hecht <ulrich.hecht@gmail.com>
> 
> Support for setting the parent at initialization time based on the current
> hardware configuration in DIV6 clocks with selectable parents as found in
> the r8a73a4, r8a7740, sh73a0, and other SoCs.

<snip>

> -       parent_name = of_clk_get_parent_name(np, 0);
> +       if (!of_property_read_u32(np, "renesas,src-shift", &src_shift)) {
> +               if (!of_property_read_u32(np, "renesas,src-width",
> +                                       &src_width)) {
> +                       unsigned int parent_idx =
> +                               (clk_readl(clock->reg) >> src_shift) &
> +                               (BIT(src_width) - 1);
> +                       parent_name = of_clk_get_parent_name(np, parent_idx);

Can the clock source be selected at run-time? Is there a use case for
this?

If so it is probably better to actually model these clocks as
multiplexers with the corresponding .get_parent and .set_parent
callbacks.

Regards,
Mike

      parent reply	other threads:[~2014-09-02  0:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-28 15:11 [PATCH v4] clk: shmobile: div6: support selectable-input clocks Ulrich Hecht
2014-08-28 16:05 ` Mark Rutland
2014-08-28 23:58   ` Laurent Pinchart
2014-11-03 16:00     ` Ulrich Hecht
2014-09-02  0:23 ` Mike Turquette [this message]

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=20140902002329.5251.82127@quantum \
    --to=mturquette@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=geert@linux-m68k.org \
    --cc=horms@verge.net.au \
    --cc=laurent.pinchart+renesas@ideasonboard.com \
    --cc=linux-sh@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=ulrich.hecht+renesas@gmail.com \
    --cc=ulrich.hecht@gmail.com \
    /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).