diff options
-rw-r--r-- | drivers/hid/hid-input.c | 4 | ||||
-rw-r--r-- | drivers/input/input.c | 55 | ||||
-rw-r--r-- | drivers/input/misc/ati_remote2.c | 4 | ||||
-rw-r--r-- | drivers/input/sparse-keymap.c | 4 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/dvb-usb-remote.c | 4 | ||||
-rw-r--r-- | drivers/media/rc/rc-main.c | 4 | ||||
-rw-r--r-- | include/linux/input.h | 12 |
7 files changed, 20 insertions, 67 deletions
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index 7f552bfad32c..ba2aeea2cbf9 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c | |||
@@ -888,8 +888,8 @@ int hidinput_connect(struct hid_device *hid, unsigned int force) | |||
888 | hid->ll_driver->hidinput_input_event; | 888 | hid->ll_driver->hidinput_input_event; |
889 | input_dev->open = hidinput_open; | 889 | input_dev->open = hidinput_open; |
890 | input_dev->close = hidinput_close; | 890 | input_dev->close = hidinput_close; |
891 | input_dev->setkeycode_new = hidinput_setkeycode; | 891 | input_dev->setkeycode = hidinput_setkeycode; |
892 | input_dev->getkeycode_new = hidinput_getkeycode; | 892 | input_dev->getkeycode = hidinput_getkeycode; |
893 | 893 | ||
894 | input_dev->name = hid->name; | 894 | input_dev->name = hid->name; |
895 | input_dev->phys = hid->phys; | 895 | input_dev->phys = hid->phys; |
diff --git a/drivers/input/input.c b/drivers/input/input.c index 7985114beac7..ee2959bd322c 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c | |||
@@ -806,22 +806,9 @@ int input_get_keycode(struct input_dev *dev, struct input_keymap_entry *ke) | |||
806 | int retval; | 806 | int retval; |
807 | 807 | ||
808 | spin_lock_irqsave(&dev->event_lock, flags); | 808 | spin_lock_irqsave(&dev->event_lock, flags); |
809 | 809 | retval = dev->getkeycode(dev, ke); | |
810 | if (dev->getkeycode) { | ||
811 | /* | ||
812 | * Support for legacy drivers, that don't implement the new | ||
813 | * ioctls | ||
814 | */ | ||
815 | u32 scancode = ke->index; | ||
816 | |||
817 | memcpy(ke->scancode, &scancode, sizeof(scancode)); | ||
818 | ke->len = sizeof(scancode); | ||
819 | retval = dev->getkeycode(dev, scancode, &ke->keycode); | ||
820 | } else { | ||
821 | retval = dev->getkeycode_new(dev, ke); | ||
822 | } | ||
823 | |||
824 | spin_unlock_irqrestore(&dev->event_lock, flags); | 810 | spin_unlock_irqrestore(&dev->event_lock, flags); |
811 | |||
825 | return retval; | 812 | return retval; |
826 | } | 813 | } |
827 | EXPORT_SYMBOL(input_get_keycode); | 814 | EXPORT_SYMBOL(input_get_keycode); |
@@ -846,35 +833,7 @@ int input_set_keycode(struct input_dev *dev, | |||
846 | 833 | ||
847 | spin_lock_irqsave(&dev->event_lock, flags); | 834 | spin_lock_irqsave(&dev->event_lock, flags); |
848 | 835 | ||
849 | if (dev->setkeycode) { | 836 | retval = dev->setkeycode(dev, ke, &old_keycode); |
850 | /* | ||
851 | * Support for legacy drivers, that don't implement the new | ||
852 | * ioctls | ||
853 | */ | ||
854 | unsigned int scancode; | ||
855 | |||
856 | retval = input_scancode_to_scalar(ke, &scancode); | ||
857 | if (retval) | ||
858 | goto out; | ||
859 | |||
860 | /* | ||
861 | * We need to know the old scancode, in order to generate a | ||
862 | * keyup effect, if the set operation happens successfully | ||
863 | */ | ||
864 | if (!dev->getkeycode) { | ||
865 | retval = -EINVAL; | ||
866 | goto out; | ||
867 | } | ||
868 | |||
869 | retval = dev->getkeycode(dev, scancode, &old_keycode); | ||
870 | if (retval) | ||
871 | goto out; | ||
872 | |||
873 | retval = dev->setkeycode(dev, scancode, ke->keycode); | ||
874 | } else { | ||
875 | retval = dev->setkeycode_new(dev, ke, &old_keycode); | ||
876 | } | ||
877 | |||
878 | if (retval) | 837 | if (retval) |
879 | goto out; | 838 | goto out; |
880 | 839 | ||
@@ -1861,11 +1820,11 @@ int input_register_device(struct input_dev *dev) | |||
1861 | dev->rep[REP_PERIOD] = 33; | 1820 | dev->rep[REP_PERIOD] = 33; |
1862 | } | 1821 | } |
1863 | 1822 | ||
1864 | if (!dev->getkeycode && !dev->getkeycode_new) | 1823 | if (!dev->getkeycode) |
1865 | dev->getkeycode_new = input_default_getkeycode; | 1824 | dev->getkeycode = input_default_getkeycode; |
1866 | 1825 | ||
1867 | if (!dev->setkeycode && !dev->setkeycode_new) | 1826 | if (!dev->setkeycode) |
1868 | dev->setkeycode_new = input_default_setkeycode; | 1827 | dev->setkeycode = input_default_setkeycode; |
1869 | 1828 | ||
1870 | dev_set_name(&dev->dev, "input%ld", | 1829 | dev_set_name(&dev->dev, "input%ld", |
1871 | (unsigned long) atomic_inc_return(&input_no) - 1); | 1830 | (unsigned long) atomic_inc_return(&input_no) - 1); |
diff --git a/drivers/input/misc/ati_remote2.c b/drivers/input/misc/ati_remote2.c index 0b0e9be63542..9ccdb82d869a 100644 --- a/drivers/input/misc/ati_remote2.c +++ b/drivers/input/misc/ati_remote2.c | |||
@@ -612,8 +612,8 @@ static int ati_remote2_input_init(struct ati_remote2 *ar2) | |||
612 | idev->open = ati_remote2_open; | 612 | idev->open = ati_remote2_open; |
613 | idev->close = ati_remote2_close; | 613 | idev->close = ati_remote2_close; |
614 | 614 | ||
615 | idev->getkeycode_new = ati_remote2_getkeycode; | 615 | idev->getkeycode = ati_remote2_getkeycode; |
616 | idev->setkeycode_new = ati_remote2_setkeycode; | 616 | idev->setkeycode = ati_remote2_setkeycode; |
617 | 617 | ||
618 | idev->name = ar2->name; | 618 | idev->name = ar2->name; |
619 | idev->phys = ar2->phys; | 619 | idev->phys = ar2->phys; |
diff --git a/drivers/input/sparse-keymap.c b/drivers/input/sparse-keymap.c index 7729e547ba65..337bf51bc984 100644 --- a/drivers/input/sparse-keymap.c +++ b/drivers/input/sparse-keymap.c | |||
@@ -210,8 +210,8 @@ int sparse_keymap_setup(struct input_dev *dev, | |||
210 | 210 | ||
211 | dev->keycode = map; | 211 | dev->keycode = map; |
212 | dev->keycodemax = map_size; | 212 | dev->keycodemax = map_size; |
213 | dev->getkeycode_new = sparse_keymap_getkeycode; | 213 | dev->getkeycode = sparse_keymap_getkeycode; |
214 | dev->setkeycode_new = sparse_keymap_setkeycode; | 214 | dev->setkeycode = sparse_keymap_setkeycode; |
215 | 215 | ||
216 | return 0; | 216 | return 0; |
217 | 217 | ||
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-remote.c b/drivers/media/dvb/dvb-usb/dvb-usb-remote.c index 347fbd4e2d56..b2b9415d874d 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb-remote.c +++ b/drivers/media/dvb/dvb-usb/dvb-usb-remote.c | |||
@@ -198,8 +198,8 @@ static int legacy_dvb_usb_remote_init(struct dvb_usb_device *d) | |||
198 | d->input_dev = input_dev; | 198 | d->input_dev = input_dev; |
199 | d->rc_dev = NULL; | 199 | d->rc_dev = NULL; |
200 | 200 | ||
201 | input_dev->getkeycode_new = legacy_dvb_usb_getkeycode; | 201 | input_dev->getkeycode = legacy_dvb_usb_getkeycode; |
202 | input_dev->setkeycode_new = legacy_dvb_usb_setkeycode; | 202 | input_dev->setkeycode = legacy_dvb_usb_setkeycode; |
203 | 203 | ||
204 | /* set the bits for the keys */ | 204 | /* set the bits for the keys */ |
205 | deb_rc("key map size: %d\n", d->props.rc.legacy.rc_map_size); | 205 | deb_rc("key map size: %d\n", d->props.rc.legacy.rc_map_size); |
diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c index 512a2f4ada0e..c3769283936f 100644 --- a/drivers/media/rc/rc-main.c +++ b/drivers/media/rc/rc-main.c | |||
@@ -966,8 +966,8 @@ struct rc_dev *rc_allocate_device(void) | |||
966 | return NULL; | 966 | return NULL; |
967 | } | 967 | } |
968 | 968 | ||
969 | dev->input_dev->getkeycode_new = ir_getkeycode; | 969 | dev->input_dev->getkeycode = ir_getkeycode; |
970 | dev->input_dev->setkeycode_new = ir_setkeycode; | 970 | dev->input_dev->setkeycode = ir_setkeycode; |
971 | input_set_drvdata(dev->input_dev, dev); | 971 | input_set_drvdata(dev->input_dev, dev); |
972 | 972 | ||
973 | spin_lock_init(&dev->rc_map.lock); | 973 | spin_lock_init(&dev->rc_map.lock); |
diff --git a/include/linux/input.h b/include/linux/input.h index e428382ca28a..056ae8a5bd9b 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
@@ -1154,8 +1154,6 @@ struct ff_effect { | |||
1154 | * sparse keymaps. If not supplied default mechanism will be used. | 1154 | * sparse keymaps. If not supplied default mechanism will be used. |
1155 | * The method is being called while holding event_lock and thus must | 1155 | * The method is being called while holding event_lock and thus must |
1156 | * not sleep | 1156 | * not sleep |
1157 | * @getkeycode_new: transition method | ||
1158 | * @setkeycode_new: transition method | ||
1159 | * @ff: force feedback structure associated with the device if device | 1157 | * @ff: force feedback structure associated with the device if device |
1160 | * supports force feedback effects | 1158 | * supports force feedback effects |
1161 | * @repeat_key: stores key code of the last key pressed; used to implement | 1159 | * @repeat_key: stores key code of the last key pressed; used to implement |
@@ -1234,14 +1232,10 @@ struct input_dev { | |||
1234 | void *keycode; | 1232 | void *keycode; |
1235 | 1233 | ||
1236 | int (*setkeycode)(struct input_dev *dev, | 1234 | int (*setkeycode)(struct input_dev *dev, |
1237 | unsigned int scancode, unsigned int keycode); | 1235 | const struct input_keymap_entry *ke, |
1236 | unsigned int *old_keycode); | ||
1238 | int (*getkeycode)(struct input_dev *dev, | 1237 | int (*getkeycode)(struct input_dev *dev, |
1239 | unsigned int scancode, unsigned int *keycode); | 1238 | struct input_keymap_entry *ke); |
1240 | int (*setkeycode_new)(struct input_dev *dev, | ||
1241 | const struct input_keymap_entry *ke, | ||
1242 | unsigned int *old_keycode); | ||
1243 | int (*getkeycode_new)(struct input_dev *dev, | ||
1244 | struct input_keymap_entry *ke); | ||
1245 | 1239 | ||
1246 | struct ff_device *ff; | 1240 | struct ff_device *ff; |
1247 | 1241 | ||