From: Tony Lindgren <tony@atomide.com>
To: Igor Stoppa <igor.stoppa@nokia.com>
Cc: ext Paul Walmsley <paul@pwsan.com>,
linux-omap-open-source@linux.omap.com
Subject: Re: [PATCH 11/18] omap2: convert clock.c to use new PRCM functions and symbolic constants
Date: Fri, 25 May 2007 11:53:39 -0700 [thread overview]
Message-ID: <20070525185339.GL19506@atomide.com> (raw)
In-Reply-To: <1180083839.3640.43.camel@Dogbert.NOE.nokia.com>
* Igor Stoppa <igor.stoppa@nokia.com> [070525 02:04]:
> Sorry, I accidentally pressed send before completing
>
>
> On Fri, 2007-05-25 at 11:59 +0300, Igor Stoppa wrote:
> > Hi,
> >
> > On Fri, 2007-05-25 at 02:23 -0600, ext Paul Walmsley wrote:
> > >
> > > long long dpll_clk;
> > > int dpll_mult, dpll_div, amult;
> > > + u32 dpll;
> > > +
> > > + dpll = cm_read_mod_reg(PLL_MOD, CM_CLKSEL1);
> > > + dpll_mult = dpll & OMAP24XX_DPLL_MULT_MASK;
> > > + dpll_mult >>= OMAP24XX_DPLL_MULT_SHIFT; /* 10 bits */
> > > + dpll_div = dpll & OMAP24XX_DPLL_DIV_MASK;
> > > + dpll_div >>= OMAP24XX_DPLL_DIV_SHIFT; /* 4 bits */
> >
> >
> >
>
> Why not this?
>
> #define OMAP24XX_DPLL_MULT_LEN 10
> #define OMAP24XX_DPLL_MULT_OFFS 12
>
> #define get_bitfield(value, name)\
> (((value) >> name##_OFFS) & ((1 << name##_LEN) - 1))
>
> dpll = cm_read_mod_reg(PLL_MOD, CM_CLKSEL1);
> dpll_mult = get_bitfield(dpll, OMAP24XX_DPLL_MULT);
> dpll_div = get_bitfield(dpll, OMAP24XX_DPLL_DIV);
That could be cleaned up further, but I'll push Paul's patches
today. We can always do additional clean-up, but let's first
wait and make sure things still work for all omap2 boards.
Regards,
Tony
next prev parent reply other threads:[~2007-05-25 18:53 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-25 8:23 [PATCH 00/18] PRCM cleanup - remove prcm-regs.h Paul Walmsley
2007-05-25 8:23 ` [PATCH 01/18] omap2: add OMAP24XX and OMAP2/3 modules to prcm_common.h Paul Walmsley
2007-05-25 8:23 ` [PATCH 02/18] omap2: add OMAP24XX register bit defines shared between CM and PRM Paul Walmsley
2007-05-25 8:23 ` [PATCH 03/18] omap2: add OMAP2_PRM_BASE/OMAP2_CM_BASE #defines Paul Walmsley
2007-05-25 8:23 ` [PATCH 04/18] omap2: add OMAP24XX Clock Management register defines Paul Walmsley
2007-05-25 8:23 ` [PATCH 05/18] omap2: add Clock Management shared register bit defines to cm.h Paul Walmsley
2007-05-25 8:23 ` [PATCH 06/18] omap2: add OMAP24XX Power/Reset Management register defines Paul Walmsley
2007-05-25 8:23 ` [PATCH 07/18] omap2: add Power/Reset Management shared register bit defines to prm.h Paul Walmsley
2007-05-25 8:23 ` [PATCH 08/18] omap2: add OMAP24XX Clock Management register bit defines Paul Walmsley
2007-05-25 8:23 ` [PATCH 09/18] omap2: add OMAP24XX Power/Reset " Paul Walmsley
2007-05-25 8:23 ` [PATCH 10/18] omap2: convert pm.c to use new PRCM functions and symbolic constants Paul Walmsley
2007-05-25 8:23 ` [PATCH 11/18] omap2: convert clock.c " Paul Walmsley
2007-05-25 8:59 ` Igor Stoppa
2007-05-25 9:03 ` Igor Stoppa
2007-05-25 18:53 ` Tony Lindgren [this message]
2007-05-25 8:23 ` [PATCH 12/18] omap2: convert prcm.c to use symbolic register & register bit constants Paul Walmsley
2007-05-25 8:23 ` [PATCH 13/18] omap2: convert sram-fn.S to use OMAP2_{PRM, CM}_BASE rather than OMAP2_PRCM_BASE Paul Walmsley
2007-05-25 8:23 ` [PATCH 14/18] omap2: convert clock.h to use symbolic register defines Paul Walmsley
2007-05-25 8:23 ` [PATCH 15/18] omap2: convert clock.h to use symbolic register bit defines Paul Walmsley
2007-05-25 8:23 ` [PATCH 16/18] omap2: convert DSP code to use new PRCM functions & defines Paul Walmsley
2007-05-25 8:23 ` [PATCH 17/18] omap2: remove remaining prcm-regs.h includes Paul Walmsley
2007-05-25 8:23 ` [PATCH 18/18] omap2: remove prcm-regs.h Paul Walmsley
-- strict thread matches above, loose matches on Subject: below --
2007-05-17 0:11 [PATCH 00/18] PRCM cleanup - " Paul Walmsley
2007-05-17 0:11 ` [PATCH 11/18] omap2: convert clock.c to use new PRCM functions and symbolic constants Paul Walmsley
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=20070525185339.GL19506@atomide.com \
--to=tony@atomide.com \
--cc=igor.stoppa@nokia.com \
--cc=linux-omap-open-source@linux.omap.com \
--cc=paul@pwsan.com \
/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