Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

HID: remove hid-ff

hid-ff.c now calls only pidff (generic driver), the special ones are now
in separate drivers. Invoke pidff on all non-special directly.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>

authored by

Jiri Slaby and committed by
Jiri Kosina
76483cf4 987fbc1f

+2 -94
-13
drivers/hid/usbhid/Kconfig
··· 24 24 comment "Input core support is needed for USB HID input layer or HIDBP support" 25 25 depends on USB_HID && INPUT=n 26 26 27 - config HID_FF 28 - bool "Force feedback support (EXPERIMENTAL)" 29 - depends on USB_HID && EXPERIMENTAL 30 - help 31 - Say Y here is you want force feedback support for a few HID devices. 32 - See below for a list of supported devices. 33 - 34 - See <file:Documentation/input/ff.txt> for a description of the force 35 - feedback API. 36 - 37 - If unsure, say N. 38 - 39 27 config HID_PID 40 28 bool "PID device support" 41 - depends on HID_FF 42 29 help 43 30 Say Y here if you have a PID-compliant device and wish to enable force 44 31 feedback for it. Microsoft Sidewinder Force Feedback 2 is one of such
-3
drivers/hid/usbhid/Makefile
··· 13 13 ifeq ($(CONFIG_HID_PID),y) 14 14 usbhid-objs += hid-pidff.o 15 15 endif 16 - ifeq ($(CONFIG_HID_FF),y) 17 - usbhid-objs += hid-ff.o 18 - endif 19 16 20 17 obj-$(CONFIG_USB_HID) += usbhid.o 21 18 obj-$(CONFIG_USB_KBD) += usbkbd.o
+1 -1
drivers/hid/usbhid/hid-core.c
··· 935 935 usb_set_intfdata(intf, hid); 936 936 hid->ll_driver = &usb_hid_driver; 937 937 hid->hid_output_raw_report = usbhid_output_raw_report; 938 - hid->ff_init = hid_ff_init; 938 + hid->ff_init = hid_pidff_init; 939 939 #ifdef CONFIG_USB_HIDDEV 940 940 hid->hiddev_connect = hiddev_connect; 941 941 hid->hiddev_hid_event = hiddev_hid_event;
-69
drivers/hid/usbhid/hid-ff.c
··· 1 - /* 2 - * Force feedback support for hid devices. 3 - * Not all hid devices use the same protocol. For example, some use PID, 4 - * other use their own proprietary procotol. 5 - * 6 - * Copyright (c) 2002-2004 Johann Deneux 7 - */ 8 - 9 - /* 10 - * This program is free software; you can redistribute it and/or modify 11 - * it under the terms of the GNU General Public License as published by 12 - * the Free Software Foundation; either version 2 of the License, or 13 - * (at your option) any later version. 14 - * 15 - * This program is distributed in the hope that it will be useful, 16 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 - * GNU General Public License for more details. 19 - * 20 - * You should have received a copy of the GNU General Public License 21 - * along with this program; if not, write to the Free Software 22 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 - * 24 - * Should you need to contact me, the author, you can do so by 25 - * e-mail - mail your message to <johann.deneux@it.uu.se> 26 - */ 27 - 28 - #include <linux/input.h> 29 - 30 - #undef DEBUG 31 - #include <linux/usb.h> 32 - 33 - #include <linux/hid.h> 34 - #include "usbhid.h" 35 - 36 - /* 37 - * This table contains pointers to initializers. To add support for new 38 - * devices, you need to add the USB vendor and product ids here. 39 - */ 40 - struct hid_ff_initializer { 41 - u16 idVendor; 42 - u16 idProduct; 43 - int (*init)(struct hid_device*); 44 - }; 45 - 46 - /* 47 - * We try pidff when no other driver is found because PID is the 48 - * standards compliant way of implementing force feedback in HID. 49 - * pidff_init() will quickly abort if the device doesn't appear to 50 - * be a PID device 51 - */ 52 - static struct hid_ff_initializer inits[] = { 53 - { 0, 0, hid_pidff_init} /* Matches anything */ 54 - }; 55 - 56 - int hid_ff_init(struct hid_device* hid) 57 - { 58 - struct hid_ff_initializer *init; 59 - int vendor = le16_to_cpu(hid_to_usb_dev(hid)->descriptor.idVendor); 60 - int product = le16_to_cpu(hid_to_usb_dev(hid)->descriptor.idProduct); 61 - 62 - for (init = inits; init->idVendor; init++) 63 - if (init->idVendor == vendor && init->idProduct == product) 64 - break; 65 - 66 - return init->init(hid); 67 - } 68 - EXPORT_SYMBOL_GPL(hid_ff_init); 69 -
+1 -8
include/linux/hid.h
··· 757 757 void usbhid_quirks_exit(void); 758 758 void usbhid_set_leds(struct hid_device *hid); 759 759 760 - #ifdef CONFIG_HID_FF 761 - int hid_ff_init(struct hid_device *hid); 762 - 763 760 #ifdef CONFIG_HID_PID 764 761 int hid_pidff_init(struct hid_device *hid); 765 762 #else 766 - static inline int hid_pidff_init(struct hid_device *hid) { return -ENODEV; } 767 - #endif 768 - 769 - #else 770 - #define hid_ff_init NULL 763 + #define hid_pidff_init NULL 771 764 #endif 772 765 773 766 #ifdef CONFIG_HID_DEBUG