[PATCH 4/4] apanel: use generic keycode routines

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Don't need driver specific keymap routines, generic keycode routines
will work fine.

Signed-off-by: Stephen Hemminger <shemminger@xxxxxxxxxxxxxxxxxxxx>


--- a/drivers/input/misc/apanel.c	2007-11-21 17:32:36.000000000 -0800
+++ b/drivers/input/misc/apanel.c	2007-11-21 17:39:24.000000000 -0800
@@ -120,33 +120,6 @@ static void apanel_poll(struct input_pol
 			report_key(idev, ap->keymap[i]);
 }
 
-static int apanel_getkeycode(struct input_dev *idev, int scancode, int *keycode)
-{
-	struct apanel *ap = idev->private;
-
-	if (scancode < 0 || scancode >= MAX_PANEL_KEYS)
-		return -EINVAL;
-
-	*keycode = ap->keymap[scancode];
-	return 0;
-}
-
-static int apanel_setkeycode(struct input_dev *idev, int scancode, int keycode)
-{
-	struct apanel *ap = idev->private;
-
-	if (keycode < 0 || keycode > KEY_MAX)
-		return -EINVAL;
-
-	if (scancode < 0 || scancode >= MAX_PANEL_KEYS)
-		return -EINVAL;
-
-	clear_bit(ap->keymap[scancode], idev->keybit);
-	ap->keymap[scancode] = keycode;
-	set_bit(keycode, idev->keybit);
-	return 0;
-}
-
 /* Track state changes of LED */
 static void led_update(struct work_struct *work)
 {
@@ -274,11 +247,11 @@ static int apanel_probe(struct i2c_adapt
 	idev->phys = "apanel/input0";
 	idev->id.bustype = BUS_HOST;
 	idev->dev.parent = &ap->client.dev;
-	idev->getkeycode = apanel_getkeycode;
-	idev->setkeycode = apanel_setkeycode;
 
 	set_bit(EV_KEY, idev->evbit);
 
+	idev->keycode = ap->keymap;
+	idev->keycodesize = sizeof(ap->keymap[0]);
 	idev->keycodemax = (device_chip[APANEL_DEV_CDBTN] != CHIP_NONE) ? 12 : 4;
 
 	for (i = 0; i < idev->keycodemax; i++)

-- 

-
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux