Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp5237920ybl; Tue, 27 Aug 2019 01:20:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqx5zaf/52hrkWWrFPQT/7uBQyt9cBA3QfcoqPKi6dv79p+InSwGhyUfIBDwd8cJMP5T9M6/ X-Received: by 2002:aa7:8ac5:: with SMTP id b5mr6431265pfd.56.1566894001737; Tue, 27 Aug 2019 01:20:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566894001; cv=none; d=google.com; s=arc-20160816; b=M1VCk39R4sknkXy3hIJpciQeEpeSeUyigDBjgI4d6g0LCogmmqdLheyqVjc9mfc7gE csjRAtiEI3wrkzv6yonfWNTRCmd6OQxj24laqXyFdTBbkwG1xtm1Iq6Ba2zHmkWucDvc cQRqkfApNEOKosfw6y6Jw5uvLcLWXq+QX6yjRp4FsAOUGS9k8dWIhRY8MeOx+Zv0VEIy qSMASJSRRUUwyvpe6GwDdsGkc9jfGFGeOdH49hT2NOE5/WT20H4DYYCPhhBPylUbw5My b9vieworN+DxgBivEDwG8inIxd1rWGesEY9spykCdQdZY+/OrMxJ4BbE9BYOXqMcMP1M TWJg== 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=SgNj5/vgoGePJNxH0GVDQd/KuNzy2TypC7LwO/a7z94=; b=XemEmONWuCMk4by7BoPYnDn93qSvu+VTppPF+X7j+UQApp7XXSbPdn8bUpEWQe1b4o x2wSkm2K9BWcA2sj4JJHd/V9ME0n6w6+ceaFBwW5LaMmKoR42TitastXRfitZDKdTIqB AohwTMhB71FwOX24vgSdF1YIMnxWrO1/K0rsmbMT5FafFYfdaKAAmXifwmU4IaR4JDZV sYqLTQ/rLuLSs+xNobPy85mnm/Cj4J3PsN1tVb7f9QKbfYjNHFhy3CzFAsz1zQzQJYM5 mcACX/jL4g8qXwBbRWZH1bzmMHXshQtlqzEI3VLO1QA7OPweLYFUHrVh9w9y1SEi752e oAgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=YIwVDc8I; 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 l184si11135586pge.286.2019.08.27.01.19.46; Tue, 27 Aug 2019 01:20:01 -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=YIwVDc8I; 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 S1729711AbfH0HxO (ORCPT + 99 others); Tue, 27 Aug 2019 03:53:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:44654 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728954AbfH0HxJ (ORCPT ); Tue, 27 Aug 2019 03:53:09 -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 4613B2173E; Tue, 27 Aug 2019 07:53:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566892388; bh=SQhY+TpsZ2oEYPOt8K5AAC0iYYzjOFc5UyErPw4oMUc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YIwVDc8ICyPqA97Ys4hu8V4ctfwjKsmlhsu+704kSvEsyKXmUoaLYRKYNG1P7/vZz 8ZgX0F4EuJmAoLpLJoJHICSEnmXy01W1Fbx4PVhV2AAD3nW20L0LQPUrOVl+yjkvg5 rQsGxgFekr5HiAj+XSqhfhwmvDjSRprKcKwYrhEc= 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.14 37/62] HID: wacom: Correct distance scale for 2nd-gen Intuos devices Date: Tue, 27 Aug 2019 09:50:42 +0200 Message-Id: <20190827072702.809864350@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190827072659.803647352@linuxfoundation.org> References: <20190827072659.803647352@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: Jason Gerecke commit b72fb1dcd2ea9d29417711cb302cef3006fa8d5a upstream. Distance values reported by 2nd-gen Intuos tablets are on an inverted scale (0 == far, 63 == near). We need to change them over to a normal scale before reporting to userspace or else userspace drivers and applications can get confused. Ref: https://github.com/linuxwacom/input-wacom/issues/98 Fixes: eda01dab53 ("HID: wacom: Add four new Intuos devices") Signed-off-by: Jason Gerecke Cc: # v4.4+ Signed-off-by: Jiri Kosina Signed-off-by: Greg Kroah-Hartman --- drivers/hid/wacom_wac.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/hid/wacom_wac.c +++ b/drivers/hid/wacom_wac.c @@ -848,6 +848,8 @@ static int wacom_intuos_general(struct w y >>= 1; distance >>= 1; } + if (features->type == INTUOSHT2) + distance = features->distance_max - distance; input_report_abs(input, ABS_X, x); input_report_abs(input, ABS_Y, y); input_report_abs(input, ABS_DISTANCE, distance);