From patchwork Fri Mar 11 08:27:34 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 627811 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p2B8Vbel017996 for ; Fri, 11 Mar 2011 08:33:25 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752289Ab1CKIdZ (ORCPT ); Fri, 11 Mar 2011 03:33:25 -0500 Received: from mail-pw0-f46.google.com ([209.85.160.46]:53116 "EHLO mail-pw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752096Ab1CKIdY (ORCPT ); Fri, 11 Mar 2011 03:33:24 -0500 Received: by pwi15 with SMTP id 15so475503pwi.19 for ; Fri, 11 Mar 2011 00:33:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:date:from:to:cc:subject:message-id:mime-version :content-type:content-disposition:user-agent; bh=frNigiZypTwomjopa4VGNrT5hyiRggbcKKCnTVfTWnY=; b=R8+JxNzvytFYXd4/kXAfp7KVYMz9AuaGWacEjyifJ8n3KXz3ys1sbR+WfjreUK1Jwb tkavmydS1ttQV1soHDwkmj05B7L7OFUEG+CRgRR+v9EvyB/RjWCNqk9DEfBpxMKJ7RFK DgpzjP/yw0yDTpy/oa4lVNnvQKP78ZBSBMLMI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=FFCdCGEQfahJAJMOUAmrejjgcHLDruxSvcUS6CVsW3dQ5kHqPxUcS0QT7+cn+ZJk22 SfUyBtof68Rl8wF1FZCUvcW99+U2tq8LLz56VTR3t5XNSKbE30l6HOP5eTeb7qTzv9/g grRzX+jmmHlDr034jccfLS4EGeMrdUkJw1c88= Received: by 10.142.238.2 with SMTP id l2mr7421444wfh.95.1299832058039; Fri, 11 Mar 2011 00:27:38 -0800 (PST) Received: from mailhub.coreip.homeip.net (c-98-234-113-65.hsd1.ca.comcast.net [98.234.113.65]) by mx.google.com with ESMTPS id w27sm5044522wfd.4.2011.03.11.00.27.36 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 11 Mar 2011 00:27:37 -0800 (PST) Date: Fri, 11 Mar 2011 00:27:34 -0800 From: Dmitry Torokhov To: Jiri Kosina Cc: Linux Input , Sergei Kolzun Subject: [PATCH] HID: ACRUX - activate the device immediately after binding Message-ID: <20110311082734.GF10807@core.coreip.homeip.net> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 11 Mar 2011 08:33:25 +0000 (UTC) diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig index 2560f01..b7d4133 100644 --- a/drivers/hid/Kconfig +++ b/drivers/hid/Kconfig @@ -68,9 +68,15 @@ config HID_A4TECH ---help--- Support for A4 tech X5 and WOP-35 / Trust 450L mice. -config HID_ACRUX_FF - tristate "ACRUX force feedback" +config HID_ACRUX + tristate "ACRUX game controller support" depends on USB_HID + ---help--- + Say Y here if you want to enable support for ACRUX game controllers. + +config HID_ACRUX_FF + tristate "ACRUX force feedback support" + depends on HID_ACRUX select INPUT_FF_MEMLESS ---help--- Say Y here if you want to enable force feedback support for ACRUX diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile index 6efc2a0..13e6248 100644 --- a/drivers/hid/Makefile +++ b/drivers/hid/Makefile @@ -27,7 +27,7 @@ endif obj-$(CONFIG_HID_3M_PCT) += hid-3m-pct.o obj-$(CONFIG_HID_A4TECH) += hid-a4tech.o -obj-$(CONFIG_HID_ACRUX_FF) += hid-axff.o +obj-$(CONFIG_HID_ACRUX) += hid-axff.o obj-$(CONFIG_HID_APPLE) += hid-apple.o obj-$(CONFIG_HID_BELKIN) += hid-belkin.o obj-$(CONFIG_HID_CANDO) += hid-cando.o diff --git a/drivers/hid/hid-axff.c b/drivers/hid/hid-axff.c index e5b961d..b455428 100644 --- a/drivers/hid/hid-axff.c +++ b/drivers/hid/hid-axff.c @@ -33,6 +33,8 @@ #include #include "hid-ids.h" + +#ifdef CONFIG_HID_ACRUX_FF #include "usbhid/usbhid.h" struct axff_device { @@ -109,6 +111,12 @@ err_free_mem: kfree(axff); return error; } +#else +static inline int axff_init(struct hid_device *hid) +{ + return 0; +} +#endif static int ax_probe(struct hid_device *hdev, const struct hid_device_id *id) { @@ -139,9 +147,25 @@ static int ax_probe(struct hid_device *hdev, const struct hid_device_id *id) error); } + /* + * We need to start polling device right away, otherwise + * it will go into a coma. + */ + error = hid_hw_open(hdev); + if (error) { + dev_err(&hdev->dev, "hw open failed\n"); + return error; + } + return 0; } +static void ax_remove(struct hid_device *hdev) +{ + hid_hw_close(hdev); + hid_hw_stop(hdev); +} + static const struct hid_device_id ax_devices[] = { { HID_USB_DEVICE(USB_VENDOR_ID_ACRUX, 0x0802), }, { } @@ -149,9 +173,10 @@ static const struct hid_device_id ax_devices[] = { MODULE_DEVICE_TABLE(hid, ax_devices); static struct hid_driver ax_driver = { - .name = "acrux", - .id_table = ax_devices, - .probe = ax_probe, + .name = "acrux", + .id_table = ax_devices, + .probe = ax_probe, + .remove = ax_remove, }; static int __init ax_init(void) diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index d678cf3..758c080 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -1256,9 +1256,7 @@ static const struct hid_device_id hid_have_special_driver[] = { { HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU) }, { HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_X5_005D) }, { HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_RP_649) }, -#if defined(CONFIG_HID_ACRUX_FF) || defined(CONFIG_HID_ACRUX_FF_MODULE) { HID_USB_DEVICE(USB_VENDOR_ID_ACRUX, 0x0802) }, -#endif { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ATV_IRCONTROL) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_IRCONTROL4) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MIGHTYMOUSE) },