From: viresh.kumar@st.com (Viresh Kumar)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] Input: matrix-keymap - uninline and prepare for device tree support
Date: Thu, 26 Apr 2012 13:53:12 +0530 [thread overview]
Message-ID: <4F9905F0.6030402@st.com> (raw)
In-Reply-To: <20120426081750.GA2684@core.coreip.homeip.net>
On 4/26/2012 1:47 PM, Dmitry Torokhov wrote:
> diff --git a/drivers/input/keyboard/spear-keyboard.c b/drivers/input/keyboard/spear-keyboard.c
> index 3b6b528..7c8f2bc 100644
> --- a/drivers/input/keyboard/spear-keyboard.c
> +++ b/drivers/input/keyboard/spear-keyboard.c
> @@ -49,7 +49,9 @@
> #define KEY_VALUE 0x00FFFFFF
> #define ROW_MASK 0xF0
> #define COLUMN_MASK 0x0F
> -#define ROW_SHIFT 4
> +#define NUM_ROWS 16
> +#define NUM_COLS 16
> +
> #define KEY_MATRIX_SHIFT 6
>
> struct spear_kbd {
> @@ -60,7 +62,7 @@ struct spear_kbd {
> unsigned int irq;
> unsigned int mode;
> unsigned short last_key;
> - unsigned short keycodes[256];
> + unsigned short keycodes[NUM_ROWS * NUM_COLS];
> };
>
> static irqreturn_t spear_kbd_interrupt(int irq, void *dev_id)
> @@ -212,18 +214,17 @@ static int __devinit spear_kbd_probe(struct platform_device *pdev)
> input_dev->open = spear_kbd_open;
> input_dev->close = spear_kbd_close;
>
> - __set_bit(EV_KEY, input_dev->evbit);
> + error = matrix_keypad_build_keymap(keymap, NULL, NUM_ROWS, NUM_COLS,
> + kbd->keycodes, input_dev);
> + if (error) {
> + dev_err(&pdev->dev, "Failed to build keymap\n");
> + goto errr_put_clk;
> + }
> +
> if (pdata->rep)
> __set_bit(EV_REP, input_dev->evbit);
> input_set_capability(input_dev, EV_MSC, MSC_SCAN);
>
> - input_dev->keycode = kbd->keycodes;
> - input_dev->keycodesize = sizeof(kbd->keycodes[0]);
> - input_dev->keycodemax = ARRAY_SIZE(kbd->keycodes);
> -
> - matrix_keypad_build_keymap(keymap, ROW_SHIFT,
> - input_dev->keycode, input_dev->keybit);
> -
> input_set_drvdata(input_dev, kbd);
>
> error = request_irq(irq, spear_kbd_interrupt, 0, "keyboard", kbd);
Have you rebased these patches over my patchset for SPEAr and Tegra?
--
viresh
prev parent reply other threads:[~2012-04-26 8:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-26 8:17 [PATCH 1/2] Input: matrix-keymap - uninline and prepare for device tree support Dmitry Torokhov
2012-04-26 8:23 ` Viresh Kumar [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=4F9905F0.6030402@st.com \
--to=viresh.kumar@st.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;
as well as URLs for NNTP newsgroup(s).