From patchwork Tue Feb 21 14:17:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Kosina X-Patchwork-Id: 9584679 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B33E5600C1 for ; Tue, 21 Feb 2017 14:17:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A678D288EF for ; Tue, 21 Feb 2017 14:17:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 97609288F3; Tue, 21 Feb 2017 14:17:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 69A08288EF for ; Tue, 21 Feb 2017 14:17:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752868AbdBUORt (ORCPT ); Tue, 21 Feb 2017 09:17:49 -0500 Received: from mx2.suse.de ([195.135.220.15]:42220 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752678AbdBUORs (ORCPT ); Tue, 21 Feb 2017 09:17:48 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 7C150AD55; Tue, 21 Feb 2017 14:17:46 +0000 (UTC) Date: Tue, 21 Feb 2017 15:17:45 +0100 (CET) From: Jiri Kosina X-X-Sender: jkosina@pobox.suse.cz To: Linus Torvalds cc: Linux Kernel Mailing List , Andrew Duggan , Benjamin Tissoires , linux-input@vger.kernel.org Subject: [PATCH] HID: rmi: fallback to generic/multitouch if hid-rmi is not built (was Re: [GIT PULL] HID for 4.11) In-Reply-To: Message-ID: References: User-Agent: Alpine 2.20 (LSU 67 2015-01-07) MIME-Version: 1.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Mon, 20 Feb 2017, Linus Torvalds wrote: > > I'll have a more specific commit (or range) soon. > > Hmm. It's commit 279967a65b32 ("HID: rmi: Handle all Synaptics > touchpads using hid-rmi"). > > And the reason seems to be stupid: I don't have RMI enabled at all, > because that didn't use to work or make a difference. > > Maybe that "let's use RMI" code should depend on RMI actually being > enabled? Because as-is, that code now breaks existing configurations. I agree; that's in line with what we usually try to stick to (force specific drivers if the device doesn't work with the generic at all and switch over to generic in compile-time for devices that have limited functionality with the generic driver). Andrew, Benjamin, how about the patch below? From: Jiri Kosina Subject: [PATCH] HID: rmi: fallback to generic/multitouch if hid-rmi is not built Commit 279967a65b32 ("HID: rmi: Handle all Synaptics touchpads using hid-rmi") unconditionally switches over handling of all Synaptics touchpads to hid-rmi (to make use of extended features of the HW); in case CONFIG_HID_RMI is disabled though this renders the touchpad unusable, as the HID_DEVICE(HID_BUS_ANY, HID_GROUP_RMI, HID_ANY_ID, HID_ANY_ID) match doesn't exist and generic/multitouch doesn't bind to it either (due to hid group mismatch). Fix this by switching over to hid-rmi only if it has been actually built. Fixes: 279967a65b32 ("HID: rmi: Handle all Synaptics touchpads using hid-rmi") Reported-by: Linus Torvalds Signed-off-by: Jiri Kosina Acked-by: Benjamin Tissoires Tested-by: Andrew Duggan --- drivers/hid/hid-core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 538ff697a4cf..e9e87d337446 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -827,7 +827,8 @@ static int hid_scan_report(struct hid_device *hid) * hid-rmi should take care of them, * not hid-generic */ - hid->group = HID_GROUP_RMI; + if (IS_ENABLED(CONFIG_HID_RMI)) + hid->group = HID_GROUP_RMI; break; }