Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp3412524pxy; Mon, 26 Apr 2021 00:47:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw3GFxhhgwN14bA+U5Y/zUxapWDUwDkMIzYrX07ECjbQK6rHN7krJKzbmAcpMFDimMz/7Vl X-Received: by 2002:a63:d815:: with SMTP id b21mr15918452pgh.217.1619423260201; Mon, 26 Apr 2021 00:47:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619423260; cv=none; d=google.com; s=arc-20160816; b=zs44QuhL7mIeOQAa6RCgVTA3IuLlWae5zpvjl53dixAvtsfY3XFdxdGtcACKih8HJj 7zyvppBW2aecW/Mjy2KBVZ4tXqzoh3caOUWzcrCasyz67C7WLFDY+q3IaNgn/O9PReJ/ q0HJVbs80G9T5sWdD0S9mXwIQum/sIYTzGo2qkQUN2jXGoAiXKr3AbS/TnjXS/TQCx2L psgQUn3R+fS9nMHLMzSBIfTAIxfrtqdTf/EBF8AzjSUkcWD/jL4xP3iB+IRThpg9j4MO eIPbJ08d8Zohk8jipSIp4JrHLIdx+8vFFHcLWBcQoH0yvUKeJWhxevnq074ArmJ7bMCc +mLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+pKHBx9AJxCEo7/HZAXoYRzbDD4whqJnLPgsqH7b7ZA=; b=ESL6vAQsynRfKtmpYU3xBdDHwwY8bsQFFjcNtl+wK9e5oS4NKq9f4hhV/KKyGz7DAA pygUg99ey33KS9jhVg7k8Jq642MlS1+MI1tTWEVyvoDETTCKkjz0GTUyiI4tlxcafJ2b ofISrbOy2710WqT3FuGQMqpbs1CEmiZQp+cu86jwWJjUQxhw/+E1wZqCaknbKP/HXPQN lnXMOl6T1yWaOYR/8HjnDflmWCAw/dKn261OJZs8QJRVJSLkT+i4UblhaBFLJyaHrynH wzm3ii+Z5gUy/rMbddMUiMnRoA9qaxMKNy8dXly95o91ESqdOWlbnbEoI7DuRO9Gd4sD qaXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1gJLh15v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 3si16148943pfe.109.2021.04.26.00.47.28; Mon, 26 Apr 2021 00:47:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1gJLh15v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233312AbhDZHrl (ORCPT + 99 others); Mon, 26 Apr 2021 03:47:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:49392 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233083AbhDZHi2 (ORCPT ); Mon, 26 Apr 2021 03:38:28 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A2D1861364; Mon, 26 Apr 2021 07:36:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1619422586; bh=+aeO+f+Y2ffOCXajMAx0E9n74vMRNP/r8MCf0cTWVPg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1gJLh15v6jjeghFiS91SD2egtniTPRP/ooH4LwSODWljrCvmcQAsIBM5+ThDQ33Wz QmmGUmzCTJYDx2dkz0q4tdkDQw/H5/7dxiNiciyrmQIH7Vdgp7N2l+Uk3TLA3Z85io cUNEjB2m2EmylQDDxdPdoGOS+0JGueaewZH1rAVo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Caleb Connolly , Andi Shyti , Dmitry Torokhov Subject: [PATCH 4.19 23/57] Input: s6sy761 - fix coordinate read bit shift Date: Mon, 26 Apr 2021 09:29:20 +0200 Message-Id: <20210426072821.364580076@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210426072820.568997499@linuxfoundation.org> References: <20210426072820.568997499@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Caleb Connolly commit 30b3f68715595dee7fe4d9bd91a2252c3becdf0a upstream. The touch coordinate register contains the following: byte 3 byte 2 byte 1 +--------+--------+ +-----------------+ +-----------------+ | | | | | | | | X[3:0] | Y[3:0] | | Y[11:4] | | X[11:4] | | | | | | | | +--------+--------+ +-----------------+ +-----------------+ Bytes 2 and 1 need to be shifted left by 4 bits, the least significant nibble of each is stored in byte 3. Currently they are only being shifted by 3 causing the reported coordinates to be incorrect. This matches downstream examples, and has been confirmed on my device (OnePlus 7 Pro). Fixes: 0145a7141e59 ("Input: add support for the Samsung S6SY761 touchscreen") Signed-off-by: Caleb Connolly Reviewed-by: Andi Shyti Link: https://lore.kernel.org/r/20210305185710.225168-1-caleb@connolly.tech Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov Signed-off-by: Greg Kroah-Hartman --- drivers/input/touchscreen/s6sy761.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/input/touchscreen/s6sy761.c +++ b/drivers/input/touchscreen/s6sy761.c @@ -145,8 +145,8 @@ static void s6sy761_report_coordinates(s u8 major = event[4]; u8 minor = event[5]; u8 z = event[6] & S6SY761_MASK_Z; - u16 x = (event[1] << 3) | ((event[3] & S6SY761_MASK_X) >> 4); - u16 y = (event[2] << 3) | (event[3] & S6SY761_MASK_Y); + u16 x = (event[1] << 4) | ((event[3] & S6SY761_MASK_X) >> 4); + u16 y = (event[2] << 4) | (event[3] & S6SY761_MASK_Y); input_mt_slot(sdata->input, tid);