public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Nishanth Menon <nm@ti.com>
To: "Varadarajan, Charu Latha" <charu@ti.com>
Cc: "linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>
Subject: Re: [PATCH] [OMAP] GPIO Module disable if all pins inactive
Date: Sat, 24 Oct 2009 00:48:23 -0500	[thread overview]
Message-ID: <4AE29527.3050402@ti.com> (raw)
In-Reply-To: <EAF47CD23C76F840A9E7FCE10091EFAB02BA31ADE5@dbde02.ent.ti.com>

Varadarajan, Charu Latha had written, on 10/23/2009 11:05 PM, the following:
>>>  #endif
>>> +     if (cpu_is_omap24xx() || cpu_is_omap34xx() || cpu_is_omap44xx()) {
>>> +             if (!bank->>gpio_status) {
>>> +                     ctrl = __raw_readl(bank->>base + OMAP24XX_GPIO_CTRL);
>>> +                     /* Module is enabled, clocks are not gated */
>>> +                     ctrl &= 0xFFFFFFFE;
>>> +                     __raw_writel(ctrl, bank->>base + OMAP24XX_GPIO_CTRL);
>>> +             }
>>> +             bank->>gpio_status |= 1 << offset;
>>> +     }
>> why do this every time a gpio is enabled? why not do this iff gpio was
>> never used before.. how about the following:
> The module is enabled only when gpio_status indicates that no GPIO 
> in that  module is currently active and the GPIO being requested is the 1st one 
> to be active in that module.
> Each module would be disabled in free() API when all GPIOs in a particular module 
> becomes inactive. The module is re-enabled in request() API when a GPIO is 
> requested from the module that was previously disabled.
Thanks.

>> if (!bank->>gpio_status && (cpu_is_omap24xx() || cpu_is_omap34xx() ||
>> cpu_is_omap44xx())) {
>>        u32 ctrl = __raw_readl(bank->>base + OMAP24XX_GPIO_CTRL);
>>        /* Module is enabled, clocks are not gated */
>>        ctrl &= 0xFFFFFFFE;
>>        __raw_writel(ctrl, bank->>base + OMAP24XX_GPIO_CTRL);
>> }
>> bank->>gpio_status |= 1 << offset;
> Why to touch gpio_status if not used (for other than 34xx/24xx/44xx cases)? 
either the gpio_status should be under a #ifdef for 34xx when defining 
or it should be usable by all. what it does now is do both.

my proposal is to allow gpio_status to be usable by ALL OMAPs -> maybe 
OMAP1 also could also use it.. I cannot comment - but it does look to 
have scope of usage beyond omap2/3/4 series?

-- 
Regards,
Nishanth Menon

  reply	other threads:[~2009-10-24  5:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-23 15:55 [PATCH] [OMAP] GPIO Module disable if all pins inactive charu
2009-10-24  0:35 ` Nishanth Menon
2009-10-24  4:05   ` Varadarajan, Charu Latha
2009-10-24  5:48     ` Nishanth Menon [this message]
2009-10-26  9:07       ` Varadarajan, Charu Latha
2009-10-26 10:33         ` Menon, Nishanth
2009-10-26 10:46           ` Varadarajan, Charu Latha

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=4AE29527.3050402@ti.com \
    --to=nm@ti.com \
    --cc=charu@ti.com \
    --cc=linux-omap@vger.kernel.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