From: Michael Turquette <mturquette@baylibre.com>
To: Eric Anholt <eric@anholt.net>, linux-clk@vger.kernel.org
Cc: linux-rpi-kernel@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
"Stephen Warren" <swarren@wwwdotorg.org>,
"Lee Jones" <lee@kernel.org>,
"Stephen Boyd" <sboyd@codeaurora.org>,
"Eric Anholt" <eric@anholt.net>
Subject: Re: [PATCH 2/2] clk: bcm2835: Reuse CLK_DIVIDER_MAX_AT_ZERO for recalc_rate()
Date: Tue, 16 Feb 2016 13:45:09 -0800 [thread overview]
Message-ID: <20160216214509.2278.72829@quark.deferred.io> (raw)
In-Reply-To: <1455591838-22725-2-git-send-email-eric@anholt.net>
Quoting Eric Anholt (2016-02-15 19:03:58)
> We were rolling this ourselves, but clk-divider can do it now.
> =
> Signed-off-by: Eric Anholt <eric@anholt.net>
Applied to clk-next.
Regards,
Mike
> ---
> drivers/clk/bcm/clk-bcm2835.c | 13 ++-----------
> 1 file changed, 2 insertions(+), 11 deletions(-)
> =
> diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c
> index 9f4df8f..353e438 100644
> --- a/drivers/clk/bcm/clk-bcm2835.c
> +++ b/drivers/clk/bcm/clk-bcm2835.c
> @@ -1060,16 +1060,7 @@ static long bcm2835_pll_divider_round_rate(struct =
clk_hw *hw,
> static unsigned long bcm2835_pll_divider_get_rate(struct clk_hw *hw,
> unsigned long parent_ra=
te)
> {
> - struct bcm2835_pll_divider *divider =3D bcm2835_pll_divider_from_=
hw(hw);
> - struct bcm2835_cprman *cprman =3D divider->cprman;
> - const struct bcm2835_pll_divider_data *data =3D divider->data;
> - u32 div =3D cprman_read(cprman, data->a2w_reg);
> -
> - div &=3D (1 << A2W_PLL_DIV_BITS) - 1;
> - if (div =3D=3D 0)
> - div =3D 256;
> -
> - return parent_rate / div;
> + return clk_divider_ops.recalc_rate(hw, parent_rate);
> }
> =
> static void bcm2835_pll_divider_off(struct clk_hw *hw)
> @@ -1430,7 +1421,7 @@ bcm2835_register_pll_divider(struct bcm2835_cprman =
*cprman,
> divider->div.reg =3D cprman->regs + data->a2w_reg;
> divider->div.shift =3D A2W_PLL_DIV_SHIFT;
> divider->div.width =3D A2W_PLL_DIV_BITS;
> - divider->div.flags =3D 0;
> + divider->div.flags =3D CLK_DIVIDER_MAX_AT_ZERO;
> divider->div.lock =3D &cprman->regs_lock;
> divider->div.hw.init =3D &init;
> divider->div.table =3D NULL;
> -- =
> 2.7.0
>=20
next prev parent reply other threads:[~2016-02-16 21:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-16 3:03 [PATCH 1/2] clk: bcm2835: Fix setting of PLL divider clock rates Eric Anholt
2016-02-16 3:03 ` [PATCH 2/2] clk: bcm2835: Reuse CLK_DIVIDER_MAX_AT_ZERO for recalc_rate() Eric Anholt
2016-02-16 21:45 ` Michael Turquette [this message]
2016-02-16 21:44 ` [PATCH 1/2] clk: bcm2835: Fix setting of PLL divider clock rates Michael Turquette
2016-02-17 17:51 ` Jayson Aguilar
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=20160216214509.2278.72829@quark.deferred.io \
--to=mturquette@baylibre.com \
--cc=eric@anholt.net \
--cc=lee@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rpi-kernel@lists.infradead.org \
--cc=sboyd@codeaurora.org \
--cc=swarren@wwwdotorg.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).