From: jon-hunter@ti.com (Jon Hunter)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3] gpio/omap: fix off-mode bug: clear debounce clock enable mask on free/reset
Date: Fri, 26 Oct 2012 14:14:55 -0500 [thread overview]
Message-ID: <508AE12F.5080704@ti.com> (raw)
In-Reply-To: <508A273E.3020500@ti.com>
On 10/26/2012 01:01 AM, Santosh Shilimkar wrote:
> Jon,
>
> On Friday 26 October 2012 04:22 AM, Jon Hunter wrote:
>> Hi Kevin,
>>
>> On 10/25/2012 11:34 AM, Kevin Hilman wrote:
>>> From: Kevin Hilman <khilman@ti.com>
>>>
>
> [...]
>
>>> diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
>>> index 94cbc84..ce1da19 100644
>>> --- a/drivers/gpio/gpio-omap.c
>>> +++ b/drivers/gpio/gpio-omap.c
>>> @@ -539,6 +539,8 @@ static void _reset_gpio(struct gpio_bank *bank,
>>> int gpio)
>>> _set_gpio_irqenable(bank, gpio, 0);
>>> _clear_gpio_irqstatus(bank, gpio);
>>> _set_gpio_triggering(bank, GPIO_INDEX(bank, gpio), IRQ_TYPE_NONE);
>>> + bank->dbck_enable_mask &= ~(GPIO_BIT(bank, gpio));
>>> + _gpio_dbck_disable(bank);
>>
>> We can't use _gpio_dbck_disable() here. This has been specifically
>> implemented
>> for the suspend path and is designed to disable the debounce clock while
>> debounce is enabled (which makes sense). Yes this needs to be cleaned up.
>>
> I thought this bit was clear on v2 discussion list that debounce
> clock disable needs to be conditional based on debounce mask.
Yes that part was crystal clear ;-)
However, what I had overlooked was how _gpio_dbck_disable() was
implemented and is intended to work. Hence, I do not call this new in
the _gpio_clear_debounce() function.
>> From 33812f3bd4f7aab1154e7194b7f11fba700a5086 Mon Sep 17 00:00:00 2001
>> From: Jon Hunter <jon-hunter@ti.com>
>> Date: Thu, 25 Oct 2012 16:00:51 -0500
>> Subject: [PATCH] gpio/omap: fix clearing of debounce settings on gpio
>> free/reset
>>
>> When a GPIO is freed or shutdown, we need to ensure that any debounce
>> settings
>> are cleared and if the GPIO is the only GPIO in the bank that is
>> currently
>> using debounce, then disable the debounce clock as well to save power.
>>
>> Therefore, introduce a new function called _clear_gpio_debounce() to
>> clear
>> any debounce settings when the GPIO is freed or shutdown.
>>
>> Please note that we cannot use _gpio_dbck_disable() to disable the
>> debounce
>> clock because this has been specifically created for the gpio suspend
>> path
>> and is intended to shutdown the debounce clock while debounce is enabled.
>>
>> This has been unit tested on an OMAP3430 Beagle board, by requesting a
>> gpio,
>> enabling debounce and then freeing the gpio and checking the register
>> contents,
>> the saved register context and the debounce clock state.
>>
>> Signed-off-by: Jon Hunter <jon-hunter@ti.com>
>> ---
> Now that we are aligned, so we can take this patch forward. Feel free
> to add my ack in case you plan to refresh it.
>
> Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Thanks!
Jon
next prev parent reply other threads:[~2012-10-26 19:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-25 16:34 [PATCH v3] gpio/omap: fix off-mode bug: clear debounce clock enable mask on free/reset Kevin Hilman
2012-10-25 22:52 ` Jon Hunter
2012-10-25 23:57 ` Kevin Hilman
2012-10-26 6:01 ` Santosh Shilimkar
2012-10-26 19:14 ` Jon Hunter [this message]
2012-10-27 16:23 ` Linus Walleij
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=508AE12F.5080704@ti.com \
--to=jon-hunter@ti.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).