Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp5228019ybl; Tue, 27 Aug 2019 01:09:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqxl9h9bePXuXUWe2xtOZ80T+dDGLPCik76qbO9OzhR5FBp/EgC9ClbDwxGDab6IMA3fiURl X-Received: by 2002:a63:9d8a:: with SMTP id i132mr9961959pgd.410.1566893347694; Tue, 27 Aug 2019 01:09:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566893347; cv=none; d=google.com; s=arc-20160816; b=T6j9a5Jrka8NLxFJru2e+xs/nm1I3J/jMVfZpyB5Q1pyvL/X2cFht9+bJyxIBSSCvW Fp9I2srI3HSKkBELqZDujzLbk6VltI6H3VQgdCxYgXHs9uFVbrvHiBKX2wxrwIs1uu0f wLweBXbOzjd6uybxwTX9fW49KALX/PYx2ADkMALBPqLMjfFmUXm6D4lzDtKlC9jqaH8P vPD35tFecXfRZZ2u0GRwb8CR+4okbi7z5QE6RPcIKVdS9oIH0TyjcXPEaFPX8cO0BcGh CIjQUUMEI8Pq82Y25hiiEBwCoyd0JqsFERuG2ZhtX0foWuSQrNEV0a5ucyPA3u+SdUJC ZkZg== 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=47fngkaV8Ht8UpzMPYaBGkruYmoZbf/8gyAv2wqWH5k=; b=ToxfbpXB/LO2OmQNSH3+ThwCDlZYByoXCRNGS6CEKhQ+IA+VwDTKgnaQjj5VEiH6El ls70IMbvVfOB+kZAQVCNv31691E484tKIRGkC03loxaWZabQMXf18CbFcL90Aw2pqBjT uzv1glagmKnTKvRucP6cPhTTnVtsYklT6KbfUdfHmmX1LmrxOdwRvANw2t0RgrdfIrsN 5Ebv/+ay4qxqPSFQRo7f5MuTLt549XNX9/QWWVngg6hk6FseIjgk20wjLahnew9JOj1E pkfxJEFbtVKnKIdbVImPCGUAj202JdgKXGHwtHdr+oQcwtaP8f5rz2yUfWpWAXYaExBF UPCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=f5XcEnNR; 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 f8si12496227pfn.43.2019.08.27.01.08.52; Tue, 27 Aug 2019 01:09:07 -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=f5XcEnNR; 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 S1733056AbfH0IGo (ORCPT + 99 others); Tue, 27 Aug 2019 04:06:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:36644 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732640AbfH0IGi (ORCPT ); Tue, 27 Aug 2019 04:06:38 -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 7BE20206BF; Tue, 27 Aug 2019 08:06:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566893198; bh=DLI2UQL4wEAh+RKhlUFokT65zPuIwUI3g+AXNMAYFhM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f5XcEnNRihOgy4TkozH0iHpyrIsF8kjV7Mpe8nKJ/bZvCVgPDb1BXprTf5kMgz1y9 E5u5vvgqbCOXI5xYlIFOfSfzQraQd3tyfBaRi6ngqBuumy+cgG9lO1nUyHIhNjgj6B fUxJS4noG8Tfab18y1yjdDg221RU8sX7btVcIhXY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jason Gerecke , Jiri Kosina Subject: [PATCH 5.2 112/162] HID: wacom: Correct distance scale for 2nd-gen Intuos devices Date: Tue, 27 Aug 2019 09:50:40 +0200 Message-Id: <20190827072742.275319262@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190827072738.093683223@linuxfoundation.org> References: <20190827072738.093683223@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 @@ -846,6 +846,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);