Re: [PATCH 1/1] [INPUT/KEYPAD] gpio keypad: Replace current blackfin specific pfbutton driver with kernel generic gpio key driver

From: pHilipp Zabel
Date: Mon May 12 2008 - 07:27:37 EST


Hi,

On Mon, May 12, 2008 at 12:17 PM, Bryan Wu <cooloney@xxxxxxxxxx> wrote:
> From: Michael Hennerich <michael.hennerich@xxxxxxxxxx>
>
> It's an actual deficiency in the hardware that we can't address,
> so it needs to be worked around in software.
>
> Signed-off-by: Michael Hennerich <michael.hennerich@xxxxxxxxxx>
> Signed-off-by: Bryan Wu <cooloney@xxxxxxxxxx>
> ---
> drivers/input/keyboard/gpio_keys.c | 15 ++++++++++++++-
> 1 files changed, 14 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
> index bbd00c3..d856eb9 100644
> --- a/drivers/input/keyboard/gpio_keys.c
> +++ b/drivers/input/keyboard/gpio_keys.c
> @@ -26,6 +26,18 @@
>
> #include <asm/gpio.h>
>
> +#if defined(CONFIG_BLACKFIN) && !defined(BF548_FAMILY)
> +
> +/*
> + * On some Blackfin CPUs reading edge triggered
> + * GPIOs doesn't return the current value
> + */

If this is a generic problem, shouldn't this be addressed inside gpio_get_value?

> +
> +#define GPIOKEYS_EDGE_SENSE(x) set_gpio_edge(gpio, x)
> +#else
> +#define GPIOKEYS_EDGE_SENSE(x) do {} while (0)
> +#endif
> +
> static irqreturn_t gpio_keys_isr(int irq, void *dev_id)
> {
> int i;
> @@ -39,8 +51,9 @@ static irqreturn_t gpio_keys_isr(int irq, void *dev_id)
>
> if (irq == gpio_to_irq(gpio)) {
> unsigned int type = button->type ?: EV_KEY;
> + GPIOKEYS_EDGE_SENSE(0);
> int state = (gpio_get_value(gpio) ? 1 : 0) ^ button->active_low;
> -
> + GPIOKEYS_EDGE_SENSE(1);
> input_event(input, type, button->code, !!state);
> input_sync(input);
> return IRQ_HANDLED;
> --
> 1.5.5
>
>

regards
Philipp
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/