Re: qi_lb60_keypad driver question?

From: Dmitry Torokhov
Date: Tue Aug 11 2009 - 22:15:56 EST


Hi,

On Wed, Aug 12, 2009 at 12:32:57AM +0800, Xiangfu Liu wrote:
> Hi there
> I have try to write the keypad driver,
> but I don't know if this is the right direction.

These kind of questions are better suited for teh linux-input mailing
list.

> attach is the patch for the openwrt[1] .25 kernel.
>

Which is not telling most of the people anything. For example I have no
idea whta .25 kernel is.

> diff --git a/drivers/input/keyboard/matrix_keypad.c b/drivers/input/keyboard/matrix_keypad.c
> new file mode 100644
> index 0000000..a51273e
> --- /dev/null
> +++ b/drivers/input/keyboard/matrix_keypad.c
> @@ -0,0 +1,347 @@
> +/*
> + * drivers/input/keyboard/matrix_keypad.c
> + *
> + * GPIO driven matrix keyboard driver
> + *

There is already an updated version of matrix_keypad driver in mainline,
you don't need to repost it.

> diff --git a/drivers/input/keyboard/qi_lb60_keypad.c b/drivers/input/keyboard/qi_lb60_keypad.c
> new file mode 100644
> index 0000000..0b2e548
> --- /dev/null
> +++ b/drivers/input/keyboard/qi_lb60_keypad.c

This should go into arch specific board setup code, not in drivers/input

> +
> +static struct platform_device qi_lb60_device = {
> + .name = "qi_lb60-keyboard",
> + .name = "matrix-keypad",

You are setting .name twice. Also, statically allocated platform devices
may not be unregistered. Just create this device once in your board init
code instead of having a separate unloadable module.

--
Dmitry
--
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/