linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
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: Fri, 04 Nov 2011 09:53:30 -0700	[thread overview]
Message-ID: <87aa8bde2d.fsf@ti.com> (raw)
In-Reply-To: <1317803593-12259-25-git-send-email-tarun.kanti@ti.com> (Tarun Kanti DebBarma's message of "Wed, 5 Oct 2011 14:03:13 +0530")

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.

>  		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.

Kevin

> +		__raw_writel(bank->context.dataout,
> +				bank->base + bank->regs->set_dataout);
> +	else
> +		__raw_writel(bank->context.dataout,
> +				bank->base + bank->regs->dataout);
>  	__raw_writel(bank->context.oe, bank->base + bank->regs->direction);
>  
>  	if (bank->dbck_enable_mask) {

  reply	other threads:[~2011-11-04 16:53 UTC|newest]

Thread overview: 39+ 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 ` [PATCH v8 01/24] gpio/omap: remove dependency on gpio_bank_count 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 ` [PATCH v8 03/24] gpio/omap: make gpio_context part of gpio_bank structure 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 ` [PATCH v8 05/24] gpio/omap: make non-wakeup GPIO part of pdata 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 ` [PATCH v8 07/24] gpio/omap: further cleanup using wkup_en register 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 ` [PATCH v8 09/24] gpio/omap: remove hardcoded offsets in context save/restore 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:33 ` [PATCH v8 11/24] gpio/omap: cleanup omap_gpio_mod_init function 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 ` [PATCH v8 13/24] gpio/omap: remove unnecessary bit-masking for read access 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 ` [PATCH v8 15/24] gpio/omap: fix bankwidth for OMAP7xx MPUIO Tarun Kanti DebBarma
2011-10-05  8:33 ` [PATCH v8 16/24] gpio/omap: use pm-runtime framework Tarun Kanti DebBarma
2011-11-04 17:13   ` Kevin Hilman
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 ` [PATCH v8 18/24] gpio/omap: optimize suspend and resume functions 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 ` [PATCH v8 20/24] gpio/omap: remove omap_gpio_save_context overhead 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 ` [PATCH v8 22/24] gpio/omap: enable irq at the end of all configuration in restore 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 ` [PATCH v8 24/24] gpio/omap: handle set_dataout reg capable IP on restore Tarun Kanti DebBarma
2011-11-04 16:53   ` Kevin Hilman [this message]
2011-11-07 12:05     ` DebBarma, Tarun Kanti
2011-11-23 12:31       ` DebBarma, Tarun Kanti
2011-11-23 19:54         ` Kevin Hilman
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-04  9:27   ` DebBarma, Tarun Kanti
2011-11-25 10:30     ` DebBarma, Tarun Kanti
2011-11-29 15:15       ` Kevin Hilman
2011-11-30 14:39         ` T Krishnamoorthy, Balaji
2011-11-28  8:23   ` DebBarma, Tarun Kanti
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=87aa8bde2d.fsf@ti.com \
    --to=khilman@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).