From patchwork Wed Oct 7 12:21:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Franklin Cooper X-Patchwork-Id: 7344841 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 AA93C9F302 for ; Wed, 7 Oct 2015 12:24:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C586E2072B for ; Wed, 7 Oct 2015 12:24:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D5A48205CB for ; Wed, 7 Oct 2015 12:24:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752941AbbJGMWM (ORCPT ); Wed, 7 Oct 2015 08:22:12 -0400 Received: from mail-ob0-f196.google.com ([209.85.214.196]:33955 "EHLO mail-ob0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751357AbbJGMWL (ORCPT ); Wed, 7 Oct 2015 08:22:11 -0400 Received: by obcgx8 with SMTP id gx8so1145101obc.1; Wed, 07 Oct 2015 05:22:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=from:to:subject:date:message-id:in-reply-to:references; bh=DDCszidakK0G7gK0bTNJYCPjI+LEAyT0HDQeIYXIhxo=; b=UI9z7C+nCNIpfEM7Q+leOkcYPb7oy/HeKLjCRNz1Cs606g4EJ5MF5r+BPwB9Jrh8U3 YLby7TSw6Km90jGSwx7kJ+zBe9aWWJI3GQvkyPvjOCfziXRmQ06PdTcwb7u0bmkautx1 1gVdB6xn71x9wDz62RjErYUIbjJs2ZGeBFR0EUDE5bRSUGXCnOY8HXMPZRq/WSa73+c8 v1EqWdkOARybGfLUoeXh/BsFc0Skz3ap0f/ZZ7xHP9FAD8ZPkbRdSROfVsy6+mCPsPQ7 1dFIWlDBoiKh6u30SFM78iyt3lYv0irOCEphEwdx9CZg7gy5b/LBdUleNGuMa1+speK0 5m/w== X-Received: by 10.182.44.161 with SMTP id f1mr395226obm.57.1444220530970; Wed, 07 Oct 2015 05:22:10 -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 k5sm16407235oev.16.2015.10.07.05.22.10 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 07 Oct 2015 05:22:10 -0700 (PDT) From: fcooper@ti.com To: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, fcooper@ti.com, maxime.ripard@free-electrons.com, LW@KARO-electronics.de, jg1.han@samsung.com, asaf.vertz@tandemg.com Subject: [RFC 1/4] Input: edt-ft5x06 - Use max support points to determine how much to read Date: Wed, 7 Oct 2015 07:21:38 -0500 Message-Id: <1444220501-23623-2-git-send-email-fcooper@ti.com> X-Mailer: git-send-email 2.6.1 In-Reply-To: <1444220501-23623-1-git-send-email-fcooper@ti.com> References: <1444220501-23623-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=ham 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 From: Franklin S Cooper Jr Calculate the amount of data that needs to be read for the specified max number of support points. If the maximum number of support points changes then the amount that is read from the touch screen controller should reflect this. Signed-off-by: Franklin S Cooper Jr --- drivers/input/touchscreen/edt-ft5x06.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c index 7239c31..1e0ed6e 100644 --- a/drivers/input/touchscreen/edt-ft5x06.c +++ b/drivers/input/touchscreen/edt-ft5x06.c @@ -178,14 +178,16 @@ static irqreturn_t edt_ft5x06_ts_isr(int irq, void *dev_id) cmd = 0xf9; /* tell the controller to send touch data */ offset = 5; /* where the actual touch data starts */ tplen = 4; /* data comes in so called frames */ - datalen = 26; /* how much bytes to listen for */ + + /* how many bytes to listen for */ + datalen = tplen * MAX_SUPPORT_POINTS + offset + 1; break; case M09: cmd = 0x02; offset = 1; tplen = 6; - datalen = 29; + datalen = tplen * MAX_SUPPORT_POINTS - cmd + 1; break; default: