linux-clk.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sylwester Nawrocki <s.nawrocki@samsung.com>
To: Jonny Hall <jonny.hall@boxcast.com>, linux-clk@vger.kernel.org
Cc: Stephen Boyd <sboyd@kernel.org>,
	Michael Turquette <mturquette@baylibre.com>
Subject: Re: Informing common clock framework driver of externally-derived base clock frequency
Date: Fri, 04 Jan 2019 10:30:33 +0100	[thread overview]
Message-ID: <32a08ee4-3989-3785-88d6-7d215147eba3@samsung.com> (raw)
In-Reply-To: <CAP_wsPYwykAPF=aedoHkZnKhLgFdbUNMK7tpFJkhMfr_X2Gnrg@mail.gmail.com>

Hi,

Cc: CCF maintainers

On 1/4/19 03:35, Jonny Hall wrote:
[...]

> ... However, in my application, the input frequency of
> the si5342 is not known in advance, is derived from an external
> source, and can change during runtime. The si5342 will need to be
> (re)configured during operation with the frequency of this root clock
> source in order to properly lock onto it and generate the correct
> output frequencies -- it cannot independently determine the input
> frequency, only "locked" / "unlocked" state.  The application software
> (other drivers and usermode application code) will know the input
> clock rate.  I've though of a couple ways to do this:
> 
> -Implement the root clock source as an "imaginary" divider where the
> set_rate call actually configures the input dividers of the si5342.
> This approach seems to abuse the common clock framework, as I'm not
> actually *setting* the rate, I'm *informing* the driver of a rate that
> was determined independently.

It sounds like registering a clk notifier on the si5342 root source clock
might be a way to go, wouldn't that work for you?
For an example you could have a look at drivers/clk/sunxi-ng/ccu_mux.c.

--
Regards,
Sylwester

  reply	other threads:[~2019-01-04  9:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20190104023702epcas4p4e6b225121db059cb6ed167581c303e92@epcas4p4.samsung.com>
2019-01-04  2:35 ` Informing common clock framework driver of externally-derived base clock frequency Jonny Hall
2019-01-04  9:30   ` Sylwester Nawrocki [this message]
2019-01-04 21:29     ` Jonny Hall
2019-01-09 14:22       ` Sylwester Nawrocki
2019-01-29 22:26         ` Stephen Boyd

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=32a08ee4-3989-3785-88d6-7d215147eba3@samsung.com \
    --to=s.nawrocki@samsung.com \
    --cc=jonny.hall@boxcast.com \
    --cc=linux-clk@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=sboyd@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).