From patchwork Fri Oct 16 14:14:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Franklin Cooper X-Patchwork-Id: 7415761 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 521069F36A for ; Fri, 16 Oct 2015 14:16:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7FA8B20619 for ; Fri, 16 Oct 2015 14:16:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A11C82060B for ; Fri, 16 Oct 2015 14:16:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752426AbbJPOOt (ORCPT ); Fri, 16 Oct 2015 10:14:49 -0400 Received: from mail-oi0-f51.google.com ([209.85.218.51]:35612 "EHLO mail-oi0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932084AbbJPOOe (ORCPT ); Fri, 16 Oct 2015 10:14:34 -0400 Received: by oiev17 with SMTP id v17so17217575oie.2; Fri, 16 Oct 2015 07:14:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=h6mSs6n+PdvVQ7wk/suk+ZY8hnkx1eYzMpXZwJem9Jc=; b=GnbBOXEL19YyrHa9qKG35GqZkqMPB9+qiSUDNCodXhUiTbHuLhLB1Em+DKabEAuPg3 zjbEAhDAIqqS/BL8lqINapLeOYLN+AcySXfK3JuRy1i3c4jqKlhddrqJvO+QvqmazSXL GzgdDTzTOGMB8AWcHzzXZTwy0+mgRH+w2FSWLhNPyfi6sSZON4itt4l35AYD9W8XPO7U Tf55M2RWZySZAwe+7zJ4SHet+DA+OTeD/W1zAAexneSnqHgo5aUvx10i0aTe+XQ1tsR8 Hiyn/wCGGtAgnFs7gPCa01lHl9LS8IRJZIcmJUEHH8dYa3E9H95AMz7D6/LXFj7qtf8I 4+rQ== X-Received: by 10.202.205.195 with SMTP id d186mr9422560oig.1.1445004874232; Fri, 16 Oct 2015 07:14:34 -0700 (PDT) Received: from localhost.localdomain (pool-71-97-41-79.dllstx.fios.verizon.net. [71.97.41.79]) by smtp.gmail.com with ESMTPSA id p3sm8457074oei.9.2015.10.16.07.14.33 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 16 Oct 2015 07:14:33 -0700 (PDT) From: Franklin S Cooper Jr To: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, maxime.ripard@free-electrons.com, LW@KARO-electronics.de, jg1.han@samsung.com, asaf.vertz@tandemg.com Cc: Franklin S Cooper Jr Subject: [PATCH 4/4] Input: edt-ft5x06 - Work around FT5506 firmware bug Date: Fri, 16 Oct 2015 09:14:29 -0500 Message-Id: <1445004869-31986-5-git-send-email-fcooper@ti.com> X-Mailer: git-send-email 2.6.1 In-Reply-To: <1445004869-31986-1-git-send-email-fcooper@ti.com> References: <1445004869-31986-1-git-send-email-fcooper@ti.com> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In the touchscreen controller ISR, reading the tsc starting from register 0x2 causes the tsc to infrequently update the detected finger's x and y coordinate. The irq pin toggles at a fast rate to indicate touch events are happening. However, the tsc on average updates the touch point's x and y value every ~100 ms which is much slower than the advertised rate of 100+ Hz. This leads to multiple reads within this ~100 ms time window returning the same value. Example: X: 10 , Y: 30 X: 10 , Y: 30 X: 10, Y: 30 .. // After 100 ms X: 300, Y: 300 X: 300, y: 300 .. // After 100 ms X: 1743, Y: 621 X: 1743, Y: 621 For some reason if instead of starting to read at register 0x2 you start reading at register 0x0 this issue isn't seen. This seems like a quirk only seen in the EDT FT5506 so to fix this issue simply adjust the code to start reading from 0x0. Technically this isn't wrong so no regressions should be seen with other touchscreen controllers supported by this driver. Signed-off-by: Franklin S Cooper Jr --- Changes since RFC: Increase rdbuf to accomodate extra 2 bytes being read. drivers/input/touchscreen/edt-ft5x06.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c index e095838..a8d48e0 100644 --- a/drivers/input/touchscreen/edt-ft5x06.c +++ b/drivers/input/touchscreen/edt-ft5x06.c @@ -172,7 +172,7 @@ static irqreturn_t edt_ft5x06_ts_isr(int irq, void *dev_id) struct edt_ft5x06_ts_data *tsdata = dev_id; struct device *dev = &tsdata->client->dev; u8 cmd; - u8 rdbuf[61]; + u8 rdbuf[63]; int i, type, x, y, id; int offset, tplen, datalen, crclen; int error; @@ -189,8 +189,8 @@ static irqreturn_t edt_ft5x06_ts_isr(int irq, void *dev_id) break; case M09: - cmd = 0x02; - offset = 1; + cmd = 0x0; + offset = 3; tplen = 6; crclen = 0; datalen = tplen * tsdata->max_support_points + offset + crclen;