From: "eric miao" <eric.y.miao@gmail.com>
To: Antonio Ospite <ospite@studenti.unina.it>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>, linux-input@vger.kernel.org
Subject: Re: [PATCH] pxa: Fix some issues with pxa27x_keypad driver v3
Date: Thu, 29 May 2008 08:37:08 +0800 [thread overview]
Message-ID: <f17812d70805281737y1f4440cdo8d94ee609a905b45@mail.gmail.com> (raw)
In-Reply-To: <20080528193624.3b2e97b8.ospite@studenti.unina.it>
On Thu, May 29, 2008 at 1:36 AM, Antonio Ospite
<ospite@studenti.unina.it> wrote:
>
> Fix some issues with pxa27x_keypad driver:
>
> 1. set input bits for direct keys codes
> 2. set input bits for rotary encoder codes only if rotary
> encoder is enabled
> 3. enable EV_REL only if rel_codes are set for rotary encoders
>
> Signed-off-by: Antonio Ospite <ao2@openezx.org>
>
> Index: linux-2.6.26-rc3/drivers/input/keyboard/pxa27x_keypad.c
> ===================================================================
> --- linux-2.6.26-rc3.orig/drivers/input/keyboard/pxa27x_keypad.c
> +++ linux-2.6.26-rc3/drivers/input/keyboard/pxa27x_keypad.c
> @@ -136,6 +136,9 @@
> set_bit(code, input_dev->keybit);
> }
>
> + for (i = 0; i < pdata->direct_key_num; i++)
> + set_bit(pdata->direct_key_map[i], input_dev->keybit);
> +
> keypad->rotary_up_key[0] = pdata->rotary0_up_key;
> keypad->rotary_up_key[1] = pdata->rotary1_up_key;
> keypad->rotary_down_key[0] = pdata->rotary0_down_key;
> @@ -143,17 +146,21 @@
> keypad->rotary_rel_code[0] = pdata->rotary0_rel_code;
> keypad->rotary_rel_code[1] = pdata->rotary1_rel_code;
>
> - if (pdata->rotary0_up_key && pdata->rotary0_down_key) {
> - set_bit(pdata->rotary0_up_key, input_dev->keybit);
> - set_bit(pdata->rotary0_down_key, input_dev->keybit);
> - } else
> - set_bit(pdata->rotary0_rel_code, input_dev->relbit);
> -
> - if (pdata->rotary1_up_key && pdata->rotary1_down_key) {
> - set_bit(pdata->rotary1_up_key, input_dev->keybit);
> - set_bit(pdata->rotary1_down_key, input_dev->keybit);
> - } else
> - set_bit(pdata->rotary1_rel_code, input_dev->relbit);
> + if (pdata->enable_rotary0) {
> + if (pdata->rotary0_up_key && pdata->rotary0_down_key) {
> + set_bit(pdata->rotary0_up_key, input_dev->keybit);
> + set_bit(pdata->rotary0_down_key, input_dev->keybit);
> + } else
> + set_bit(pdata->rotary0_rel_code, input_dev->relbit);
> + }
> +
> + if (pdata->enable_rotary1) {
> + if (pdata->rotary1_up_key && pdata->rotary1_down_key) {
> + set_bit(pdata->rotary1_up_key, input_dev->keybit);
> + set_bit(pdata->rotary1_down_key, input_dev->keybit);
> + } else
> + set_bit(pdata->rotary1_rel_code, input_dev->relbit);
> + }
> }
>
> static inline unsigned int lookup_matrix_keycode(
> @@ -484,8 +491,11 @@
> keypad->input_dev = input_dev;
> input_set_drvdata(input_dev, keypad);
>
> - input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP) |
> - BIT_MASK(EV_REL);
> + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP);
> + if ((keypad->pdata->enable_rotary0 && keypad->pdata->rotary0_rel_code)
> + || (keypad->pdata->enable_rotary1
> + && keypad->pdata->rotary1_rel_code))
> + input_dev->evbit[0] |= BIT_MASK(EV_REL);
>
> pxa27x_keypad_build_keycode(keypad);
> platform_set_drvdata(pdev, keypad);
>
OK
--
Cheers
- eric
prev parent reply other threads:[~2008-05-29 0:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-28 14:25 [PATCH] pxa: Fix some issues with pxa27x_keypad driver v2 Antonio Ospite
2008-05-28 14:31 ` Dmitry Torokhov
2008-05-28 15:11 ` Antonio Ospite
2008-05-28 15:15 ` Dmitry Torokhov
2008-05-28 17:36 ` [PATCH] pxa: Fix some issues with pxa27x_keypad driver v3 Antonio Ospite
2008-05-29 0:37 ` eric miao [this message]
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=f17812d70805281737y1f4440cdo8d94ee609a905b45@mail.gmail.com \
--to=eric.y.miao@gmail.com \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=ospite@studenti.unina.it \
/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;
as well as URLs for NNTP newsgroup(s).