Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d8814272 authored by Benjamin Tissoires's avatar Benjamin Tissoires Committed by Jiri Kosina
Browse files

HID: use hid_hw_request() instead of direct call to usbhid



This allows the hid drivers to be independent from the transport layer.

The patch was constructed by replacing all occurences of
usbhid_submit_report() by its hid_hw_request() counterpart.
Then, drivers not requiring USB_HID anymore have their USB_HID
dependency cleaned in the Kconfig file.

Finally, few drivers still depends on USB_HID. Many of them
are requiring the io wait callback. They are found in the next patch.

Signed-off-by: default avatarBenjamin Tissoires <benjamin.tissoires@gmail.com>
Reviewed-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>

For the sensor-hub part:
Tested-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent f3757cea
Loading
Loading
Loading
Loading
+15 −15
Original line number Diff line number Diff line
@@ -99,7 +99,7 @@ config HID_A4TECH

config HID_ACRUX
	tristate "ACRUX game controller support"
	depends on USB_HID
	depends on HID
	---help---
	Say Y here if you want to enable support for ACRUX game controllers.

@@ -151,7 +151,7 @@ config HID_CHICONY

config HID_PRODIKEYS
	tristate "Prodikeys PC-MIDI Keyboard support"
	depends on USB_HID && SND
	depends on HID && SND
	select SND_RAWMIDI
	---help---
	Support for Prodikeys PC-MIDI Keyboard device support.
@@ -173,7 +173,7 @@ config HID_CYPRESS

config HID_DRAGONRISE
	tristate "DragonRise Inc. game controller"
	depends on USB_HID
	depends on HID
	---help---
	Say Y here if you have DragonRise Inc. game controllers.
	These might be branded as:
@@ -192,7 +192,7 @@ config DRAGONRISE_FF

config HID_EMS_FF
	tristate "EMS Production Inc. force feedback support"
	depends on USB_HID
	depends on HID
	select INPUT_FF_MEMLESS
	---help---
	Say Y here if you want to enable force feedback support for devices by
@@ -215,7 +215,7 @@ config HID_EZKEY

config HID_HOLTEK
	tristate "Holtek HID devices"
	depends on USB_HID
	depends on HID
	---help---
	Support for Holtek based devices:
	  - Holtek On Line Grip based game controller
@@ -239,7 +239,7 @@ config HID_KEYTOUCH

config HID_KYE
	tristate "KYE/Genius devices"
	depends on USB_HID
	depends on HID
	---help---
	Support for KYE/Genius devices not fully compliant with HID standard:
	- Ergo Mouse
@@ -397,7 +397,7 @@ config HID_MONTEREY

config HID_MULTITOUCH
	tristate "HID Multitouch panels"
	depends on USB_HID
	depends on HID
	---help---
	  Generic support for HID multitouch panels.

@@ -458,7 +458,7 @@ config HID_ORTEK

config HID_PANTHERLORD
	tristate "Pantherlord/GreenAsia game controller"
	depends on USB_HID
	depends on HID
	---help---
	  Say Y here if you have a PantherLord/GreenAsia based game controller
	  or adapter.
@@ -592,13 +592,13 @@ config HID_SONY

config HID_SPEEDLINK
	tristate "Speedlink VAD Cezanne mouse support"
	depends on USB_HID
	depends on HID
	---help---
	Support for Speedlink Vicious and Divine Cezanne mouse.

config HID_STEELSERIES
	tristate "Steelseries SRW-S1 steering wheel support"
	depends on USB_HID
	depends on HID
	---help---
	Support for Steelseries SRW-S1 steering wheel

@@ -610,7 +610,7 @@ config HID_SUNPLUS

config HID_GREENASIA
	tristate "GreenAsia (Product ID 0x12) game controller support"
	depends on USB_HID
	depends on HID
	---help---
	  Say Y here if you have a GreenAsia (Product ID 0x12) based game
	  controller or adapter.
@@ -632,7 +632,7 @@ config HID_HYPERV_MOUSE

config HID_SMARTJOYPLUS
	tristate "SmartJoy PLUS PS2/USB adapter support"
	depends on USB_HID
	depends on HID
	---help---
	Support for SmartJoy PLUS PS2/USB adapter, Super Dual Box,
	Super Joy Box 3 Pro, Super Dual Box Pro, and Super Joy Box 5 Pro.
@@ -673,7 +673,7 @@ config HID_THINGM

config HID_THRUSTMASTER
	tristate "ThrustMaster devices support"
	depends on USB_HID
	depends on HID
	---help---
	  Say Y here if you have a THRUSTMASTER FireStore Dual Power 2 or
	  a THRUSTMASTER Ferrari GT Rumble Wheel.
@@ -715,7 +715,7 @@ config HID_WIIMOTE_EXT

config HID_ZEROPLUS
	tristate "Zeroplus based game controller support"
	depends on USB_HID
	depends on HID
	---help---
	  Say Y here if you have a Zeroplus based game controller.

@@ -735,7 +735,7 @@ config HID_ZYDACRON

config HID_SENSOR_HUB
	tristate "HID Sensors framework support"
	depends on USB_HID && GENERIC_HARDIRQS
	depends on HID && GENERIC_HARDIRQS
	select MFD_CORE
	default n
	-- help---
+2 −4
Original line number Diff line number Diff line
@@ -29,14 +29,12 @@

#include <linux/input.h>
#include <linux/slab.h>
#include <linux/usb.h>
#include <linux/hid.h>
#include <linux/module.h>

#include "hid-ids.h"

#ifdef CONFIG_HID_ACRUX_FF
#include "usbhid/usbhid.h"

struct axff_device {
	struct hid_report *report;
@@ -68,7 +66,7 @@ static int axff_play(struct input_dev *dev, void *data, struct ff_effect *effect
	}

	dbg_hid("running with 0x%02x 0x%02x", left, right);
	usbhid_submit_report(hid, axff->report, USB_DIR_OUT);
	hid_hw_request(hid, axff->report, HID_REQ_SET_REPORT);

	return 0;
}
@@ -114,7 +112,7 @@ static int axff_init(struct hid_device *hid)
		goto err_free_mem;

	axff->report = report;
	usbhid_submit_report(hid, axff->report, USB_DIR_OUT);
	hid_hw_request(hid, axff->report, HID_REQ_SET_REPORT);

	hid_info(hid, "Force Feedback for ACRUX game controllers by Sergei Kolzun <x0r@dv-life.ru>\n");

+3 −5
Original line number Diff line number Diff line
@@ -29,14 +29,12 @@

#include <linux/input.h>
#include <linux/slab.h>
#include <linux/usb.h>
#include <linux/hid.h>
#include <linux/module.h>

#include "hid-ids.h"

#ifdef CONFIG_DRAGONRISE_FF
#include "usbhid/usbhid.h"

struct drff_device {
	struct hid_report *report;
@@ -68,7 +66,7 @@ static int drff_play(struct input_dev *dev, void *data,
		drff->report->field[0]->value[1] = 0x00;
		drff->report->field[0]->value[2] = weak;
		drff->report->field[0]->value[4] = strong;
		usbhid_submit_report(hid, drff->report, USB_DIR_OUT);
		hid_hw_request(hid, drff->report, HID_REQ_SET_REPORT);

		drff->report->field[0]->value[0] = 0xfa;
		drff->report->field[0]->value[1] = 0xfe;
@@ -80,7 +78,7 @@ static int drff_play(struct input_dev *dev, void *data,
	drff->report->field[0]->value[2] = 0x00;
	drff->report->field[0]->value[4] = 0x00;
	dbg_hid("running with 0x%02x 0x%02x", strong, weak);
	usbhid_submit_report(hid, drff->report, USB_DIR_OUT);
	hid_hw_request(hid, drff->report, HID_REQ_SET_REPORT);

	return 0;
}
@@ -132,7 +130,7 @@ static int drff_init(struct hid_device *hid)
	drff->report->field[0]->value[4] = 0x00;
	drff->report->field[0]->value[5] = 0x00;
	drff->report->field[0]->value[6] = 0x00;
	usbhid_submit_report(hid, drff->report, USB_DIR_OUT);
	hid_hw_request(hid, drff->report, HID_REQ_SET_REPORT);

	hid_info(hid, "Force Feedback for DragonRise Inc. "
		 "game controllers by Richard Walmsley <richwalm@gmail.com>\n");
+2 −4
Original line number Diff line number Diff line
@@ -23,11 +23,9 @@

#include <linux/hid.h>
#include <linux/input.h>
#include <linux/usb.h>
#include <linux/module.h>

#include "hid-ids.h"
#include "usbhid/usbhid.h"

struct emsff_device {
	struct hid_report *report;
@@ -52,7 +50,7 @@ static int emsff_play(struct input_dev *dev, void *data,
	emsff->report->field[0]->value[2] = strong;

	dbg_hid("running with 0x%02x 0x%02x\n", strong, weak);
	usbhid_submit_report(hid, emsff->report, USB_DIR_OUT);
	hid_hw_request(hid, emsff->report, HID_REQ_SET_REPORT);

	return 0;
}
@@ -104,7 +102,7 @@ static int emsff_init(struct hid_device *hid)
	emsff->report->field[0]->value[4] = 0x00;
	emsff->report->field[0]->value[5] = 0x00;
	emsff->report->field[0]->value[6] = 0x00;
	usbhid_submit_report(hid, emsff->report, USB_DIR_OUT);
	hid_hw_request(hid, emsff->report, HID_REQ_SET_REPORT);

	hid_info(hid, "force feedback for EMS based devices by Ignaz Forster <ignaz.forster@gmx.de>\n");

+4 −6
Original line number Diff line number Diff line
@@ -29,13 +29,11 @@

#include <linux/input.h>
#include <linux/slab.h>
#include <linux/usb.h>
#include <linux/hid.h>
#include <linux/module.h>
#include "hid-ids.h"

#ifdef CONFIG_GREENASIA_FF
#include "usbhid/usbhid.h"

struct gaff_device {
	struct hid_report *report;
@@ -63,14 +61,14 @@ static int hid_gaff_play(struct input_dev *dev, void *data,
	gaff->report->field[0]->value[4] = left;
	gaff->report->field[0]->value[5] = 0;
	dbg_hid("running with 0x%02x 0x%02x", left, right);
	usbhid_submit_report(hid, gaff->report, USB_DIR_OUT);
	hid_hw_request(hid, gaff->report, HID_REQ_SET_REPORT);

	gaff->report->field[0]->value[0] = 0xfa;
	gaff->report->field[0]->value[1] = 0xfe;
	gaff->report->field[0]->value[2] = 0x0;
	gaff->report->field[0]->value[4] = 0x0;

	usbhid_submit_report(hid, gaff->report, USB_DIR_OUT);
	hid_hw_request(hid, gaff->report, HID_REQ_SET_REPORT);

	return 0;
}
@@ -122,12 +120,12 @@ static int gaff_init(struct hid_device *hid)
	gaff->report->field[0]->value[1] = 0x00;
	gaff->report->field[0]->value[2] = 0x00;
	gaff->report->field[0]->value[3] = 0x00;
	usbhid_submit_report(hid, gaff->report, USB_DIR_OUT);
	hid_hw_request(hid, gaff->report, HID_REQ_SET_REPORT);

	gaff->report->field[0]->value[0] = 0xfa;
	gaff->report->field[0]->value[1] = 0xfe;

	usbhid_submit_report(hid, gaff->report, USB_DIR_OUT);
	hid_hw_request(hid, gaff->report, HID_REQ_SET_REPORT);

	hid_info(hid, "Force Feedback for GreenAsia 0x12 devices by Lukasz Lubojanski <lukasz@lubojanski.info>\n");

Loading