Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2545525pxb; Mon, 19 Apr 2021 08:08:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzwH3O07DxxH6WYJQY14CmKKtrWTIrhWPthuFfjfXvEpxb8zD4rSOJyKFepcS+fp1QXINCA X-Received: by 2002:a63:ea06:: with SMTP id c6mr12388196pgi.401.1618844915882; Mon, 19 Apr 2021 08:08:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618844915; cv=none; d=google.com; s=arc-20160816; b=dj3DNxJof6iPTjmbcYrT8OHXwV75OeKuDknYU0xmHyEtlp9qPg4lr6oIptBF5t4Vnp ua78nER+Jus8R/W8It0eDU1jJwan6+MlLxEOHr37LH9G1NTCRs4U2sXW/tGOTP/h+8yT als4cdCrjHQ8F2fhKOR0t2hdxmpM/GPtVD3e3dS7I1sdHfBWfW2m8VCJa+ZntHYSkDFi OHne7A+ZiRUUDRexX90+O4c8dNHZ1rdxhIhFS8aMLWsTHWxjreH4RHTExsS/SgInTjeS xPRCw01DMRomrhG3v1hF1BBo9qhrAMxWW2qy27DaAQ7aLZD9ghUifnuGSInESawgQVjw rK4A== 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=OjazUp7VC3TUojRGgQ2x0bR8YiLC/23f30cRwmUaltLxSroBmLGZKZYpOmNuwLvg8M KMCk2cRkW2oDEguMef5kd+RPgnhWUj8ev4yPOLt89Js4lO01UBt3I05grfipIdYuiObn ouIycYVtPAPtbD6G4jeiMAtxO15wXhZjqi8gu8t232H8+WbYKmHke3hUtJgn4zyiQigH kJttAaS8VEaKZEDBoDne5uUZB0UitAxB7Ihx6IX2DnF/Pw/pgoY/S1bW8fvxUd7v8PND 9Zehav3rGgOS/7xPiCQKwcUghmyHD2/TaJQQHNwPqa/QH5hKMOgFThNqRpcCVsKidnIH oGjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vWY9UmBs; 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 h3si17721969pjt.24.2021.04.19.08.08.20; Mon, 19 Apr 2021 08:08:35 -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=vWY9UmBs; 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 S239491AbhDSNL7 (ORCPT + 99 others); Mon, 19 Apr 2021 09:11:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:45918 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238447AbhDSNK1 (ORCPT ); Mon, 19 Apr 2021 09:10:27 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3E4AA61246; Mon, 19 Apr 2021 13:09:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1618837797; bh=+aeO+f+Y2ffOCXajMAx0E9n74vMRNP/r8MCf0cTWVPg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vWY9UmBsFJtCH5CAKV+SrQXgFt58kO6/1BmEHxq6heir6QcUpvFlWF3B+b2rBp0kD kqKnAkAXzgXPiCqQGuugLh/miW1wJ7BsX9Bx3TEYQ8cKL4VBhwlp2WSXAXW/IvTkPR oFlWZHeBfa86NgWXEJ9JoQQW8Q5HMHAyukMIIlT4= 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 5.11 056/122] Input: s6sy761 - fix coordinate read bit shift Date: Mon, 19 Apr 2021 15:05:36 +0200 Message-Id: <20210419130532.092640083@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210419130530.166331793@linuxfoundation.org> References: <20210419130530.166331793@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);