Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp1207305ybf; Thu, 27 Feb 2020 06:49:27 -0800 (PST) X-Google-Smtp-Source: APXvYqzsRputT8SbBgRa0hN+ZvnzVPpmsReWj9r8cRFLCbPf6B4u4Y4pL95AB4qc1t/p6JNdytLM X-Received: by 2002:a9d:784b:: with SMTP id c11mr3489568otm.246.1582814967406; Thu, 27 Feb 2020 06:49:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582814967; cv=none; d=google.com; s=arc-20160816; b=G/00qgX17jXqredTHFkp60kPuuMqqMzEdx8U3rEnjYMLR0xY2u/fnlRtnaQbkz4TF2 uqxiLdPqq5nWHwuYMcvonHcz0hEBCuju5cRPNTvel45CEnFlIiZkxBLtswQ3YmmGlF9Q 7MZWeBmo/ufDdrv7m3yqWBWkyIFXhwC0bQDn0WHoyU9zfFcCiBs/HxEqVCYhrPL77HKz ltPR+Rwt9Q8sDIeYzpW1Y1EOxW/26g7N5PXckbwNCQsU/cZv6M2DeURMP5OFN8KwHTNQ oQ1mTkq3RKgF6cAiBBfJeMEd86tAjfy8za5oSSnJaRPlkiy5F5OkaxPbzvAy6OAYTIsa 5zNw== 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=SfY7r92/dACLHflYO3ErkelmVNqn89JszlNbbq+kZi0=; b=mZoPMqtlWBTuNb4YWwBt0tqtarfRMbTeWY7cYmn1UsJ46Lr+N8CTH0nHnTBEDk1eUB bQPZtikFwdZzXiy2StDJkDvadMBbGwUSOn8NqTpNmsCc4VddLnQWSFWFLiEGeIHbHs9A CprOX2R1J0mVZHI3Ww3WYGMrnJnI1Hz3AoblD8s1BHw9XEU4N4CY6R6n2WZux1YArb21 0VAe/oaxcML2T6wZRjt5VPVVuqXQJyBTMGvnonY3eYEy6j8jyH8VDnFh2RMarFGzuikr wv6AHwnzjquX89/JU1N2vyd4aq/S9Dk4foVouO1UtI/kNehBez5x3yBtSwjBLGbD+Qvb PNkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lWlvm7bK; 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 o25si1933324otk.28.2020.02.27.06.49.15; Thu, 27 Feb 2020 06:49:27 -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=lWlvm7bK; 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 S1731261AbgB0Osm (ORCPT + 99 others); Thu, 27 Feb 2020 09:48:42 -0500 Received: from mail.kernel.org ([198.145.29.99]:37706 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729413AbgB0Nmj (ORCPT ); Thu, 27 Feb 2020 08:42:39 -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 F0B0D20578; Thu, 27 Feb 2020 13:42:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582810958; bh=T1ZKD43Hoi0VlEAm4qsLbLuTAyNG1fwLV0FTSp5WMTQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lWlvm7bK6+joRGuTwyG651Dlh5bEaoqMC5xgm509cDfkBjgJeQLcwLEwYKOSduIg4 SoMYuczvXYVDf1wNW8Qc4tjo21WqkQHkLHccffgkBP6v2YFufMoH4L3bKRmedpcxeL KRHcPTgCyew6HULquNqzObjAJEHTWfXWGPVa8I54= 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 4.4 055/113] Input: edt-ft5x06 - work around first register access error Date: Thu, 27 Feb 2020 14:36:11 +0100 Message-Id: <20200227132220.559320477@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200227132211.791484803@linuxfoundation.org> References: <20200227132211.791484803@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 0b0f8c17f3f7e..a9d97d577a7e9 100644 --- a/drivers/input/touchscreen/edt-ft5x06.c +++ b/drivers/input/touchscreen/edt-ft5x06.c @@ -880,6 +880,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; @@ -949,6 +950,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