linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: maxime.ripard@free-electrons.com (Maxime Ripard)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 3/7] clk: sunxi-ng: Implement multiplier maximum
Date: Thu, 19 Jan 2017 22:04:23 +0100	[thread overview]
Message-ID: <20170119210423.5kjs3envfosjlsmr@lukather> (raw)
In-Reply-To: <CAGb2v65K8zQvHbhwZ6b6VhO6egXVQN4agHQ1JT8rkHzNsAEUtw@mail.gmail.com>

Hi,

On Mon, Jan 16, 2017 at 01:58:18PM +0800, Chen-Yu Tsai wrote:
> On Tue, Jan 10, 2017 at 3:57 PM, Maxime Ripard
> <maxime.ripard@free-electrons.com> wrote:
> > Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> > ---
> >  drivers/clk/sunxi-ng/ccu_mult.c |  4 ++--
> >  drivers/clk/sunxi-ng/ccu_mult.h | 10 ++++++----
> >  drivers/clk/sunxi-ng/ccu_nk.c   |  8 ++++----
> >  drivers/clk/sunxi-ng/ccu_nkm.c  |  8 ++++----
> >  drivers/clk/sunxi-ng/ccu_nkmp.c |  8 ++++----
> >  drivers/clk/sunxi-ng/ccu_nm.c   |  4 ++--
> >  6 files changed, 22 insertions(+), 20 deletions(-)
> >
> > diff --git a/drivers/clk/sunxi-ng/ccu_mult.c b/drivers/clk/sunxi-ng/ccu_mult.c
> > index bf5e11c803f9..fccfe1e1961a 100644
> > --- a/drivers/clk/sunxi-ng/ccu_mult.c
> > +++ b/drivers/clk/sunxi-ng/ccu_mult.c
> > @@ -41,7 +41,7 @@ static unsigned long ccu_mult_round_rate(struct ccu_mux_internal *mux,
> >         struct _ccu_mult _cm;
> >
> >         _cm.min = 1;
> > -       _cm.max = 1 << cm->mult.width;
> > +       _cm.max = cm->mult.max ?: 1 << cm->mult.width;
> 
> Should you also factor in the offset when providing the default
> value for max? Otherwise you might end up with a value that is
> actually not progammable?
> 
> Say if offset is 1, then max would be 1 << width.
> But if offset is 0, then max would have to be (1 << width) - 1,
> as (1 << width) is not valid.

Ah, yes, that's true. I'll fix it.

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20170119/d2beb4bd/attachment.sig>

  reply	other threads:[~2017-01-19 21:04 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-10  7:57 [PATCH v2 0/7] ARM: sun5i: Convert sun5i SoCs to sunxi-ng Maxime Ripard
2017-01-10  7:57 ` [PATCH v2 1/7] clk: sunxi-ng: multiplier: Add fractional support Maxime Ripard
2017-01-10  7:57 ` [PATCH v2 2/7] clk: sunxi-ng: Implement factors offsets Maxime Ripard
2017-01-16  5:45   ` Chen-Yu Tsai
2017-01-10  7:57 ` [PATCH v2 3/7] clk: sunxi-ng: Implement multiplier maximum Maxime Ripard
2017-01-16  5:58   ` Chen-Yu Tsai
2017-01-19 21:04     ` Maxime Ripard [this message]
2017-01-10  7:57 ` [PATCH v2 4/7] clk: sunxi-ng: Add clocks and resets indices for sun5i Maxime Ripard
2017-01-16  6:15   ` Chen-Yu Tsai
2017-01-10  7:57 ` [PATCH v2 5/7] clk: sunxi-ng: Add sun5i CCU driver Maxime Ripard
2017-01-16  7:15   ` Chen-Yu Tsai
2017-01-19 22:14     ` Maxime Ripard
2017-01-10  7:57 ` [PATCH v2 6/7] ARM: sun5i: Convert to CCU Maxime Ripard
2017-01-16  7:21   ` Chen-Yu Tsai
2017-01-10  7:57 ` [PATCH v2 7/7] ARM: gr8: " Maxime Ripard
2017-01-16  7:24   ` Chen-Yu Tsai

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=20170119210423.5kjs3envfosjlsmr@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;
as well as URLs for NNTP newsgroup(s).