From patchwork Tue Nov 11 08:34:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vignesh Raghavendra X-Patchwork-Id: 5271601 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D696B9F2F1 for ; Tue, 11 Nov 2014 08:39:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 052442010E for ; Tue, 11 Nov 2014 08:39:25 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 18E1220103 for ; Tue, 11 Nov 2014 08:39:24 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xo6xD-0002va-Cr; Tue, 11 Nov 2014 08:37:35 +0000 Received: from comal.ext.ti.com ([198.47.26.152]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xo6wU-0002Ve-51 for linux-arm-kernel@lists.infradead.org; Tue, 11 Nov 2014 08:36:51 +0000 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id sAB8a512021744; Tue, 11 Nov 2014 02:36:05 -0600 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id sAB8a2aA022719; Tue, 11 Nov 2014 02:36:04 -0600 Received: from dlep32.itg.ti.com (157.170.170.100) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.174.1; Tue, 11 Nov 2014 02:36:02 -0600 Received: from uda0132425.apr.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id sAB8ZDe6024824; Tue, 11 Nov 2014 02:35:55 -0600 From: Vignesh R To: Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Benoit Cousson , Tony Lindgren , Russell King , Jonathan Cameron , Hartmut Knaack , , Dmitry Torokhov , Lee Jones , Sebastian Andrzej Siewior Subject: [PATCH v3 5/6] input: touchscreen: ti_am335x_tsc: Use charge delay DT parameter Date: Tue, 11 Nov 2014 14:04:03 +0530 Message-ID: <1415694844-11230-6-git-send-email-vigneshr@ti.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1415694844-11230-1-git-send-email-vigneshr@ti.com> References: <1415694844-11230-1-git-send-email-vigneshr@ti.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141111_003650_570831_B4E4FE0B X-CRM114-Status: GOOD ( 11.39 ) X-Spam-Score: -5.6 (-----) Cc: devicetree@vger.kernel.org, linux-iio@vger.kernel.org, Lars-Peter Clausen , Brad Griffis , Jan Kardell , Vignesh R , linux-kernel@vger.kernel.org, Felipe Balbi , Paul Gortmaker , Peter Meerwald , linux-input@vger.kernel.org, Sanjeev Sharma , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Samuel Ortiz X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, 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 This patch reads charge delay from tsc DT node and writes to REG_CHARGEDELAY register. If the charge delay is not specified in DT then default value of 0xB000(CHARGEDLY_OPENDLY) is used. Signed-off-by: Vignesh R --- drivers/input/touchscreen/ti_am335x_tsc.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/input/touchscreen/ti_am335x_tsc.c b/drivers/input/touchscreen/ti_am335x_tsc.c index 483fd97c0e0c..20ce76b1b6e7 100644 --- a/drivers/input/touchscreen/ti_am335x_tsc.c +++ b/drivers/input/touchscreen/ti_am335x_tsc.c @@ -52,6 +52,7 @@ struct titsc { u32 bit_xp, bit_xn, bit_yp, bit_yn; u32 inp_xp, inp_xn, inp_yp, inp_yn; u32 step_mask; + u32 charge_delay; }; static unsigned int titsc_readl(struct titsc *ts, unsigned int reg) @@ -177,7 +178,7 @@ static void titsc_step_config(struct titsc *ts_dev) config = titsc_readl(ts_dev, REG_IDLECONFIG); titsc_writel(ts_dev, REG_CHARGECONFIG, config); - titsc_writel(ts_dev, REG_CHARGEDELAY, CHARGEDLY_OPENDLY); + titsc_writel(ts_dev, REG_CHARGEDELAY, ts_dev->charge_delay); /* coordinate_readouts + 1 ... coordinate_readouts + 2 is for Z */ config = STEPCONFIG_MODE_HWSYNC | @@ -361,6 +362,11 @@ static int titsc_parse_dt(struct platform_device *pdev, if (err < 0) return err; + err = of_property_read_u32(node, "ti,charge-delay", + &ts_dev->charge_delay); + if (err < 0) + ts_dev->charge_delay = CHARGEDLY_OPENDLY; + return of_property_read_u32_array(node, "ti,wire-config", ts_dev->config_inp, ARRAY_SIZE(ts_dev->config_inp)); }