Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp340475ybl; Fri, 9 Aug 2019 06:50:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqwOI5GTCSrpVwwY/nVtrEY8AmorgVkM7xya+/8EzoBO7g75rzUCPxur7LW1spOz3gAo1Pib X-Received: by 2002:a17:902:9346:: with SMTP id g6mr19175999plp.61.1565358628977; Fri, 09 Aug 2019 06:50:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565358628; cv=none; d=google.com; s=arc-20160816; b=GJjuXe8Syhx4OqtFrkK2W7CEmoFSWCaNRtPCgCM1L9+W1Ai4R5WoCuK85S8LfsIt8w ImJuC+KT+vVNRmCBk50tmofA8mfw4gbuFu9RBQRgNlt+MhwfRifkvTvjiNbJ76dRbi5y CD6sbVJSWJeevP9JUnCsPDcfF9Xk+l37PM4aURrXTo7tYF+WTbOMWfGab9LLiBNawZTc NucpfPVGymnpbtvDY3KGGU8gL6aERyYoBa+DaOMdxf8f3gRiXRwaBR62H1RM31AG9+z7 SRjqJP9cJlPyKFX6Ex0vTxiz3YZT1NQ/s6lFc4H86bUppmmiGCGk4PxQL2Whrw+tHs17 AXqw== 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=pj9CWb5fox4+AWWOGMauwHsm6FfbRgzanOp1ygFtt74=; b=NYQjEmFMm+gOJOwKzwxVFZ9z1qlm70Lg6MA+WRx9Vjsm3NviQjuRkwSgadXs8XdNCc I07rznGhTs9SHulRgw4m4stpxJvtE7+ZzRBV3tqYsM8krc3ZN2xbwWYqO4xAsv9oDgu1 xqIv1gsLPsPD+1zTEuJX2qSARMkDzrqDWB1sDrZtlD5VwgSnwOC0sXGA/KWEGdr5Y2s/ DQrZI/82ahmgR10nD+WbJfer+H+qxiiIJorr/6r3FeiT+jYDw09Ku8ycqKSKQoNj3Q/e YnOIcCV0+eq7KxH4e54+b/o4A6CyfQt3VFwo734RTlLomYSZYbrxCCIGgpIMTVl/ckrv RDjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zlsv9G6M; 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 i69si13485290pgd.184.2019.08.09.06.50.12; Fri, 09 Aug 2019 06:50:28 -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=zlsv9G6M; 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 S2407186AbfHINq7 (ORCPT + 99 others); Fri, 9 Aug 2019 09:46:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:36838 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2407157AbfHINq6 (ORCPT ); Fri, 9 Aug 2019 09:46:58 -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 2F55521874; Fri, 9 Aug 2019 13:46:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565358417; bh=Bll61FBxQFEAZ7jzNiAdReu8C4E77sdRKdifBhJ4bmI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zlsv9G6MuhFBr3zXmIqrQilQynDk8SQUYPHbpWhInyIDW+6R9B7svjNsXtZbFJgVC h3hke56vMjZITSNYC1knMIaZ/d4dFW/j6379UG1IjNYN+8e2FawaK5YuH2fPg5Jfcx 8MtP0t8mh2iLO8D8RfICeFy56RUtoXOV6HF1+fYE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Aaron Armstrong Skomra , Ping Cheng , Jiri Kosina Subject: [PATCH 4.9 08/32] HID: wacom: fix bit shift for Cintiq Companion 2 Date: Fri, 9 Aug 2019 15:45:11 +0200 Message-Id: <20190809133923.218536897@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190809133922.945349906@linuxfoundation.org> References: <20190809133922.945349906@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 693c3dab4e50403f91bca4b52fc6d8562a3180f6 upstream. The bit indicating BTN_6 on this device is overshifted by 2 bits, resulting in the incorrect button being reported. Also fix copy-paste mistake in comments. Signed-off-by: Aaron Armstrong Skomra Reviewed-by: Ping Cheng Link: https://github.com/linuxwacom/xf86-input-wacom/issues/71 Fixes: c7f0522a1ad1 ("HID: wacom: Slim down wacom_intuos_pad processing") Cc: # v4.5+ Signed-off-by: Jiri Kosina Signed-off-by: Greg Kroah-Hartman --- drivers/hid/wacom_wac.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) --- a/drivers/hid/wacom_wac.c +++ b/drivers/hid/wacom_wac.c @@ -529,14 +529,14 @@ static int wacom_intuos_pad(struct wacom */ buttons = (data[4] << 1) | (data[3] & 0x01); } else if (features->type == CINTIQ_COMPANION_2) { - /* d-pad right -> data[4] & 0x10 - * d-pad up -> data[4] & 0x20 - * d-pad left -> data[4] & 0x40 - * d-pad down -> data[4] & 0x80 - * d-pad center -> data[3] & 0x01 + /* d-pad right -> data[2] & 0x10 + * d-pad up -> data[2] & 0x20 + * d-pad left -> data[2] & 0x40 + * d-pad down -> data[2] & 0x80 + * d-pad center -> data[1] & 0x01 */ buttons = ((data[2] >> 4) << 7) | - ((data[1] & 0x04) << 6) | + ((data[1] & 0x04) << 4) | ((data[2] & 0x0F) << 2) | (data[1] & 0x03); } else if (features->type >= INTUOS5S && features->type <= INTUOSPL) {