Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1931353ybv; Fri, 14 Feb 2020 08:25:58 -0800 (PST) X-Google-Smtp-Source: APXvYqyZ2tXrpAgDWACy8iFNNBO85t4ygUSfZKTSa7uRLdiiDlq3niFgXCT8ehF53JXduxE/a10a X-Received: by 2002:aca:1c0d:: with SMTP id c13mr2356716oic.44.1581697558416; Fri, 14 Feb 2020 08:25:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581697558; cv=none; d=google.com; s=arc-20160816; b=ue8p7hyuPkyTQku7Y4V4SWptY+KKrvPk86RSOSEV1rKPhkVRXblfgGqf1w3tOYy19e BIJYLaWqkvh6+b83ZarNoZkmXBGGO3rZmRy0VV4uCJ5+NkCt67R7p7ohgYyr4FlrUcPt Q8JCRgBqt+xNZ5/Z4I+JHbE2sSzj4trC0omI3aXGFGhnZ1b0WjUYADnruE1DqUtcs8jl IXVque2U1u/f30P4b0RLGGU+FivcFBlMyBwHPYgFEc/89vC6zxCrhMAg16xDOvoHEvBi 4nLj+Rf6JLppoUTw1Y5IjUoeg8VfCO6Yv/vD0PLyOBdPnFVoyrnfQqjioHkzXOU3Nr5C 0S9w== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=GqxhlMeCmPWy+2Zslz3N84n7taed+tXjH0zbD19VixY=; b=vHWhfcEW8RGo5X4wtZpl18zfUapKnXZdadwrXvEN7ieqF5MWxZDNg3CARQtVQfZMZN gJrIlSdvhh0npaPKE/GB/hHdteni5MPRTae0mic8A60EroCKeGY3ChiJ6tpC48wfj9+J ceGqGKvBFcMeb2yeO5F5vKlPhsx4Vy3e84lRLPJlcUpbW87hUeUMm9HjqgbOMcxaeaAa WGi4F2jgHBHNmkPsbVprRBQAJj2FWTPlZHsH3+8v/jV0gu1E0jFzFhKt+Jtr1joXPRQo XaL2A5hEZb+3PM+yw3BSmXrM3iDCYz4E1BjF32psiJwkQTLhD5EkKzF9t2wMvbcColtN KGcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="1Tg/SenF"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s64si2898143oig.147.2020.02.14.08.25.46; Fri, 14 Feb 2020 08:25:58 -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="1Tg/SenF"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405673AbgBNQZR (ORCPT + 99 others); Fri, 14 Feb 2020 11:25:17 -0500 Received: from mail.kernel.org ([198.145.29.99]:59340 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405563AbgBNQXO (ORCPT ); Fri, 14 Feb 2020 11:23:14 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 28B4E24772; Fri, 14 Feb 2020 16:23:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581697394; bh=xTfDbkr37bVX7WPtntC0qxawFpQYpjYWedgmtw+jqao=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1Tg/SenFZQ5u6GeUiczqSc9HKSwyLrnct6FMqy5jEWNgvhfwSv7K+YvVnfyEbhZUr +B7lay2uzK2luMUsDg5uFExc+UJ6G4ujiGjR8pzMwx4oxu+c1C61U902b7zasFiBEK jlqOzKol0g2kWKFI6/plTXfjNqnxn7g1kQVN2cDg= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Philipp Zabel , Marco Felsch , Andy Shevchenko , Dmitry Torokhov , Sasha Levin , linux-input@vger.kernel.org Subject: [PATCH AUTOSEL 4.9 088/141] Input: edt-ft5x06 - work around first register access error Date: Fri, 14 Feb 2020 11:20:28 -0500 Message-Id: <20200214162122.19794-88-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200214162122.19794-1-sashal@kernel.org> References: <20200214162122.19794-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore 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 28466e358fee1..22c8d2070faac 100644 --- a/drivers/input/touchscreen/edt-ft5x06.c +++ b/drivers/input/touchscreen/edt-ft5x06.c @@ -887,6 +887,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; @@ -956,6 +957,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