From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: Axel Lin <axel.lin@gmail.com>
Cc: linux-kernel@vger.kernel.org, Alan Cox <alan@linux.intel.com>,
Grant Likely <grant.likely@secretlab.ca>,
Linus Walleij <linus.walleij@linaro.org>
Subject: Re: [PATCH] gpio: msic: Fix calculating register address in msic_gpio_to_oreg()
Date: Tue, 24 Jul 2012 16:38:02 +0300 [thread overview]
Message-ID: <500EA53A.5020606@linux.intel.com> (raw)
In-Reply-To: <1343126116.6033.1.camel@phoenix>
On 07/24/2012 01:35 PM, Axel Lin wrote:
> In the case offset is 20 ... 23, the equation to get the register should be:
> INTEL_MSIC_GPIO1HV0CTLO - offset + 20
>
> With above equation, we can get below mapping between offset and the register:
> offset is 20: INTEL_MSIC_GPIO1HV0CTLO
> offset is 21: INTEL_MSIC_GPIO1HV1CTLO
> offset is 22: INTEL_MSIC_GPIO1HV2CTLO
> offset is 23: INTEL_MSIC_GPIO1HV3CTLO
>
> Signed-off-by: Axel Lin<axel.lin@gmail.com>
> ---
> drivers/gpio/gpio-msic.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpio/gpio-msic.c b/drivers/gpio/gpio-msic.c
> index 71a838f..b389862 100644
> --- a/drivers/gpio/gpio-msic.c
> +++ b/drivers/gpio/gpio-msic.c
> @@ -99,7 +99,7 @@ static int msic_gpio_to_oreg(unsigned offset)
> if (offset< 20)
> return INTEL_MSIC_GPIO0HV0CTLO - offset + 16;
>
> - return INTEL_MSIC_GPIO1HV0CTLO + offset + 20;
> + return INTEL_MSIC_GPIO1HV0CTLO - offset + 20;
> }
>
> static int msic_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
Nice, good catch.
The last 4 of the 24 gpios will work properly as outputs with this fix.
Acked-by: Mathias Nyman <mathias.nyman@linux.intel.com>
next prev parent reply other threads:[~2012-07-24 13:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-24 10:35 Axel Lin
2012-07-24 13:38 ` Mathias Nyman [this message]
2012-08-04 23:10 ` Linus Walleij
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=500EA53A.5020606@linux.intel.com \
--to=mathias.nyman@linux.intel.com \
--cc=alan@linux.intel.com \
--cc=axel.lin@gmail.com \
--cc=grant.likely@secretlab.ca \
--cc=linus.walleij@linaro.org \
--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
Powered by JetHome