From: maxime.ripard@free-electrons.com (Maxime Ripard)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 11/12] mmc: sunxi: Convert MMC driver to the standard clock phase API
Date: Fri, 26 Sep 2014 17:02:04 +0200 [thread overview]
Message-ID: <20140926150204.GT15315@lukather> (raw)
In-Reply-To: <3992138.y6J8TjIuMq@pagira.o2s.ch>
On Fri, Sep 26, 2014 at 04:27:10PM +0200, David Lanzend?rfer wrote:
> Hello
> > Now that we have proper support to use the generic phase API in our clock
> > driver, switch the MMC driver to use it.
> > [...]
> > /* determine delays */
> > if (rate <= 400000) {
> > - oclk_dly = 0;
> > - sclk_dly = 7;
> > + oclk_dly = 180;
> > + sclk_dly = 42;
> > [...]
> How did you calculate the actual phase values from the original parameters?
Like shown in the clock driver. 0 is always a 180 deg phase shift, and
any other value is the number of the parent clock cycle to outphase
the clock of.
the clock out phase is calculating using:
phase = 360 * interval / period.
with period = 1 / (parent_freq / divider)
and interval = reg / parent_freq
which makes
phase = 360 * (reg / parent_freq) * (parent_freq / divider)
If we simplify by removing the parent_freq, we end up with
phase = 360 * reg / divider, which makes it rather trivial to
calculate.
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140926/6476fba8/attachment.sig>
next prev parent reply other threads:[~2014-09-26 15:02 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-11 20:18 [PATCH v3 00/12] clk: sunxi: Improve MMC clocks support Maxime Ripard
2014-09-11 20:18 ` [PATCH v3 01/12] clk: introduce clk_set_phase function & callback Maxime Ripard
2014-09-24 10:41 ` Heiko Stübner
2014-09-11 20:18 ` [PATCH v3 02/12] clk: Include of.h in clock-provider.h Maxime Ripard
2014-09-11 20:18 ` [PATCH v3 03/12] clk: Add a function to retrieve phase Maxime Ripard
2014-09-24 10:42 ` Heiko Stübner
2014-09-28 0:17 ` Mike Turquette
2014-09-29 8:24 ` Maxime Ripard
2014-09-30 7:01 ` Mike Turquette
2014-09-11 20:18 ` [PATCH v3 04/12] clk: sunxi: factors: Invert the probing logic Maxime Ripard
2014-09-11 20:18 ` [PATCH v3 05/12] clk: sunxi: Introduce mbus compatible Maxime Ripard
2014-09-11 20:18 ` [PATCH v3 06/12] ARM: sunxi: dt: Switch to the new " Maxime Ripard
2014-09-11 20:18 ` [PATCH v3 07/12] clk: sunxi: Move mod0 clock to a file of its own Maxime Ripard
2014-09-11 20:18 ` [PATCH v3 08/12] clk: sunxi: Move mbus to mod0 file Maxime Ripard
2014-09-11 20:18 ` [PATCH v3 09/12] ARM: sunxi: dt: Add sample and output mmc clocks Maxime Ripard
2014-09-12 10:23 ` Chen-Yu Tsai
2014-09-13 8:18 ` Maxime Ripard
2014-09-13 8:24 ` Chen-Yu Tsai
2014-09-11 20:18 ` [PATCH v3 10/12] clk: sunxi: mod0: Introduce MMC proper phase handling Maxime Ripard
2014-09-11 20:18 ` [PATCH v3 11/12] mmc: sunxi: Convert MMC driver to the standard clock phase API Maxime Ripard
2014-09-26 14:27 ` David Lanzendörfer
2014-09-26 15:02 ` Maxime Ripard [this message]
2014-09-26 20:47 ` David Lanzendörfer
2014-09-11 20:18 ` [PATCH v3 12/12] clk: sunxi: Remove custom phase function Maxime Ripard
2014-09-12 7:22 ` [PATCH v3 00/12] clk: sunxi: Improve MMC clocks support Hans de Goede
2014-09-22 11:31 ` Maxime Ripard
2014-09-26 0:42 ` Mike Turquette
2014-09-26 6:55 ` Maxime Ripard
2014-09-26 17:52 ` Mike Turquette
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=20140926150204.GT15315@lukather \
--to=maxime.ripard@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