From patchwork Tue Jul 15 18:45:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Tissoires X-Patchwork-Id: 4557371 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D9940C0514 for ; Tue, 15 Jul 2014 18:49:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0790320158 for ; Tue, 15 Jul 2014 18:49:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 122D92011E for ; Tue, 15 Jul 2014 18:49:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932868AbaGOStM (ORCPT ); Tue, 15 Jul 2014 14:49:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47097 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932941AbaGOSqD (ORCPT ); Tue, 15 Jul 2014 14:46:03 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s6FIjxfV030156 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 15 Jul 2014 14:46:00 -0400 Received: from t540p.bos.redhat.com ([10.18.25.51]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s6FIjkZ2027242; Tue, 15 Jul 2014 14:45:59 -0400 From: Benjamin Tissoires To: Dmitry Torokhov , Jiri Kosina , Ping Cheng , Jason Gerecke Cc: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org Subject: [PATCH v2 15/23] Input - wacom: register the input devices on top of the HID one Date: Tue, 15 Jul 2014 14:45:38 -0400 Message-Id: <1405449946-11515-16-git-send-email-benjamin.tissoires@redhat.com> In-Reply-To: <1405449946-11515-1-git-send-email-benjamin.tissoires@redhat.com> References: <1405449946-11515-1-git-send-email-benjamin.tissoires@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Jason Gerecke Tested-by: Jason Gerecke --- no changes in v2 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 b921239..dd67b7d 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 6e21064..2650443 100644 --- a/drivers/input/tablet/wacom_sys.c +++ b/drivers/input/tablet/wacom_sys.c @@ -986,8 +986,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(); @@ -995,11 +994,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; @@ -1266,8 +1269,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);