Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2469114pxb; Mon, 19 Apr 2021 06:31:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz0hYQNYS015rivq1sObKyKTIRVImxYt8/ni0AJ3d5puDzPPGqClRQpBocIbBPG/8h+rgjO X-Received: by 2002:aa7:db87:: with SMTP id u7mr24949125edt.16.1618839084435; Mon, 19 Apr 2021 06:31:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618839084; cv=none; d=google.com; s=arc-20160816; b=x4NHmGoc0yz3UlWe4m1Osihz7JmbU601HNEwcPWmWFFtMiiVrTAQSNaOnQH/yV55ZC jrWLwxrVGVwV4+5xt1ng8ehSIOmSrowz4TCXYOveI68MqDIvLkA2Spk0mncKnl04i9H7 rx+6jPN8SDhnDBoZhfJeU5sGPvgXFznQY5G+kmBZ8SEQGckuIlGUwYUDChpYr/FxDKPW JvMwcKhKkvZQlDSiz8d833IH/BdjGH64tdz4MrM1AODn3IIXWEJZPYIvba4TfvjqF8Z7 SPmq4ZCrn23W4sjtDU7x5uxykB7pRFmCrBOhc357YqxYY/blYfWbbR/2n4WO78CoOuK5 r+yg== 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=NkFDBxvnZKwchAB9L4LnHfxOz9KacN7Wj67WprOD9+OFuTG0g/C8pL02hFwHCgo3KI 0o9gmw6mIUDgqSPDDvIKMnTPgxPtiayUoAr+jfSjB4KuJFg+wv8lbkHyAchE8ZJ6xlM2 00ygl1N1nraomVq0ko/02DyjHiVatda+UIwktDW/aFOyekuBFFqS4wAWGghvisGL6YZ9 gUf+kJYwzUituD9d9JkSiztyRgeVEgpiTFbZP5092HkRCkwlAVKy4LZI2DlOuXisO1NW kuBHze45IOnKJsCbWp0Fi+9Vlymfv+QxZiS4Fd3AJkHBH4D7TvdNySKTWuzAI5KSylFU T+Wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=06WLA9V3; 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 ec6si13011998ejb.738.2021.04.19.06.30.54; Mon, 19 Apr 2021 06:31:24 -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=06WLA9V3; 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 S240564AbhDSN2m (ORCPT + 99 others); Mon, 19 Apr 2021 09:28:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:54752 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241435AbhDSNUe (ORCPT ); Mon, 19 Apr 2021 09:20:34 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6CFCC613EA; Mon, 19 Apr 2021 13:16:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1618838207; bh=+aeO+f+Y2ffOCXajMAx0E9n74vMRNP/r8MCf0cTWVPg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=06WLA9V3z43B59C1EkPpbUlu3L3+kWij4yU7n2tBdJ1c6D4XvTL1xNnHk9L+gzyUn gIC+6Bcj1/cdhMacwUImgqETthXjsgE1qKF6IgtIDDE4WmhPnR+pBOz65xZK49+/ZR G8qnHElWxSJTZVc0xed+GYvgxXw5Xey6Gg/mx55k= 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.10 047/103] Input: s6sy761 - fix coordinate read bit shift Date: Mon, 19 Apr 2021 15:05:58 +0200 Message-Id: <20210419130529.435420150@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210419130527.791982064@linuxfoundation.org> References: <20210419130527.791982064@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);