From: Nishanth Menon <nm@ti.com>
To: Kevin Hilman <khilman@deeprootsystems.com>
Cc: Linux-omap <linux-omap@vger.kernel.org>,
"Nayak, Rajendra" <rnayak@ti.com>,
"Roger Quadros" <ext-roger.quadros@nokia.com>,
"Kalle Jokiniemi" <ext-kalle.jokiniemi@nokia.com>,
"Reddy, Teerth" <teerth@ti.com>, "Paul Walmsley" <paul@pwsan.com>,
"Högander Jouni" <jouni.hogander@nokia.com>,
"Imberton Guilhem" <guilhem.imberton@motorola.com>,
"Mike Chan" <mikechan@google.com>
Subject: Re: [RFC][PATCH 2/2] OMAP3:PM:SR: SmartReflex Refactor Rev2.0
Date: Fri, 9 Oct 2009 16:50:16 -0500 [thread overview]
Message-ID: <4ACFB018.7000100@ti.com> (raw)
In-Reply-To: <87k4z4uu3l.fsf@deeprootsystems.com>
Kevin Hilman had written, on 10/09/2009 04:37 PM, the following:
> Nishanth Menon <nm@ti.com> writes:
>
>> Refactor the smart reflex implementation.
>
> One other request for this refactor.
>
> Can you remove the usage of OMAP2_IO_ADDRESS (now gone from l-o master)
> in favor of ioremap().
>
> Here's a totally untested first pass and converting the version
> currently in PM branch. Could probably use some better error
> detection though, and I didn't look up exactly what size
> should be ioremap'd.
>
> Kevin
>
>
> diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
> index 1407783..bf57b21 100644
> --- a/arch/arm/mach-omap2/smartreflex.c
> +++ b/arch/arm/mach-omap2/smartreflex.c
> @@ -48,6 +48,7 @@ struct omap_sr {
> u32 opp1_nvalue, opp2_nvalue, opp3_nvalue, opp4_nvalue;
> u32 opp5_nvalue;
> u32 senp_mod, senn_mod;
> + u32 srbase_phys;
> void __iomem *srbase_addr;
> void __iomem *vpbase_addr;
> };
> @@ -105,7 +106,7 @@ static struct omap_sr sr1 = {
> .is_sr_reset = 1,
> .is_autocomp_active = 0,
> .clk_length = 0,
> - .srbase_addr = OMAP2_IO_ADDRESS(OMAP34XX_SR1_BASE),
> + .srbase_phys = OMAP34XX_SR1_BASE,
> };
>
> static struct omap_sr sr2 = {
> @@ -113,7 +114,7 @@ static struct omap_sr sr2 = {
> .is_sr_reset = 1,
> .is_autocomp_active = 0,
> .clk_length = 0,
> - .srbase_addr = OMAP2_IO_ADDRESS(OMAP34XX_SR2_BASE),
> + .srbase_phys = OMAP34XX_SR2_BASE,
> };
>
> static void cal_reciprocal(u32 sensor, u32 *sengain, u32 *rnsen)
> @@ -987,6 +988,11 @@ static int __init omap3_sr_init(void)
> return -ENODEV;
> }
>
> + sr1.srbase_addr = ioremap(sr1.srbase_phys, SZ_4K);
> + sr2.srbase_addr = ioremap(sr2.srbase_phys, SZ_4K);
4K is more than sufficient.
> + if (WARN_ON(!sr1.srbase_addr) || WARN_ON(!sr2.srbase_addr))
> + return;
should'nt we return with -ENOMEM?
> +
> /* Enable SR on T2 */
> ret = twl4030_i2c_read_u8(TWL4030_MODULE_PM_RECEIVER, &RdReg,
> R_DCDC_GLOBAL_CFG);
>
I can do the corresponding changes for SR v2 and post a v3 patch out.
--
Regards,
Nishanth Menon
next prev parent reply other threads:[~2009-10-09 21:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-02 0:31 [RFC][PATCH 0/2] OMAP3:PM:SR Refactor Nishanth Menon
2009-10-02 0:31 ` [RFC][PATCH 1/2] OMAP3:PM:SR: prepare: remove old SR code Nishanth Menon
2009-10-02 0:31 ` [RFC][PATCH 2/2] OMAP3:PM:SR: SmartReflex Refactor Rev2.0 Nishanth Menon
2009-10-02 14:30 ` Kevin Hilman
2009-10-09 21:37 ` Kevin Hilman
2009-10-09 21:50 ` Nishanth Menon [this message]
2009-10-02 0:40 ` [RFC][PATCH 0/2] OMAP3:PM:SR Refactor Nishanth Menon
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=4ACFB018.7000100@ti.com \
--to=nm@ti.com \
--cc=ext-kalle.jokiniemi@nokia.com \
--cc=ext-roger.quadros@nokia.com \
--cc=guilhem.imberton@motorola.com \
--cc=jouni.hogander@nokia.com \
--cc=khilman@deeprootsystems.com \
--cc=linux-omap@vger.kernel.org \
--cc=mikechan@google.com \
--cc=paul@pwsan.com \
--cc=rnayak@ti.com \
--cc=teerth@ti.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.