Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10428459ybi; Wed, 24 Jul 2019 23:03:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqy+4One3kH/xEnQ1LTl7PH4r9GO24brgy9NdSmCdvemc20P9aGZmRRdHjMAwFOS8U3oX4dB X-Received: by 2002:a62:e710:: with SMTP id s16mr15461768pfh.183.1564034591215; Wed, 24 Jul 2019 23:03:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564034591; cv=none; d=google.com; s=arc-20160816; b=z+2ERpqWWfqDixkfc8Q+qQBcYfEGXaq+pU8Zm6ss8L2kk0ek4ldXff7oJS7w/kQwcX Tev+Fj8zafY89tQXNHGOdHCP/oRblYbf/pRpQk4S+uZJOOpuSonqY/FzNi1ribfOEXSP q4sYsHx1XeA1TM0afrs+Rodh5fqjxaBQ4b2bsBWhMn7wIZasNelRDZ1CdWu5Dr5vcow1 LKOKw+cqO0rl/gt6nRAV2hBYHFm3HSn1ouFClzDMDTv4fl6q9kLEeb8ZsJs1HvY5INrH zOR2kArZyuDK020jYS8otXcSvZNJ1lH0V7WdqzFu1sP5iSsgw70Rh245bmJ2ZgfCjeyc 9N9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=PqaKIvDh66ryA3QnOo1NddAnAddhLQWsz+rFpE+npdM=; b=KfLaPGUjXNlamogdN+SM69AEWWmLCehLm+WlduMrGUgwkVoTJyZxcva7V6agfsU6pk pDDMduTxj6jS+Et2BGIKaTuCs2d6IaN7tt0Mftau1oNVplmLjNctM4VyJRlxUqLHNnAW rZXglD9wDsZw5nSmaW16rVeHSblkEOOacuoaSGtMNZAt7d50IjV3cE1p+KtP0ldXflsB fI+USN3HjEQBQNjDMs9Wo0t+IjOfFrKP7lC1Pd1jN71HYlvi0jO+3rC+F/0+tObcLwqf Zu+keC8mqTB1S0fb+nPNliAqHWlxBgncPP8m9dRShjiDi/KRJ+bRIDZdZaUGXPGV6+bq 7Pzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Z3xU0EYB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 64si14368094plw.37.2019.07.24.23.02.55; Wed, 24 Jul 2019 23:03:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Z3xU0EYB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405160AbfGYFpV (ORCPT + 99 others); Thu, 25 Jul 2019 01:45:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:60798 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405147AbfGYFpU (ORCPT ); Thu, 25 Jul 2019 01:45:20 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C4BDA22BEB; Thu, 25 Jul 2019 05:45:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564033519; bh=zPsCyeore4QByTeWfah3hRE9uGuH/wF0goEemZD+vX8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z3xU0EYBfnGQFsIjxXboHE0pkkWhom62KOrkWIgd9o0EcA/cGrXbrMEJV8FZ1Rtii qcEFKGQU2LgbhLv6Ns5WAIxuwp3Yqd1UZJdP4eXb5QP7JMWUev1RPQzcwUAU+21REF zwVC5Lk53x91MjTtNgSJPOGatvgJ1fB3kKq26FIE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Aaron Armstrong Skomra , Jason Gerecke , Jiri Kosina Subject: [PATCH 4.19 236/271] HID: wacom: generic: only switch the mode on devices with LEDs Date: Wed, 24 Jul 2019 21:21:45 +0200 Message-Id: <20190724191715.384398661@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191655.268628197@linuxfoundation.org> References: <20190724191655.268628197@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Aaron Armstrong Skomra commit d8e9806005f28bbb49899dab2068e3359e22ba35 upstream. Currently, the driver will attempt to set the mode on all devices with a center button, but some devices with a center button lack LEDs, and attempting to set the LEDs on devices without LEDs results in the kernel error message of the form: "leds input8::wacom-0.1: Setting an LED's brightness failed (-32)" This is because the generic codepath erroneously assumes that the BUTTON_CENTER usage indicates that the device has LEDs, the previously ignored TOUCH_RING_SETTING usage is a more accurate indication of the existence of LEDs on the device. Fixes: 10c55cacb8b2 ("HID: wacom: generic: support LEDs") Cc: # v4.11+ Signed-off-by: Aaron Armstrong Skomra Reviewed-by: Jason Gerecke Signed-off-by: Jiri Kosina Signed-off-by: Greg Kroah-Hartman --- drivers/hid/wacom_sys.c | 3 +++ drivers/hid/wacom_wac.c | 2 -- drivers/hid/wacom_wac.h | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) --- a/drivers/hid/wacom_sys.c +++ b/drivers/hid/wacom_sys.c @@ -275,6 +275,9 @@ static void wacom_feature_mapping(struct wacom_hid_usage_quirk(hdev, field, usage); switch (equivalent_usage) { + case WACOM_HID_WD_TOUCH_RING_SETTING: + wacom->generic_has_leds = true; + break; case HID_DG_CONTACTMAX: /* leave touch_max as is if predefined */ if (!features->touch_max) { --- a/drivers/hid/wacom_wac.c +++ b/drivers/hid/wacom_wac.c @@ -1928,8 +1928,6 @@ static void wacom_wac_pad_usage_mapping( features->device_type |= WACOM_DEVICETYPE_PAD; break; case WACOM_HID_WD_BUTTONCENTER: - wacom->generic_has_leds = true; - /* fall through */ case WACOM_HID_WD_BUTTONHOME: case WACOM_HID_WD_BUTTONUP: case WACOM_HID_WD_BUTTONDOWN: --- a/drivers/hid/wacom_wac.h +++ b/drivers/hid/wacom_wac.h @@ -145,6 +145,7 @@ #define WACOM_HID_WD_OFFSETBOTTOM (WACOM_HID_UP_WACOMDIGITIZER | 0x0d33) #define WACOM_HID_WD_DATAMODE (WACOM_HID_UP_WACOMDIGITIZER | 0x1002) #define WACOM_HID_WD_DIGITIZERINFO (WACOM_HID_UP_WACOMDIGITIZER | 0x1013) +#define WACOM_HID_WD_TOUCH_RING_SETTING (WACOM_HID_UP_WACOMDIGITIZER | 0x1032) #define WACOM_HID_UP_G9 0xff090000 #define WACOM_HID_G9_PEN (WACOM_HID_UP_G9 | 0x02) #define WACOM_HID_G9_TOUCHSCREEN (WACOM_HID_UP_G9 | 0x11)