linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Jiri Kosina <jkosina@suse.cz>, Ping Cheng <pinglinux@gmail.com>,
	Jason Gerecke <killertofu@gmail.com>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	linuxwacom-devel@lists.sourceforge.net
Subject: [PATCH 07/15] Input - wacom: register the input devices on top of the HID one
Date: Mon, 30 Jun 2014 17:26:18 -0400	[thread overview]
Message-ID: <1404163586-29582-8-git-send-email-benjamin.tissoires@redhat.com> (raw)
In-Reply-To: <1404163586-29582-1-git-send-email-benjamin.tissoires@redhat.com>

Matches the current behavior of the HID subsystem and removes one more
dependency over USB.

The current user space clients which relies on this to fetch the
LEDs path need an update. However, we already break them in the
kernel v3.11 for the Bluetooth Wacom devices. They are going to be fixed
soon.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
---
 drivers/input/tablet/wacom.h     |  1 -
 drivers/input/tablet/wacom_sys.c | 15 ++++++++-------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/input/tablet/wacom.h b/drivers/input/tablet/wacom.h
index a931221..a678f82 100644
--- a/drivers/input/tablet/wacom.h
+++ b/drivers/input/tablet/wacom.h
@@ -112,7 +112,6 @@ struct wacom {
 	struct hid_device *hdev;
 	struct mutex lock;
 	struct work_struct work;
-	char phys[32];
 	struct wacom_led {
 		u8 select[2]; /* status led selector (0..3) */
 		u8 llv;       /* status led brightness no button (1..127) */
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
index 6f4bf6d..0d0397d 100644
--- a/drivers/input/tablet/wacom_sys.c
+++ b/drivers/input/tablet/wacom_sys.c
@@ -992,8 +992,7 @@ static void wacom_destroy_battery(struct wacom *wacom)
 static struct input_dev *wacom_allocate_input(struct wacom *wacom)
 {
 	struct input_dev *input_dev;
-	struct usb_interface *intf = wacom->intf;
-	struct usb_device *dev = interface_to_usbdev(intf);
+	struct hid_device *hdev = wacom->hdev;
 	struct wacom_wac *wacom_wac = &(wacom->wacom_wac);
 
 	input_dev = input_allocate_device();
@@ -1001,11 +1000,15 @@ static struct input_dev *wacom_allocate_input(struct wacom *wacom)
 		return NULL;
 
 	input_dev->name = wacom_wac->name;
-	input_dev->phys = wacom->phys;
-	input_dev->dev.parent = &intf->dev;
+	input_dev->phys = hdev->phys;
+	input_dev->dev.parent = &hdev->dev;
 	input_dev->open = wacom_open;
 	input_dev->close = wacom_close;
-	usb_to_input_id(dev, &input_dev->id);
+	input_dev->uniq = hdev->uniq;
+	input_dev->id.bustype = hdev->bus;
+	input_dev->id.vendor  = hdev->vendor;
+	input_dev->id.product = hdev->product;
+	input_dev->id.version = hdev->version;
 	input_set_drvdata(input_dev, wacom);
 
 	return input_dev;
@@ -1269,8 +1272,6 @@ static int wacom_probe(struct hid_device *hdev,
 	wacom->intf = intf;
 	mutex_init(&wacom->lock);
 	INIT_WORK(&wacom->work, wacom_wireless_work);
-	usb_make_path(dev, wacom->phys, sizeof(wacom->phys));
-	strlcat(wacom->phys, "/input0", sizeof(wacom->phys));
 
 	/* set the default size in case we do not get them from hid */
 	wacom_set_default_phy(features);
-- 
2.0.0


  parent reply	other threads:[~2014-06-30 21:26 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-30 21:26 [PATCH 00/15] Input - Wacom: switch from an USB to a HID driver Benjamin Tissoires
2014-06-30 21:26 ` [PATCH 01/15] Input - wacom: include and use linux/hid.h Benjamin Tissoires
2014-06-30 21:26 ` [PATCH 02/15] Input - wacom: switch from an USB driver to a HID driver Benjamin Tissoires
2014-06-30 21:26 ` [PATCH 03/15] Input - wacom: use hid communication instead of plain usb Benjamin Tissoires
2014-06-30 21:26 ` [PATCH 04/15] Input - wacom: use HID core to actually fetch the report descriptor Benjamin Tissoires
2014-06-30 21:26 ` [PATCH 05/15] Input - wacom: compute the HID report size to get the actual packet size Benjamin Tissoires
2014-07-11  1:09   ` Jason Gerecke
2014-07-11 13:20     ` Benjamin Tissoires
2014-06-30 21:26 ` [PATCH 06/15] Input - wacom: install LED/OLED sysfs files in the HID device instead of USB Benjamin Tissoires
2014-07-03  9:21   ` [Linuxwacom-devel] " Przemo Firszt
2014-07-03 13:45     ` Benjamin Tissoires
2014-06-30 21:26 ` Benjamin Tissoires [this message]
2014-06-30 21:26 ` [PATCH 08/15] Input - wacom: remove usb dependency for siblings devices Benjamin Tissoires
2014-07-11  0:10   ` Jason Gerecke
2014-07-11 13:15     ` Benjamin Tissoires
2014-06-30 21:26 ` [PATCH 09/15] Input - wacom: register power device at the HID level Benjamin Tissoires
2014-06-30 21:26 ` [PATCH 10/15] Input - wacom: use hid_info instead of plain dev_info Benjamin Tissoires
2014-06-30 21:26 ` [PATCH 11/15] HID: uhid: add and set HID_TYPE_UHID for uhid devices Benjamin Tissoires
2014-06-30 21:26 ` [PATCH 12/15] Input - wacom: use in-kernel HID parser Benjamin Tissoires
2014-06-30 21:26 ` [PATCH 13/15] Input - wacom: use hidinput_calc_abs_res instead of duplicating its code Benjamin Tissoires
2014-06-30 21:26 ` [PATCH 14/15] Input - wacom: remove field pktlen declaration in the list of devices Benjamin Tissoires
2014-06-30 21:26 ` [PATCH 15/15] Input - wacom: keep wacom_ids ordered Benjamin Tissoires
2014-07-02 21:40   ` Benjamin Tissoires
2014-07-02 23:33 ` [PATCH 00/15] Input - Wacom: switch from an USB to a HID driver Jason Gerecke
2014-07-11  1:17   ` Jason Gerecke
2014-07-11 13:30     ` Benjamin Tissoires
2014-07-11 13:47       ` Jiri Kosina
2014-07-10 21:30 ` [Linuxwacom-devel] " Przemo Firszt
2014-07-11 13:28   ` Benjamin Tissoires

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1404163586-29582-8-git-send-email-benjamin.tissoires@redhat.com \
    --to=benjamin.tissoires@redhat.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=jkosina@suse.cz \
    --cc=killertofu@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxwacom-devel@lists.sourceforge.net \
    --cc=pinglinux@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).