[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <500EA53A.5020606@linux.intel.com>
Date: Tue, 24 Jul 2012 16:38:02 +0300
From: Mathias Nyman <mathias.nyman@...ux.intel.com>
To: Axel Lin <axel.lin@...il.com>
CC: linux-kernel@...r.kernel.org, Alan Cox <alan@...ux.intel.com>,
Grant Likely <grant.likely@...retlab.ca>,
Linus Walleij <linus.walleij@...aro.org>
Subject: Re: [PATCH] gpio: msic: Fix calculating register address in msic_gpio_to_oreg()
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@...il.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@...ux.intel.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists