From: Kevin Hilman <khilman@ti.com>
To: "DebBarma, Tarun Kanti" <tarun.kanti@ti.com>
Cc: Tony Lindgren <tony@atomide.com>, Nishanth Menon <nm@ti.com>,
linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v8 24/24] gpio/omap: handle set_dataout reg capable IP on restore
Date: Wed, 23 Nov 2011 11:54:15 -0800 [thread overview]
Message-ID: <87zkfmaa3c.fsf@ti.com> (raw)
In-Reply-To: <CAC83ZvL9w=7RhAuT=5ahbDX+d6miQMif1ngOenEiqP4UN2+mzg@mail.gmail.com> (Tarun Kanti DebBarma's message of "Wed, 23 Nov 2011 18:01:35 +0530")
"DebBarma, Tarun Kanti" <tarun.kanti@ti.com> writes:
> On Mon, Nov 7, 2011 at 5:35 PM, DebBarma, Tarun Kanti
> <tarun.kanti@ti.com> wrote:
>> On Fri, Nov 4, 2011 at 10:23 PM, Kevin Hilman <khilman@ti.com> wrote:
>>> Tarun Kanti DebBarma <tarun.kanti@ti.com> writes:
>>>
>>>> From: Nishanth Menon <nm@ti.com>
>>>>
>>>> GPIO IP revisions such as those used in OMAP4 have a set_dataout
>>>> while the previous revisions used a single dataout register.
>>>> Depending on what is available restore the dataout settings
>>>> to the right register.
>>>>
>>>> Signed-off-by: Nishanth Menon <nm@ti.com>
>>>> Signed-off-by: Tarun Kanti DebBarma <tarun.kanti@ti.com>
>>>> Reviewed-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
>>>> ---
>>>> drivers/gpio/gpio-omap.c | 9 +++++++--
>>>> 1 files changed, 7 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
>>>> index 4009446..3df7a98 100644
>>>> --- a/drivers/gpio/gpio-omap.c
>>>> +++ b/drivers/gpio/gpio-omap.c
>>>> @@ -1073,7 +1073,7 @@ static int __devinit omap_gpio_probe(struct platform_device *pdev)
>>>> bank->get_context_loss_count = pdata->get_context_loss_count;
>>>> bank->regs = pdata->regs;
>>>>
>>>> - if (bank->regs->set_dataout && bank->regs->clr_dataout)
>>>> + if (bank->regs->set_dataout)
>>>
>>> This change isn't right.
>>>
>>> The _set_gpio_dataout_reg function depends on the existence of
>>> ->clr_dataout too.
>> Ok, I will add the clr_dataout condtion as well.
>
>>
>>>
>>>> bank->set_dataout = _set_gpio_dataout_reg;
>>>> else
>>>> bank->set_dataout = _set_gpio_dataout_mask;
>>>> @@ -1351,7 +1351,12 @@ static void omap_gpio_restore_context(struct gpio_bank *bank)
>>>> bank->base + bank->regs->risingdetect);
>>>> __raw_writel(bank->context.fallingdetect,
>>>> bank->base + bank->regs->fallingdetect);
>>>> - __raw_writel(bank->context.dataout, bank->base + bank->regs->dataout);
>>>> + if (bank->regs->set_dataout)
>>>
>>> Why the check again? The check has already been done in probe.
>>>
>>> Just use bank->set_dataout() here.
>> Sure, i will make the change.
>
> When I look at the signature of set_dataout(), it does not seem
> straight forward to be used here. It expects (struct gpio_bank *bank,
> int gpio, int enable) to be passed to it.
IOW, it expects to only set 1 bit, where the context restore needs to
set the value for the whole register.
OK, then keep the original version, but make sure the if statement
matches is checking for ->set_dataout and ->clr_dataout like the other one.
Kevin
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
From: khilman@ti.com (Kevin Hilman)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v8 24/24] gpio/omap: handle set_dataout reg capable IP on restore
Date: Wed, 23 Nov 2011 11:54:15 -0800 [thread overview]
Message-ID: <87zkfmaa3c.fsf@ti.com> (raw)
In-Reply-To: <CAC83ZvL9w=7RhAuT=5ahbDX+d6miQMif1ngOenEiqP4UN2+mzg@mail.gmail.com> (Tarun Kanti DebBarma's message of "Wed, 23 Nov 2011 18:01:35 +0530")
"DebBarma, Tarun Kanti" <tarun.kanti@ti.com> writes:
> On Mon, Nov 7, 2011 at 5:35 PM, DebBarma, Tarun Kanti
> <tarun.kanti@ti.com> wrote:
>> On Fri, Nov 4, 2011 at 10:23 PM, Kevin Hilman <khilman@ti.com> wrote:
>>> Tarun Kanti DebBarma <tarun.kanti@ti.com> writes:
>>>
>>>> From: Nishanth Menon <nm@ti.com>
>>>>
>>>> GPIO IP revisions such as those used in OMAP4 have a set_dataout
>>>> while the previous revisions used a single dataout register.
>>>> Depending on what is available restore the dataout settings
>>>> to the right register.
>>>>
>>>> Signed-off-by: Nishanth Menon <nm@ti.com>
>>>> Signed-off-by: Tarun Kanti DebBarma <tarun.kanti@ti.com>
>>>> Reviewed-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
>>>> ---
>>>> ?drivers/gpio/gpio-omap.c | ? ?9 +++++++--
>>>> ?1 files changed, 7 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
>>>> index 4009446..3df7a98 100644
>>>> --- a/drivers/gpio/gpio-omap.c
>>>> +++ b/drivers/gpio/gpio-omap.c
>>>> @@ -1073,7 +1073,7 @@ static int __devinit omap_gpio_probe(struct platform_device *pdev)
>>>> ? ? ? bank->get_context_loss_count = pdata->get_context_loss_count;
>>>> ? ? ? bank->regs = pdata->regs;
>>>>
>>>> - ? ? if (bank->regs->set_dataout && bank->regs->clr_dataout)
>>>> + ? ? if (bank->regs->set_dataout)
>>>
>>> This change isn't right.
>>>
>>> The _set_gpio_dataout_reg function depends on the existence of
>>> ->clr_dataout too.
>> Ok, I will add the clr_dataout condtion as well.
>
>>
>>>
>>>> ? ? ? ? ? ? ? bank->set_dataout = _set_gpio_dataout_reg;
>>>> ? ? ? else
>>>> ? ? ? ? ? ? ? bank->set_dataout = _set_gpio_dataout_mask;
>>>> @@ -1351,7 +1351,12 @@ static void omap_gpio_restore_context(struct gpio_bank *bank)
>>>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? bank->base + bank->regs->risingdetect);
>>>> ? ? ? __raw_writel(bank->context.fallingdetect,
>>>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? bank->base + bank->regs->fallingdetect);
>>>> - ? ? __raw_writel(bank->context.dataout, bank->base + bank->regs->dataout);
>>>> + ? ? if (bank->regs->set_dataout)
>>>
>>> Why the check again? ?The check has already been done in probe.
>>>
>>> Just use bank->set_dataout() here.
>> Sure, i will make the change.
>
> When I look at the signature of set_dataout(), it does not seem
> straight forward to be used here. It expects (struct gpio_bank *bank,
> int gpio, int enable) to be passed to it.
IOW, it expects to only set 1 bit, where the context restore needs to
set the value for the whole register.
OK, then keep the original version, but make sure the if statement
matches is checking for ->set_dataout and ->clr_dataout like the other one.
Kevin
next prev parent reply other threads:[~2011-11-23 19:54 UTC|newest]
Thread overview: 78+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-05 8:32 [PATCH v8 00/24] gpio/omap: driver cleanup and fixes Tarun Kanti DebBarma
2011-10-05 8:32 ` Tarun Kanti DebBarma
2011-10-05 8:32 ` [PATCH v8 01/24] gpio/omap: remove dependency on gpio_bank_count Tarun Kanti DebBarma
2011-10-05 8:32 ` Tarun Kanti DebBarma
2011-10-05 8:32 ` [PATCH v8 02/24] gpio/omap: use flag to identify wakeup domain Tarun Kanti DebBarma
2011-10-05 8:32 ` Tarun Kanti DebBarma
2011-10-05 8:32 ` [PATCH v8 03/24] gpio/omap: make gpio_context part of gpio_bank structure Tarun Kanti DebBarma
2011-10-05 8:32 ` Tarun Kanti DebBarma
2011-10-05 8:32 ` [PATCH v8 04/24] gpio/omap: handle save/restore context in GPIO driver Tarun Kanti DebBarma
2011-10-05 8:32 ` Tarun Kanti DebBarma
2011-10-05 8:32 ` [PATCH v8 05/24] gpio/omap: make non-wakeup GPIO part of pdata Tarun Kanti DebBarma
2011-10-05 8:32 ` Tarun Kanti DebBarma
2011-10-05 8:32 ` [PATCH v8 06/24] gpio/omap: avoid cpu checks during module ena/disable Tarun Kanti DebBarma
2011-10-05 8:32 ` Tarun Kanti DebBarma
2011-10-05 8:32 ` [PATCH v8 07/24] gpio/omap: further cleanup using wkup_en register Tarun Kanti DebBarma
2011-10-05 8:32 ` Tarun Kanti DebBarma
2011-10-05 8:32 ` [PATCH v8 08/24] gpio/omap: use level/edge detect reg offsets Tarun Kanti DebBarma
2011-10-05 8:32 ` Tarun Kanti DebBarma
2011-10-05 8:32 ` [PATCH v8 09/24] gpio/omap: remove hardcoded offsets in context save/restore Tarun Kanti DebBarma
2011-10-05 8:32 ` Tarun Kanti DebBarma
2011-10-05 8:32 ` [PATCH v8 10/24] gpio/omap: cleanup set_gpio_triggering function Tarun Kanti DebBarma
2011-10-05 8:32 ` Tarun Kanti DebBarma
2011-10-05 8:33 ` [PATCH v8 11/24] gpio/omap: cleanup omap_gpio_mod_init function Tarun Kanti DebBarma
2011-10-05 8:33 ` Tarun Kanti DebBarma
2011-10-05 8:33 ` [PATCH v8 12/24] gpio/omap: use pinctrl offset instead of macro Tarun Kanti DebBarma
2011-10-05 8:33 ` Tarun Kanti DebBarma
2011-10-05 8:33 ` [PATCH v8 13/24] gpio/omap: remove unnecessary bit-masking for read access Tarun Kanti DebBarma
2011-10-05 8:33 ` Tarun Kanti DebBarma
2011-10-05 8:33 ` [PATCH v8 14/24] gpio/omap: remove bank->method & METHOD_* macros Tarun Kanti DebBarma
2011-10-05 8:33 ` Tarun Kanti DebBarma
2011-10-05 8:33 ` [PATCH v8 15/24] gpio/omap: fix bankwidth for OMAP7xx MPUIO Tarun Kanti DebBarma
2011-10-05 8:33 ` Tarun Kanti DebBarma
2011-10-05 8:33 ` [PATCH v8 16/24] gpio/omap: use pm-runtime framework Tarun Kanti DebBarma
2011-10-05 8:33 ` Tarun Kanti DebBarma
2011-11-04 17:13 ` Kevin Hilman
2011-11-04 17:13 ` Kevin Hilman
2011-11-07 10:09 ` DebBarma, Tarun Kanti
2011-11-07 10:09 ` DebBarma, Tarun Kanti
2011-10-05 8:33 ` [PATCH v8 17/24] gpio/omap: fix debounce clock handling Tarun Kanti DebBarma
2011-10-05 8:33 ` Tarun Kanti DebBarma
2011-10-05 8:33 ` [PATCH v8 18/24] gpio/omap: optimize suspend and resume functions Tarun Kanti DebBarma
2011-10-05 8:33 ` Tarun Kanti DebBarma
2011-10-05 8:33 ` [PATCH v8 19/24] gpio/omap: cleanup prepare_for_idle and resume_after_idle Tarun Kanti DebBarma
2011-10-05 8:33 ` Tarun Kanti DebBarma
2011-10-05 8:33 ` [PATCH v8 20/24] gpio/omap: remove omap_gpio_save_context overhead Tarun Kanti DebBarma
2011-10-05 8:33 ` Tarun Kanti DebBarma
2011-10-05 8:33 ` [PATCH v8 21/24] gpio/omap: save and restore debounce registers Tarun Kanti DebBarma
2011-10-05 8:33 ` Tarun Kanti DebBarma
2011-10-05 8:33 ` [PATCH v8 22/24] gpio/omap: enable irq at the end of all configuration in restore Tarun Kanti DebBarma
2011-10-05 8:33 ` Tarun Kanti DebBarma
2011-10-05 8:33 ` [PATCH v8 23/24] gpio/omap: restore OE only after setting the output level Tarun Kanti DebBarma
2011-10-05 8:33 ` Tarun Kanti DebBarma
2011-10-05 8:33 ` [PATCH v8 24/24] gpio/omap: handle set_dataout reg capable IP on restore Tarun Kanti DebBarma
2011-10-05 8:33 ` Tarun Kanti DebBarma
2011-11-04 16:53 ` Kevin Hilman
2011-11-04 16:53 ` Kevin Hilman
2011-11-07 12:05 ` DebBarma, Tarun Kanti
2011-11-07 12:05 ` DebBarma, Tarun Kanti
2011-11-23 12:31 ` DebBarma, Tarun Kanti
2011-11-23 12:31 ` DebBarma, Tarun Kanti
2011-11-23 19:54 ` Kevin Hilman [this message]
2011-11-23 19:54 ` Kevin Hilman
2011-11-24 5:31 ` DebBarma, Tarun Kanti
2011-11-24 5:31 ` DebBarma, Tarun Kanti
2011-11-03 21:44 ` [PATCH v8 00/24] gpio/omap: driver cleanup and fixes Kevin Hilman
2011-11-03 21:44 ` Kevin Hilman
2011-11-04 9:27 ` DebBarma, Tarun Kanti
2011-11-04 9:27 ` DebBarma, Tarun Kanti
2011-11-25 10:30 ` DebBarma, Tarun Kanti
2011-11-25 10:30 ` DebBarma, Tarun Kanti
2011-11-29 15:15 ` Kevin Hilman
2011-11-29 15:15 ` Kevin Hilman
2011-11-30 14:39 ` T Krishnamoorthy, Balaji
2011-11-30 14:39 ` T Krishnamoorthy, Balaji
2011-11-28 8:23 ` DebBarma, Tarun Kanti
2011-11-28 8:23 ` DebBarma, Tarun Kanti
2011-11-29 15:17 ` Kevin Hilman
2011-11-29 15:17 ` Kevin Hilman
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=87zkfmaa3c.fsf@ti.com \
--to=khilman@ti.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--cc=nm@ti.com \
--cc=tarun.kanti@ti.com \
--cc=tony@atomide.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.