linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: t.figa@samsung.com (Tomasz Figa)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 12/16] clk: samsung: pll: Add support for rate configuration of PLL46xx
Date: Wed, 21 Aug 2013 14:44:41 +0200	[thread overview]
Message-ID: <14520108.LqsSBuPVXk@amdc1227> (raw)
In-Reply-To: <CAKew6eU4ofumk64fwZSK-R-UUBQos6UU1TLDdVRDE-bvOrbitw@mail.gmail.com>

On Wednesday 21 of August 2013 18:02:16 Yadwinder Singh Brar wrote:
> > +       con0 |= (rate->mdiv << PLL46XX_MDIV_SHIFT) |
> > +                       (rate->pdiv << PLL46XX_PDIV_SHIFT) |
> > +                       (rate->sdiv << PLL46XX_SDIV_SHIFT) |
> > +                       (rate->vsel << PLL46XX_VSEL_SHIFT);
> > +
> > +       /* Set PLL AFC, MFR and MRR values. */
> 
> This comments seems to be miss match with below code.

Hmm, looks like a copy/paste error. Thanks for spotting.

> > +       con1 = __raw_readl(pll->con_reg + 0x4);
> > +       con1 &= ~((PLL46XX_KDIV_MASK << PLL46XX_KDIV_SHIFT) |
> > +                       (PLL46XX_MFR_MASK << PLL46XX_MFR_SHIFT) |
> > +                       (PLL46XX_MRR_MASK << PLL46XX_MRR_SHIFT));
> > +       con1 |= (rate->kdiv << PLL46XX_KDIV_SHIFT) |
> > +                       (rate->mfr << PLL46XX_MFR_SHIFT) |
> > +                       (rate->mrr << PLL46XX_MRR_SHIFT);
> > +
> 
> <snip>
> 
> > --- a/drivers/clk/samsung/clk-pll.h
> > +++ b/drivers/clk/samsung/clk-pll.h
> > @@ -51,6 +51,28 @@ enum samsung_pll_type {
> > 
> >                 .afc    =       (_afc),                         \
> >         
> >         }
> > 
> > +#define PLL_4600_RATE(_rate, _m, _p, _s, _k, _vsel)            \
> > +       {                                                       \
> > +               .rate   =       (_rate),                        \
> > +               .mdiv   =       (_m),                           \
> > +               .pdiv   =       (_p),                           \
> > +               .sdiv   =       (_s),                           \
> > +               .kdiv   =       (_k),                           \
> > +               .vsel   =       (_vsel),                        \
> > +       }
> > +
> > +#define PLL_4650_RATE(_rate, _m, _p, _s, _k, _mfr, _mrr, _vsel)       
> > \ +       {                                                       \ + 
> >              .rate   =       (_rate),                        \ +      
> >         .mdiv   =       (_m),                           \ +           
> >    .pdiv   =       (_p),                           \ +              
> > .sdiv   =       (_s),                           \ +              
> > .kdiv   =       (_k),                           \ +               .mfr
> >    =       (_mfr),                         \ +               .mrr    =
> >       (_mrr),                         \ +               .vsel   =     
> >  (_vsel),                        \ +       }
> > +
> > 
> >  /* NOTE: Rate table should be kept sorted in descending order. */
> >  
> >  struct samsung_pll_rate_table {
> > 
> > @@ -60,6 +82,9 @@ struct samsung_pll_rate_table {
> > 
> >         unsigned int sdiv;
> >         unsigned int kdiv;
> >         unsigned int afc;
> > 
> > +       unsigned int mfr;
> > +       unsigned int mrr;
> > +       unsigned int vsel;
> > 
> >  };
> 
> This struct seems to be expanding too much.

I don't think it's a problem. How many bytes such tables can occupy in a 
system?

> Can we re-think on options for using bit map same as register
> definition? It can reduce code in set_rate also little bit.

IMHO it is more clear what the code does when accessing a single 
coefficient at once.

In addition you still would need to preserve bitfields that are not changed 
by the driver and also unpack some of the coefficients anyway, like pdiv 
that is used to calculate lock time.

Best regards,
Tomasz

  reply	other threads:[~2013-08-21 12:44 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-20 17:31 [PATCH 00/16] Exynos clock clean-up for 3.12 Tomasz Figa
2013-08-20 17:31 ` [PATCH 01/16] pwm: samsung: Update DT bindings documentation to cover clocks Tomasz Figa
2013-08-20 20:34   ` Stephen Warren
2013-08-20 22:32     ` Tomasz Figa
2013-08-20 17:31 ` [PATCH 02/16] ARM: dts: exynos4: Specify PWM clocks in PWM node Tomasz Figa
2013-08-20 17:31 ` [PATCH 03/16] clocksource: samsung_pwm_timer: Get clock from device tree Tomasz Figa
2013-08-20 17:31 ` [PATCH 04/16] clk: samsung: exynos4: Use separate aliases for cpufreq related clocks Tomasz Figa
2013-08-20 17:31 ` [PATCH 05/16] clk: samsung: Modify _get_rate() helper to use __clk_lookup() Tomasz Figa
2013-08-20 17:31 ` [PATCH 06/16] clk: samsung: exynos4: Remove unused static clkdev aliases Tomasz Figa
2013-08-20 17:31 ` [PATCH 07/16] clk: samsung: exynos4: Remove checks for DT node Tomasz Figa
2013-08-20 17:31 ` [PATCH 08/16] clk: samsung: exynos4: Rename exynos4_plls to exynos4x12_plls Tomasz Figa
2013-08-20 17:31 ` [PATCH 09/16] clk: samsung: pll: Use new registration method for PLL45xx Tomasz Figa
2013-08-21 13:17   ` Yadwinder Singh Brar
2013-08-22 19:59     ` Stephen Warren
2013-08-20 17:31 ` [PATCH 10/16] clk: samsung: pll: Add support for rate configuration of PLL45xx Tomasz Figa
2013-08-21 12:18   ` Yadwinder Singh Brar
2013-08-21 12:49     ` Tomasz Figa
2013-08-20 17:31 ` [PATCH 11/16] clk: samsung: pll: Use new registration method for PLL46xx Tomasz Figa
2013-08-20 17:31 ` [PATCH 12/16] clk: samsung: pll: Add support for rate configuration of PLL46xx Tomasz Figa
2013-08-21 12:32   ` Yadwinder Singh Brar
2013-08-21 12:44     ` Tomasz Figa [this message]
2013-08-21 13:12       ` Yadwinder Singh Brar
2013-08-20 17:31 ` [PATCH 13/16] clk: samsung: exynos4: Reorder registration of mout_vpllsrc Tomasz Figa
2013-08-20 17:31 ` [PATCH 14/16] clk: samsung: exynos4: Register PLL rate tables for Exynos4210 Tomasz Figa
2013-08-21 12:34   ` Yadwinder Singh Brar
2013-08-21 12:45     ` Tomasz Figa
2013-08-20 17:31 ` [PATCH 15/16] clk: samsung: exynos4: Register PLL rate tables for Exynos4x12 Tomasz Figa
2013-08-20 17:31 ` [PATCH 16/16] clk: samsung: exynos5250: Simplify registration of PLL rate tables Tomasz Figa

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=14520108.LqsSBuPVXk@amdc1227 \
    --to=t.figa@samsung.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).