Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754079Ab2EFQw3 (ORCPT ); Sun, 6 May 2012 12:52:29 -0400 Received: from mail-bk0-f46.google.com ([209.85.214.46]:37817 "EHLO mail-bk0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753960Ab2EFQw1 (ORCPT ); Sun, 6 May 2012 12:52:27 -0400 Message-ID: <4FA6AC46.20701@gmail.com> Date: Sun, 06 May 2012 19:52:22 +0300 From: Nikolai Kondrashov User-Agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.3) Gecko/20120329 Icedove/10.0.3 MIME-Version: 1.0 To: Jiri Kosina CC: Henrik Rydberg , Dmitry Torokhov , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 0/3] hid: Enable report fixup on rebind References: <1335097300-11881-1-git-send-email-rydberg@euromail.se> In-Reply-To: Content-Type: multipart/mixed; boundary="------------000103040608050202010309" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 5184 Lines: 98 This is a multi-part message in MIME format. --------------000103040608050202010309 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi Jiri, Henrik, On 04/23/2012 12:27 AM, Jiri Kosina wrote: > On Sun, 22 Apr 2012, Henrik Rydberg wrote: > >> This patchset contains a resolution to the problem with >> driver-specific modification of the report descriptor. The core of the >> problem lies with the dual semantics of hid_parse_report(), which is >> therefore split into two functions. As a consequence, the hid core can >> handle the rebind case internally, with no changes to the >> drivers. Out-of-tree drivers will work fine as long as they operate in >> the same way as the in-kernel drivers. >> >> The first two patches are bug fixes found in the process. I am hoping >> for some test feedback on those. The third patch is the main one. > > Hi Henrik, > > thanks a lot for looking into this. I will look into the patches in more > detail tomorrow. I am now just adding Nikolai to CC, as he was the first > one to bring this up and actually has a driver that exposed the fact that > just freeing/reinstatiating rdesc is not enough. I've managed to throw together a script which rebinds a device to a specific out-of-tree HID driver automatically. Please find it attached. I'll be bundling it with the modules, probably. I'm planning to use it with udev rules looking like this one: SUBSYSTEM=="hid", ACTION=="add", ENV{HID_ID}=="0003:0000172F:*", \ RUN+="/usr/local/bin/digimend-rebind" So, the out-of-tree HID module problem is finally solved, at least for my current uses. Thanks a lot! Sincerely, Nick --------------000103040608050202010309 Content-Type: text/plain; name="digimend-rebind" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="digimend-rebind" IyEvYmluL3NoCiMKIyBESUdJbWVuZCBzcGVjaWZpYyBkcml2ZXIgcmViaW5kaW5nIHNjcmlw dC4gVG8gYmUgaW52b2tlZCBieSB1ZGV2LgojIEF1dGhvcjogTmlrb2xhaSBLb25kcmFzaG92 IDxzcGJuaWNrQGdtYWlsLmNvbT4KIwojIFRoaXMgcHJvZ3JhbSBpcyBmcmVlIHNvZnR3YXJl OiB5b3UgY2FuIHJlZGlzdHJpYnV0ZSBpdCBhbmQvb3IgbW9kaWZ5CiMgaXQgdW5kZXIgdGhl IHRlcm1zIG9mIHRoZSBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSBhcyBwdWJsaXNoZWQg YnkKIyB0aGUgRnJlZSBTb2Z0d2FyZSBGb3VuZGF0aW9uLCBlaXRoZXIgdmVyc2lvbiAyIG9m IHRoZSBMaWNlbnNlLCBvcgojIChhdCB5b3VyIG9wdGlvbikgYW55IGxhdGVyIHZlcnNpb24u CiMKIyBUaGlzIHByb2dyYW0gaXMgZGlzdHJpYnV0ZWQgaW4gdGhlIGhvcGUgdGhhdCBpdCB3 aWxsIGJlIHVzZWZ1bCwKIyBidXQgV0lUSE9VVCBBTlkgV0FSUkFOVFk7IHdpdGhvdXQgZXZl biB0aGUgaW1wbGllZCB3YXJyYW50eSBvZgojIE1FUkNIQU5UQUJJTElUWSBvciBGSVRORVNT IEZPUiBBIFBBUlRJQ1VMQVIgUFVSUE9TRS4gIFNlZSB0aGUKIyBHTlUgR2VuZXJhbCBQdWJs aWMg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 IGxvZ2dlciAtcCBkYWVtb24ud2FybmluZyAtdCAiJHByb2duYW1lIgo= --------------000103040608050202010309-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/