mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely@secretlab.ca>
To: Adrian Hunter <adrian.hunter@intel.com>
Cc: linux-kernel@vger.kernel.org, Alan Cox <alan@linux.intel.com>
Subject: Re: [PATCH] gpio: langwell: ensure alternate function is cleared
Date: Tue, 4 Oct 2011 12:37:10 -0600	[thread overview]
Message-ID: <20111004183710.GG2870@ponder.secretlab.ca> (raw)
In-Reply-To: <1317641767-2942-1-git-send-email-adrian.hunter@intel.com>

On Mon, Oct 03, 2011 at 02:36:07PM +0300, Adrian Hunter wrote:
> Alternate function must be zero for the pin to act as
> a GPIO.
> 
> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
> Signed-off-by: Alan Cox <alan@linux.intel.com>
> ---
>  drivers/gpio/gpio-langwell.c |   27 +++++++++++++++++++++++++++
>  1 files changed, 27 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/gpio/gpio-langwell.c b/drivers/gpio/gpio-langwell.c
> index d2eb57c..00692e8 100644
> --- a/drivers/gpio/gpio-langwell.c
> +++ b/drivers/gpio/gpio-langwell.c
> @@ -59,6 +59,7 @@ enum GPIO_REG {
>  	GRER,		/* rising edge detect */
>  	GFER,		/* falling edge detect */
>  	GEDR,		/* edge detect result */
> +	GAFR,		/* alt function */
>  };
>  
>  struct lnw_gpio {
> @@ -81,6 +82,31 @@ static void __iomem *gpio_reg(struct gpio_chip *chip, unsigned offset,
>  	return ptr;
>  }
>  
> +static void __iomem *gpio_reg_2bit(struct gpio_chip *chip, unsigned offset,
> +				   enum GPIO_REG reg_type)
> +{
> +	struct lnw_gpio *lnw = container_of(chip, struct lnw_gpio, chip);
> +	unsigned nreg = chip->ngpio / 32;
> +	u8 reg = offset / 16;
> +	void __iomem *ptr;
> +
> +	ptr = (void __iomem *)(lnw->reg_base + reg_type * nreg * 4 + reg * 4);

This looks wrong.  It looks to me like the __iomem annotation should
be added to ->reg_base.

Otherwise, the patch looks okay.


  reply	other threads:[~2011-10-04 20:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-03 11:36 Adrian Hunter
2011-10-04 18:37 ` Grant Likely [this message]
2011-10-05  7:52   ` Adrian Hunter
2011-10-05 16:58     ` Grant Likely
2011-10-06  6:37       ` Adrian Hunter
2011-10-06 10:19         ` Grant Likely
2011-10-06 10:15 ` Grant Likely

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=20111004183710.GG2870@ponder.secretlab.ca \
    --to=grant.likely@secretlab.ca \
    --cc=adrian.hunter@intel.com \
    --cc=alan@linux.intel.com \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®