* [PATCH] Input: fix cobalt_btns loadable keymaps support
@ 2008-02-11 12:54 Yoichi Yuasa
2008-02-11 16:00 ` Dmitry Torokhov
0 siblings, 1 reply; 4+ messages in thread
From: Yoichi Yuasa @ 2008-02-11 12:54 UTC (permalink / raw)
To: dmitry.torokhov; +Cc: yoichi_yuasa, linux-input
Fix cobalt_btns loadable keymaps support.
Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
diff -pruN -X /home/yuasa/Memo/dontdiff linux-orig/drivers/input/misc/cobalt_btns.c linux/drivers/input/misc/cobalt_btns.c
--- linux-orig/drivers/input/misc/cobalt_btns.c 2008-02-10 20:16:54.621304697 +0900
+++ linux/drivers/input/misc/cobalt_btns.c 2008-02-10 23:02:30.875539556 +0900
@@ -1,7 +1,7 @@
/*
* Cobalt button interface driver.
*
- * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
+ * Copyright (C) 2007-2008 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -15,7 +15,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <linux/init.h>
#include <linux/input-polldev.h>
@@ -55,7 +55,7 @@ static void handle_buttons(struct input_
status = ~readl(bdev->reg) >> 24;
for (i = 0; i < ARRAY_SIZE(bdev->keymap); i++) {
- if (status & (1UL << i)) {
+ if (status & (1U << i)) {
if (++bdev->count[i] == BUTTONS_COUNT_THRESHOLD) {
input_event(input, EV_MSC, MSC_SCAN, i);
input_report_key(input, bdev->keymap[i], 1);
@@ -97,16 +97,16 @@ static int __devinit cobalt_buttons_prob
input->name = "Cobalt buttons";
input->phys = "cobalt/input0";
input->id.bustype = BUS_HOST;
- input->cdev.dev = &pdev->dev;
+ input->dev.parent = &pdev->dev;
- input->keycode = pdev->keymap;
- input->keycodemax = ARRAY_SIZE(pdev->keymap);
+ input->keycode = bdev->keymap;
+ input->keycodemax = ARRAY_SIZE(bdev->keymap);
input->keycodesize = sizeof(unsigned short);
input_set_capability(input, EV_MSC, MSC_SCAN);
__set_bit(EV_KEY, input->evbit);
- for (i = 0; i < ARRAY_SIZE(buttons_map); i++)
- __set_bit(input->keycode[i], input->keybit);
+ for (i = 0; i < ARRAY_SIZE(cobalt_map); i++)
+ __set_bit(bdev->keymap[i], input->keybit);
__clear_bit(KEY_RESERVED, input->keybit);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Input: fix cobalt_btns loadable keymaps support
2008-02-11 12:54 [PATCH] Input: fix cobalt_btns loadable keymaps support Yoichi Yuasa
@ 2008-02-11 16:00 ` Dmitry Torokhov
2008-02-11 17:04 ` Dmitry Torokhov
0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Torokhov @ 2008-02-11 16:00 UTC (permalink / raw)
To: Yoichi Yuasa; +Cc: linux-input
Hi Yoichi,
On Mon, Feb 11, 2008 at 09:54:04PM +0900, Yoichi Yuasa wrote:
> Fix cobalt_btns loadable keymaps support.
>
Thank you for the patch.
> input_set_capability(input, EV_MSC, MSC_SCAN);
> __set_bit(EV_KEY, input->evbit);
> - for (i = 0; i < ARRAY_SIZE(buttons_map); i++)
> - __set_bit(input->keycode[i], input->keybit);
> + for (i = 0; i < ARRAY_SIZE(cobalt_map); i++)
> + __set_bit(bdev->keymap[i], input->keybit);
This part is not strictly necessary since input->keycode points to
bdev->keymap. I will apply the rest of the patch.
--
Dmitry
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Input: fix cobalt_btns loadable keymaps support
2008-02-11 16:00 ` Dmitry Torokhov
@ 2008-02-11 17:04 ` Dmitry Torokhov
2008-02-16 9:37 ` Yoichi Yuasa
0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Torokhov @ 2008-02-11 17:04 UTC (permalink / raw)
To: Yoichi Yuasa; +Cc: linux-input
On Mon, Feb 11, 2008 at 11:00:27AM -0500, Dmitry Torokhov wrote:
> Hi Yoichi,
>
> On Mon, Feb 11, 2008 at 09:54:04PM +0900, Yoichi Yuasa wrote:
> > Fix cobalt_btns loadable keymaps support.
> >
>
> Thank you for the patch.
>
> > input_set_capability(input, EV_MSC, MSC_SCAN);
> > __set_bit(EV_KEY, input->evbit);
> > - for (i = 0; i < ARRAY_SIZE(buttons_map); i++)
> > - __set_bit(input->keycode[i], input->keybit);
> > + for (i = 0; i < ARRAY_SIZE(cobalt_map); i++)
> > + __set_bit(bdev->keymap[i], input->keybit);
>
> This part is not strictly necessary since input->keycode points to
> bdev->keymap. I will apply the rest of the patch.
>
Oh, I see now... The controlling condition is the loop was incorrect.
--
Dmitry
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Input: fix cobalt_btns loadable keymaps support
2008-02-11 17:04 ` Dmitry Torokhov
@ 2008-02-16 9:37 ` Yoichi Yuasa
0 siblings, 0 replies; 4+ messages in thread
From: Yoichi Yuasa @ 2008-02-16 9:37 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: yoichi_yuasa, linux-input
Hi,
On Mon, 11 Feb 2008 12:04:42 -0500
Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote:
> On Mon, Feb 11, 2008 at 11:00:27AM -0500, Dmitry Torokhov wrote:
> > Hi Yoichi,
> >
> > On Mon, Feb 11, 2008 at 09:54:04PM +0900, Yoichi Yuasa wrote:
> > > Fix cobalt_btns loadable keymaps support.
> > >
> >
> > Thank you for the patch.
> >
> > > input_set_capability(input, EV_MSC, MSC_SCAN);
> > > __set_bit(EV_KEY, input->evbit);
> > > - for (i = 0; i < ARRAY_SIZE(buttons_map); i++)
> > > - __set_bit(input->keycode[i], input->keybit);
> > > + for (i = 0; i < ARRAY_SIZE(cobalt_map); i++)
> > > + __set_bit(bdev->keymap[i], input->keybit);
> >
> > This part is not strictly necessary since input->keycode points to
> > bdev->keymap. I will apply the rest of the patch.
> >
>
> Oh, I see now... The controlling condition is the loop was incorrect.
Exactly yes.
Thanks,
Yoichi
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-02-16 9:37 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-11 12:54 [PATCH] Input: fix cobalt_btns loadable keymaps support Yoichi Yuasa
2008-02-11 16:00 ` Dmitry Torokhov
2008-02-11 17:04 ` Dmitry Torokhov
2008-02-16 9:37 ` Yoichi Yuasa
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).