Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3476555imu; Sun, 11 Nov 2018 16:00:13 -0800 (PST) X-Google-Smtp-Source: AJdET5d3pHyw1p84t2M7Nq7IyX9Ueu/PMh8uOy/3Qed4ERe70Et+XwX+th2XOmaakoaPJuBYAoTU X-Received: by 2002:a63:981:: with SMTP id 123mr15676908pgj.444.1541980813089; Sun, 11 Nov 2018 16:00:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541980813; cv=none; d=google.com; s=arc-20160816; b=GpBOGQUXJkRpWVjZVl0ypss9BimSOfdvsk/8IxQhAZVFnfDuwt0kyTKX+mfT0WCsqq /Wd7Q1fFgeYSlIjovAXBdK7DwUmE+5opb/fg/XcB99jiT0U1aKL0f5LtC5B57dC0ct0r cM94NeVuDKCO3UkrKqEWWfC8wo7lJc0D5wjqlgi85OwTUl8wih8DaMCQGHCahq44Qfji c6Kxqq7hFMFW8RAQ4Vs7v5VyhpAbohpv3fzDLh6ToGldVEUhWEElaMRfJf8mI70L3ttj ql9TgSBefFgfyOS40p6zl2SdhUMz6VyCIAHlo1xtDMOZpOt4k8gjFcn1bNoLDsPvLAIB 5Vkw== 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=sWB4AQO0hR3FFe05ye8eNElt8es5YtniE0o110UiUn0=; b=KMzdc2Q/pnYQL70sEbxuehrr+6/Lmi1kd7tCtPMzmWGhkl+QWxPyeyTIECNI7s1drQ pxfZM6/SkD03qde/TL218JLdCIXBUOCdMc9r9zrpL+cQG1D+SfHX96W7uJntt+R3fbcH 2izLEJdx1S4UDIRnaS0GaFHXV3wxr9UOHpdzoXqs79zo0GUJI6LOXwOtX7WQfUzonv54 SZTe08Qy8bS7NOl5A60CSObRHwzHItwDE2bX0F7/Ky4uyoZqSqkA1UxRgtpXzJmhtSIl mx0v/++cIPbz8HFMopKNNW0bN5lh7X6ZQc+X7t8xDQoKINkaOoNbmp4PsvENydv9HdyK ASKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="eMl/RPaw"; 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 s4si14258450pga.377.2018.11.11.15.59.57; Sun, 11 Nov 2018 16:00:13 -0800 (PST) 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="eMl/RPaw"; 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 S1732727AbeKLJst (ORCPT + 99 others); Mon, 12 Nov 2018 04:48:49 -0500 Received: from mail.kernel.org ([198.145.29.99]:34210 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732353AbeKLISG (ORCPT ); Mon, 12 Nov 2018 03:18:06 -0500 Received: from localhost (unknown [206.108.79.134]) (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 2A3A4215EA; Sun, 11 Nov 2018 22:28:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975291; bh=AOz+cb/9ahYPTbIGc2KJT+9nZ7iddcKF4Rq0rmw2FqM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eMl/RPawAHuOKh9sEqY5/xH0+xxEUbLDag+tp2B/IcqpBoD/dSRWvDt9E+sGA7zWh rhHDSY+3bornd3+E8sKwDyqb09FvxqAb+dOIKFxUD7Kp4H2oZi5h6N3wDjGZB9o9vn FtX2dVNpwjePo+ZNuM2UM7sFux8MIZJm4S/dg4OI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jason Gerecke , Jiri Kosina Subject: [PATCH 4.19 232/361] HID: wacom: Work around HID descriptor bug in DTK-2451 and DTH-2452 Date: Sun, 11 Nov 2018 14:19:39 -0800 Message-Id: <20181111221651.616099405@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221619.915519183@linuxfoundation.org> References: <20181111221619.915519183@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review 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 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jason Gerecke commit 11db8173dbab7a94cf5ba5225fcedbfc0f3b7e54 upstream. The DTK-2451 and DTH-2452 have a buggy HID descriptor which incorrectly contains a Cintiq-like report, complete with pen tilt, rotation, twist, serial number, etc. The hardware doesn't actually support this data but our driver duitifully sets up the device as though it does. To ensure userspace has a correct view of devices without updated firmware, we clean up this incorrect data in wacom_setup_device_quirks. We're also careful to clear the WACOM_QUIRK_TOOLSERIAL flag since its presence causes the driver to wait for serial number information (via wacom_wac_pen_serial_enforce) that never comes, resulting in the pen being non-responsive. Signed-off-by: Jason Gerecke Fixes: 8341720642 ("HID: wacom: Queue events with missing type/serial data for later processing") Cc: stable@vger.kernel.org # v4.16+ Signed-off-by: Jiri Kosina Signed-off-by: Greg Kroah-Hartman --- drivers/hid/wacom_wac.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) --- a/drivers/hid/wacom_wac.c +++ b/drivers/hid/wacom_wac.c @@ -3335,6 +3335,7 @@ static void wacom_setup_intuos(struct wa void wacom_setup_device_quirks(struct wacom *wacom) { + struct wacom_wac *wacom_wac = &wacom->wacom_wac; struct wacom_features *features = &wacom->wacom_wac.features; /* The pen and pad share the same interface on most devices */ @@ -3464,6 +3465,24 @@ void wacom_setup_device_quirks(struct wa if (features->type == REMOTE) features->device_type |= WACOM_DEVICETYPE_WL_MONITOR; + + /* HID descriptor for DTK-2451 / DTH-2452 claims to report lots + * of things it shouldn't. Lets fix up the damage... + */ + if (wacom->hdev->product == 0x382 || wacom->hdev->product == 0x37d) { + features->quirks &= ~WACOM_QUIRK_TOOLSERIAL; + __clear_bit(BTN_TOOL_BRUSH, wacom_wac->pen_input->keybit); + __clear_bit(BTN_TOOL_PENCIL, wacom_wac->pen_input->keybit); + __clear_bit(BTN_TOOL_AIRBRUSH, wacom_wac->pen_input->keybit); + __clear_bit(ABS_Z, wacom_wac->pen_input->absbit); + __clear_bit(ABS_DISTANCE, wacom_wac->pen_input->absbit); + __clear_bit(ABS_TILT_X, wacom_wac->pen_input->absbit); + __clear_bit(ABS_TILT_Y, wacom_wac->pen_input->absbit); + __clear_bit(ABS_WHEEL, wacom_wac->pen_input->absbit); + __clear_bit(ABS_MISC, wacom_wac->pen_input->absbit); + __clear_bit(MSC_SERIAL, wacom_wac->pen_input->mscbit); + __clear_bit(EV_MSC, wacom_wac->pen_input->evbit); + } } int wacom_setup_pen_input_capabilities(struct input_dev *input_dev,