mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely@secretlab.ca>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: linux-kernel@vger.kernel.org, sodaville@linutronix.de
Subject: Re: [PATCH 1/2] gpio/gpio-generic: read set register for caching if available
Date: Mon, 4 Jul 2011 09:44:47 -0600	[thread overview]
Message-ID: <20110704154447.GG29977@ponder.secretlab.ca> (raw)
In-Reply-To: <1309159583-11339-1-git-send-email-bigeasy@linutronix.de>

On Mon, Jun 27, 2011 at 09:26:22AM +0200, Sebastian Andrzej Siewior wrote:
> The ->data is a shadow copy which is used during the ->set callback in
> order to avoid a read of the register before write.
> If ->reg_set is set then we write to this location therefore we should
> cache that value.
> 
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---
>  drivers/gpio/gpio-generic.c |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/gpio/gpio-generic.c b/drivers/gpio/gpio-generic.c
> index 231714d..9f8b5c6 100644
> --- a/drivers/gpio/gpio-generic.c
> +++ b/drivers/gpio/gpio-generic.c
> @@ -398,7 +398,10 @@ int __devinit bgpio_init(struct bgpio_chip *bgc,
>  	if (ret)
>  		return ret;
>  
> -	bgc->data = bgc->read_reg(bgc->reg_dat);
> +	if (bgc->reg_set)
> +		bgc->data = bgc->read_reg(bgc->reg_set);

On most of the gpio controllers that I've seen, the 'set' register
isn't something that you can actually read.  I don't think this is
something that can be done for all gpio controllers.

g.

> +	else
> +		bgc->data = bgc->read_reg(bgc->reg_dat);
>  
>  	return ret;
>  }
> -- 
> 1.7.4.4
> 

  parent reply	other threads:[~2011-07-04 15:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-27  7:26 Sebastian Andrzej Siewior
2011-06-27  7:26 ` [PATCH v2 2/2] gpio: Add a driver for Sodaville GPIO controller Sebastian Andrzej Siewior
2011-06-27  9:33   ` Alan Cox
2011-06-27 10:34     ` Sebastian Andrzej Siewior
2011-07-04  7:26   ` [sodaville] " Sebastian Andrzej Siewior
2011-07-04 16:19   ` Grant Likely
2011-07-04 16:29     ` Sebastian Andrzej Siewior
2011-07-04 16:33       ` Grant Likely
2011-07-04 16:35         ` Grant Likely
2011-08-01 16:44           ` [sodaville] " Sebastian Andrzej Siewior
2011-07-04 15:44 ` Grant Likely [this message]
2011-07-04 15:57   ` [PATCH 1/2] gpio/gpio-generic: read set register for caching if available Sebastian Andrzej Siewior
2011-07-20  7:24   ` [PATCH 1/2 v2] gpio/gpio-generic: read correct " Sebastian Andrzej Siewior

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=20110704154447.GG29977@ponder.secretlab.ca \
    --to=grant.likely@secretlab.ca \
    --cc=bigeasy@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sodaville@linutronix.de \
    /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

Powered by JetHome