linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: boris.brezillon@free-electrons.com (Boris Brezillon)
To: linux-arm-kernel@lists.infradead.org
Subject: sama5d4, configure pck1 with dt?
Date: Thu, 7 Jul 2016 09:15:12 +0200	[thread overview]
Message-ID: <20160707091512.387ea113@bbrezillon> (raw)
In-Reply-To: <alpine.DEB.2.02.1607062239210.12243@pmeerw.net>

Hi Peter,

On Wed, 6 Jul 2016 23:17:07 +0200 (CEST)
Peter Meerwald-Stadler <pmeerw@pmeerw.net> wrote:

> Hello,
> 
> how do I configure pck1 using devicetree to be used as the master 
> clock for an audio codec?
> 
> in particular how do I choose the clock source and frequency for pck1?
> is there a way to do this using devicetree?
> 
> or is the code in at91sam9g20ek_audio_probe() the way to go?
> i.e mclk=clk_get(0, "pck1"); pllb=clk_get(0, "pllb"); clk_set_parent(mclk, 
> pllb); clk_set_rate(mclk, 12000000);

It's as simple as that:

mclk = clk_get(<your-device>, "<audio-clk-name>");
clk_set_rate(mclk, <rate>);

<your-device> should not be NULL, <audio-clk-name> should not be pck1
(see the DT binding doc), and you should not manually re-parent the mclk
clk (the driver select the best parent when clk_set_rate() is
called).

Regards,

Boris

  reply	other threads:[~2016-07-07  7:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-06 21:17 sama5d4, configure pck1 with dt? Peter Meerwald-Stadler
2016-07-07  7:15 ` Boris Brezillon [this message]
2016-07-13  9:02   ` Peter Meerwald-Stadler

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=20160707091512.387ea113@bbrezillon \
    --to=boris.brezillon@free-electrons.com \
    --cc=linux-arm-kernel@lists.infradead.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).