mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely@secretlab.ca>
To: "Lothar Waßmann" <LW@KARO-electronics.de>
Cc: linux-arm-kernel@lists.infradead.org,
	Sascha Hauer <s.hauer@pengutronix.de>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] plat-mxc: add missing initialisation of basic_mmio_gpio shadow variables
Date: Thu, 7 Jul 2011 12:43:21 -0600	[thread overview]
Message-ID: <20110707184321.GG2824@ponder.secretlab.ca> (raw)
In-Reply-To: <1310043016-1121-1-git-send-email-LW@KARO-electronics.de>

On Thu, Jul 07, 2011 at 02:50:16PM +0200, Lothar Waßmann wrote:
> The bgpio_init() function does not initialise the shadow register for
> the GPIO direction register. Thus, when configuring the first GPIO with
> gpio_set_direction() all other GPIOs of the same bank will be
> configured as inputs. Since the bgpio layer cannot know whether the
> register is readable, the initialisation should be done by the caller
> of bgpio_init().
> 
> Also, the 'data' shadow variable that is used inside basic_mmio_gpio
> to cache the current value of the GPIO_DR register is initialised from
> the GPIO_PSR register within bgpio_init(). Thus when setting the
> output value of a certain GPIO, the other GPIO outputs of the same
> bank will be set or cleared depending on the pin state of the GPIO
> inputs during bgpio_init().
> 
> 
> Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>

Applied, thanks.

g.

> ---
>  drivers/gpio/gpio-mxc.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c
> index b351952..f7944ca 100644
> --- a/drivers/gpio/gpio-mxc.c
> +++ b/drivers/gpio/gpio-mxc.c
> @@ -337,6 +337,8 @@ static int __devinit mxc_gpio_probe(struct platform_device *pdev)
>  		goto out_iounmap;
>  
>  	port->bgc.gc.base = pdev->id * 32;
> +	port->bgc.dir = port->bgc.read_reg(port->bgc.reg_dir);
> +	port->bgc.data = port->bgc.read_reg(port->bgc.reg_set);
>  
>  	err = gpiochip_add(&port->bgc.gc);
>  	if (err)
> -- 
> 1.5.6.5
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

      reply	other threads:[~2011-07-07 18:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-07 12:50 Lothar Waßmann
2011-07-07 18:43 ` Grant Likely [this message]

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=20110707184321.GG2824@ponder.secretlab.ca \
    --to=grant.likely@secretlab.ca \
    --cc=LW@KARO-electronics.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=s.hauer@pengutronix.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

all inboxes | Powered by JetHome®