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

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

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



This removes most of the dependencies between hid drivers and usbhid.

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

As of today, few drivers are still requiring an explicit USB layer
dependency:
* ntrig (a patch is on its way)
* multitouch (one patch following and another on its way)
* lenovo tpkbd
* roccat
* sony

The last three are two deeply using direct calls to the usb subsystem
to be able to be cleaned right now.

Signed-off-by: default avatarBenjamin Tissoires <benjamin.tissoires@gmail.com>
Reviewed-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent d8814272
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -479,7 +479,7 @@ config HID_PETALYNX

config HID_PICOLCD
	tristate "PicoLCD (graphic version)"
	depends on USB_HID
	depends on HID
	---help---
	  This provides support for Minibox PicoLCD devices, currently
	  only the graphical ones are supported.
+2 −2
Original line number Diff line number Diff line
@@ -119,7 +119,7 @@ static inline int ntrig_get_mode(struct hid_device *hdev)
		return -EINVAL;

	hid_hw_request(hdev, report, HID_REQ_GET_REPORT);
	usbhid_wait_io(hdev);
	hid_hw_wait(hdev);
	return (int)report->field[0]->value[0];
}

@@ -937,7 +937,7 @@ static int ntrig_probe(struct hid_device *hdev, const struct hid_device_id *id)
	if (report) {
		/* Let the device settle to ensure the wakeup message gets
		 * through */
		usbhid_wait_io(hdev);
		hid_hw_wait(hdev);
		hid_hw_request(hdev, report, HID_REQ_GET_REPORT);

		/*
+2 −3
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@

#include <linux/hid.h>
#include <linux/vmalloc.h>
#include "usbhid/usbhid.h"

#include <linux/fb.h>
#include <linux/module.h>
@@ -269,7 +268,7 @@ static void picolcd_fb_update(struct fb_info *info)
				mutex_unlock(&info->lock);
				if (!data)
					return;
				usbhid_wait_io(data->hdev);
				hid_hw_wait(data->hdev);
				mutex_lock(&info->lock);
				n = 0;
			}
@@ -287,7 +286,7 @@ static void picolcd_fb_update(struct fb_info *info)
		spin_unlock_irqrestore(&fbdata->lock, flags);
		mutex_unlock(&info->lock);
		if (data)
			usbhid_wait_io(data->hdev);
			hid_hw_wait(data->hdev);
		return;
	}
out:
+2 −3
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@
 */
#include <linux/device.h>
#include <linux/hid.h>
#include "usbhid/usbhid.h"
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/mfd/core.h>
@@ -204,7 +203,7 @@ int sensor_hub_set_feature(struct hid_sensor_hub_device *hsdev, u32 report_id,
	}
	hid_set_field(report->field[field_index], 0, value);
	hid_hw_request(hsdev->hdev, report, HID_REQ_SET_REPORT);
	usbhid_wait_io(hsdev->hdev);
	hid_hw_wait(hsdev->hdev);

done_proc:
	mutex_unlock(&data->mutex);
@@ -227,7 +226,7 @@ int sensor_hub_get_feature(struct hid_sensor_hub_device *hsdev, u32 report_id,
		goto done_proc;
	}
	hid_hw_request(hsdev->hdev, report, HID_REQ_GET_REPORT);
	usbhid_wait_io(hsdev->hdev);
	hid_hw_wait(hsdev->hdev);
	*value = report->field[field_index]->value[0];

done_proc:
+1 −2
Original line number Diff line number Diff line
@@ -705,7 +705,7 @@ static int usb_hidinput_input_event(struct input_dev *dev, unsigned int type, un
	return 0;
}

int usbhid_wait_io(struct hid_device *hid)
static int usbhid_wait_io(struct hid_device *hid)
{
	struct usbhid_device *usbhid = hid->driver_data;

@@ -719,7 +719,6 @@ int usbhid_wait_io(struct hid_device *hid)

	return 0;
}
EXPORT_SYMBOL_GPL(usbhid_wait_io);

static int hid_set_idle(struct usb_device *dev, int ifnum, int report, int idle)
{
Loading