Re: Fwd: PXA27X and PINCTRL (gpio-pxa.c)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 12 Nov 2018 at 00:29, Robert Jarzmik <robert.jarzmik@xxxxxxx> wrote:
>
> Greg <greguu@xxxxxxxx> writes:
>
> > On Sun, 11 Nov 2018 at 09:55, Robert Jarzmik <robert.jarzmik@xxxxxxx> wrote:
> >>
> >> Greg <greguu@xxxxxxxx> writes:
> Ok Greg, I think I know now what is happening. Could you try to apply the patch
> below and report please ?
Yep, that patch seems to work. I tried it on a C3100 (borzoi) and will
do a bit more testing, but it looks very promising. So far all shift
combos work for me and I assume this is the case for all other models
that use the same keyboard defined in spitz.c - Thanks.

Cheers,
Greg

> [1] Patch
> --8>--
> From 1ad797ad5d116a8573102e27fceffa31b1b89395 Mon Sep 17 00:00:00 2001
> From: Robert Jarzmik <robert.jarzmik@xxxxxxx>
> Date: Sun, 11 Nov 2018 12:20:25 +0100
> Subject: [PATCH] gpio: pxa: fix legacy non pinctrl aware builds again
>
> As pointed out by Gregor, spitz keyboard matrix is broken, with or
> without CONFIG_PINCTRL set, quoting :
> "The gpio matrix keypard on the Zaurus C3x00 (see spitz.c) does not work
> properly. Noticeable are that rshift+c does nothing where as lshift+c
> creates C.  Opposite it is for rshift+a vs lshift+a, here only rshift
> works. This affects a few other combinations using the rshift or lshift
> buttons."
>
> As a matter of fact, as for platform_data based builds CONFIG_PINCTRL=n
> is required for now (as opposed for devicetree builds where it should be
> set), this means gpio driver should change the direction, which is what
> was attempted by commit c4e5ffb6f224 ("gpio: pxa: fix legacy non pinctrl
> aware builds").
>
> Unfortunately, the input case was inverted, and the direction change was
> never done. This wasn't seen up until now because the initial platform
> setup (MFP) was setting this direction. Yet in Gregory's case, the
> matrix-keypad driver changes back and forth the direction dynamically,
> and this is why he's the first to report it.
>
> Reported-by: Greg <greguu@xxxxxxxx>
> Fixes: c4e5ffb6f224 ("gpio: pxa: fix legacy non pinctrl aware builds")
> Signed-off-by: Robert Jarzmik <robert.jarzmik@xxxxxxx>
> ---
>  drivers/gpio/gpio-pxa.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c
> index 63536655f274..501147c5f3ca 100644
> --- a/drivers/gpio/gpio-pxa.c
> +++ b/drivers/gpio/gpio-pxa.c
> @@ -268,8 +268,8 @@ static int pxa_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
>
>         if (pxa_gpio_has_pinctrl()) {
>                 ret = pinctrl_gpio_direction_input(chip->base + offset);
> -               if (!ret)
> -                       return 0;
> +               if (ret)
> +                       return ret;
>         }
>
>         spin_lock_irqsave(&gpio_lock, flags);
> --
> 2.11.0



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux