From: dmitry.torokhov@gmail.com (Dmitry Torokhov)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 04/17] input: make LoCoMo keyboard driver support both poodle and collie
Date: Mon, 18 May 2015 09:50:58 -0700 [thread overview]
Message-ID: <20150518165058.GB19708@dtor-ws> (raw)
In-Reply-To: <1431880077-26321-5-git-send-email-dbaryshkov@gmail.com>
On Sun, May 17, 2015 at 07:27:44PM +0300, Dmitry Eremin-Solenikov wrote:
> Keyboards on collie and poodle differ only in wiring of 'Home' key.
> Instead of complicating the driver with platform data, just check for
> the machine for the time being. This will be converted to DTS property
> sometime in the future.
>
> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> ---
> drivers/input/keyboard/locomokbd.c | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/input/keyboard/locomokbd.c b/drivers/input/keyboard/locomokbd.c
> index 1657bc0..b422608 100644
> --- a/drivers/input/keyboard/locomokbd.c
> +++ b/drivers/input/keyboard/locomokbd.c
> @@ -33,6 +33,9 @@
> #include <linux/slab.h>
> #include <linux/mfd/locomo.h>
>
> +/* There is one minor difference between mappings on poodle and collie */
> +#include <asm/mach-types.h>
> +
> #define KEY_ACTIVITY KEY_F16
> #define KEY_CONTACT KEY_F18
> #define KEY_CENTER KEY_F15
> @@ -45,7 +48,7 @@
> static const unsigned char
> locomokbd_keycode[LOCOMOKBD_NUMKEYS] = {
> 0, KEY_ESC, KEY_ACTIVITY, 0, 0, 0, 0, 0, 0, 0, /* 0 - 9 */
> - 0, 0, 0, 0, 0, 0, 0, KEY_MENU, KEY_HOME, KEY_CONTACT, /* 10 - 19 */
> + 0, 0, 0, 0, 0, 0, 0, KEY_MENU, 0, KEY_CONTACT, /* 10 - 19 */
> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 20 - 29 */
> 0, 0, 0, KEY_CENTER, 0, KEY_MAIL, 0, 0, 0, 0, /* 30 - 39 */
> 0, 0, 0, 0, 0, 0, 0, 0, 0, KEY_RIGHT, /* 40 - 49 */
> @@ -278,6 +281,11 @@ static int locomokbd_probe(struct platform_device *dev)
> locomokbd_keycode,
> sizeof(locomokbd->keycode));
>
> + if (machine_is_collie())
> + locomokbd->keycode[18] = KEY_HOME;
> + else
> + locomokbd->keycode[3] = KEY_HOME;
> +
> for (i = 0; i < LOCOMOKBD_NUMKEYS; i++)
> input_set_capability(input_dev, EV_KEY, locomokbd->keycode[i]);
> input_set_capability(input_dev, EV_PWR, KEY_SUSPEND);
> --
> 2.1.4
>
--
Dmitry
next prev parent reply other threads:[~2015-05-18 16:50 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-17 16:27 [PATCH v3 00/17] new LoCoMo driver set Dmitry Eremin-Solenikov
2015-05-17 16:27 ` [PATCH v3 01/17] mfd: add new driver for Sharp LoCoMo Dmitry Eremin-Solenikov
2015-05-19 10:38 ` Lee Jones
2015-05-19 11:21 ` Russell King - ARM Linux
2015-05-19 12:33 ` Lee Jones
2015-05-17 16:27 ` [PATCH v3 02/17] leds: port locomo leds driver to new locomo core Dmitry Eremin-Solenikov
2015-05-18 8:37 ` Jacek Anaszewski
2015-05-17 16:27 ` [PATCH v3 03/17] input: convert LoCoMo keyboard driver to use " Dmitry Eremin-Solenikov
2015-05-18 16:50 ` Dmitry Torokhov
2015-05-17 16:27 ` [PATCH v3 04/17] input: make LoCoMo keyboard driver support both poodle and collie Dmitry Eremin-Solenikov
2015-05-18 16:50 ` Dmitry Torokhov [this message]
2015-05-17 16:27 ` [PATCH v3 05/17] video: backlight: add new locomo backlight driver Dmitry Eremin-Solenikov
2015-05-17 16:27 ` [PATCH v3 06/17] video: lcd: add LoCoMo LCD driver Dmitry Eremin-Solenikov
2015-05-19 9:36 ` Lee Jones
2015-05-19 9:45 ` Dmitry Eremin-Solenikov
2015-05-19 12:34 ` Lee Jones
2015-05-17 16:27 ` [PATCH v3 07/17] gpio: port LoCoMo gpio support from old driver Dmitry Eremin-Solenikov
2015-05-17 16:27 ` [PATCH v3 08/17] gpio: locomo: implement per-pin irq handling Dmitry Eremin-Solenikov
2015-05-17 16:27 ` [PATCH v3 09/17] spi: add locomo SPI driver Dmitry Eremin-Solenikov
2015-05-17 16:27 ` [PATCH v3 10/17] i2c: add locomo i2c driver Dmitry Eremin-Solenikov
2015-05-17 16:27 ` [PATCH v3 11/17] ARM: sa1100: make collie use new locomo drivers Dmitry Eremin-Solenikov
2015-05-17 16:27 ` [PATCH v3 12/17] ARM: sa1100: don't preallocate IRQ space for locomo Dmitry Eremin-Solenikov
2015-05-17 16:27 ` [PATCH v3 13/17] ASoC: pxa: poodle: make use of new locomo GPIO interface Dmitry Eremin-Solenikov
2015-05-17 16:27 ` [PATCH v3 14/17] ARM: pxa: poodle: use new LoCoMo driver Dmitry Eremin-Solenikov
2015-05-17 16:27 ` [PATCH v3 15/17] ARM: pxa: poodle: don't preallocate IRQ space for locomo Dmitry Eremin-Solenikov
2015-05-17 16:27 ` [PATCH v3 16/17] video: backlight: drop old locomo bl/lcd driver Dmitry Eremin-Solenikov
2015-05-17 16:27 ` [PATCH v3 17/17] ARM: drop old LoCoMo driver Dmitry Eremin-Solenikov
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=20150518165058.GB19708@dtor-ws \
--to=dmitry.torokhov@gmail.com \
--cc=linux-arm-kernel@lists.infradead.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