Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1591473ybv; Thu, 20 Feb 2020 23:53:50 -0800 (PST) X-Google-Smtp-Source: APXvYqz303B1evIPY4+uEbx4D//T03W1EFdgm38TcRRJRy18gDG13XrEbHERppfU1Rxi8R5w4Agi X-Received: by 2002:a05:6808:487:: with SMTP id z7mr941822oid.59.1582271630111; Thu, 20 Feb 2020 23:53:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582271630; cv=none; d=google.com; s=arc-20160816; b=Bwgr+whqLUy4zvcV2N2FOtuVvghLavGT8lTUGihcpuOaeLCrPTpMMngUMyV1TY+vRj QwLS6ij+wBNIZm7f2XtfY7/yd+ZcoPbDc8hDuE0YjbykOsD8iB3LLN+EeZJHg0HCSmOt k3Q4/CWAZAM6vHEfpM7xTSR9b1VcFX8wqINqMoHFec7RrQZYH1M6iTdTzALcdhYdsOYP eP2XRl2LQUlRuUmUVP6Y7S3qfhcnuJLEYZdIc1/Y2RZ9DbtUahJG+y0cBZbNhmqYWoBA Ln/ErJLhVT3FpkvN0xuK7mRQvE+32VTWxWo5Zo4cCFpGF88+SJs1akfgJZm93voNqpbh 1uJg== 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=F7KL+hZp/zN2s0TlcWzT6Xo11cXMl2f+qth5Xh32nf8=; b=wb9P3XZsp1x6vHZ6PBD2rERflsvy06kDMNn+35J89oyu6H5iGRGit4Nc0WrlqubbHP HTYitseIZ2tMPv8Fu1UVE6izEAOntw1LnHXT7I9xggjQSOfVZw0JAHsMk89+1Q8JAQWA LiWfDWpQ6jX1DyRVrco3NPwViaAl4Yg4vF4umIN3rvNTkoca4o4SdUk6hc1wAko70Wfu oo9/OsxRJh/53Gx2ySLXXooGwni4x7FAkof19KJPQQ2pICU5jQD+s5R35FKD/2IzTw7x jJdGKN0kKSwKeeXrpI6y5umCgXHXKq1HYtjngHBJ2wOgayr5uab1cMcmXlTwRxh+fQlX dBzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Xn8jmPn1; 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 13si428289oiy.28.2020.02.20.23.53.38; Thu, 20 Feb 2020 23:53:50 -0800 (PST) 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=Xn8jmPn1; 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 S1730123AbgBUHxf (ORCPT + 99 others); Fri, 21 Feb 2020 02:53:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:51832 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729337AbgBUHxd (ORCPT ); Fri, 21 Feb 2020 02:53:33 -0500 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 61EAD2465D; Fri, 21 Feb 2020 07:53:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582271611; bh=6j1K92uXQHGUNZx44H0eiABCvbiGImXRdsQbp3X8P6A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xn8jmPn1MEhpos4bca0VKzERWXQ/J8fYjte8gDmz/O4+w1BqhLdoTssuMzC9wLoSL YATxcvBIKf45UBUE2vMvhHvzmwZrl1m1u0KpkSyv9jK2v39Cee4q+wmhvQuH/nfpmB +CkKzTZQc8NmgJ2oJW/oqpY1uIKF5Lm2r/M+58Mo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Philipp Zabel , Marco Felsch , Andy Shevchenko , Dmitry Torokhov , Sasha Levin Subject: [PATCH 5.5 231/399] Input: edt-ft5x06 - work around first register access error Date: Fri, 21 Feb 2020 08:39:16 +0100 Message-Id: <20200221072425.239736964@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200221072402.315346745@linuxfoundation.org> References: <20200221072402.315346745@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: Philipp Zabel [ Upstream commit e112324cc0422c046f1cf54c56f333d34fa20885 ] The EP0700MLP1 returns bogus data on the first register read access (reading the threshold parameter from register 0x00): edt_ft5x06 2-0038: crc error: 0xfc expected, got 0x40 It ignores writes until then. This patch adds a dummy read after which the number of sensors and parameter read/writes work correctly. Signed-off-by: Philipp Zabel Signed-off-by: Marco Felsch Tested-by: Andy Shevchenko Reviewed-by: Andy Shevchenko Signed-off-by: Dmitry Torokhov Signed-off-by: Sasha Levin --- drivers/input/touchscreen/edt-ft5x06.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c index d61731c0037d1..b87b1e074f624 100644 --- a/drivers/input/touchscreen/edt-ft5x06.c +++ b/drivers/input/touchscreen/edt-ft5x06.c @@ -1050,6 +1050,7 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client, { const struct edt_i2c_chip_data *chip_data; struct edt_ft5x06_ts_data *tsdata; + u8 buf[2] = { 0xfc, 0x00 }; struct input_dev *input; unsigned long irq_flags; int error; @@ -1140,6 +1141,12 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client, return error; } + /* + * Dummy read access. EP0700MLP1 returns bogus data on the first + * register read access and ignores writes. + */ + edt_ft5x06_ts_readwrite(tsdata->client, 2, buf, 2, buf); + edt_ft5x06_ts_set_regs(tsdata); edt_ft5x06_ts_get_defaults(&client->dev, tsdata); edt_ft5x06_ts_get_parameters(tsdata); -- 2.20.1