From patchwork Thu Jan 21 19:21:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oreste Salerno X-Patchwork-Id: 8084611 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 34CB09F818 for ; Thu, 21 Jan 2016 19:22:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6C14120445 for ; Thu, 21 Jan 2016 19:22:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 92FEE20434 for ; Thu, 21 Jan 2016 19:22:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760107AbcAUTVa (ORCPT ); Thu, 21 Jan 2016 14:21:30 -0500 Received: from mail3.tomtom.com ([85.90.76.132]:32753 "EHLO mail3.tomtom.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760050AbcAUTV1 (ORCPT ); Thu, 21 Jan 2016 14:21:27 -0500 Received: from NLSRVWP-EXC02.ttg.global (10.96.72.12) by nlsrvwp-tmg01.ttg.global (10.96.64.21) with Microsoft SMTP Server (TLS) id 14.3.169.1; Thu, 21 Jan 2016 20:22:09 +0100 Received: from NLSRVWP-EXN11.ttg.global (10.98.64.12) by NLSRVWP-EXC02.ttg.global (10.96.72.12) with Microsoft SMTP Server (TLS) id 14.3.235.1; Thu, 21 Jan 2016 20:21:23 +0100 Received: from nl1lxl-107192.tomtomgroup.com (10.98.250.94) by NLSRVWP-EXN11.ttg.global (10.98.64.12) with Microsoft SMTP Server (TLS) id 15.0.1076.9; Thu, 21 Jan 2016 20:21:22 +0100 From: Oreste Salerno To: CC: , , , , , , , , , Subject: [PATCH v4 4/4] Input: cyttsp - perform hard reset of the chip during probe Date: Thu, 21 Jan 2016 20:21:16 +0100 Message-ID: <016c9826d32dfdac5ef660cb755b0bcb9a173d59.1453403916.git.oreste.salerno@tomtom.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [10.98.250.94] X-ClientProxiedBy: NLSRVWP-EXN10.ttg.global (10.98.64.11) To NLSRVWP-EXN11.ttg.global (10.98.64.12) 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, 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 Since we removed support for calling an init() callback from the platform data, introduce a function which initializes the chip by performing a hard reset, using the reset gpio defined in the device properties. Signed-off-by: Oreste Salerno --- drivers/input/touchscreen/cyttsp_core.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/input/touchscreen/cyttsp_core.c b/drivers/input/touchscreen/cyttsp_core.c index 92b459d..19499a6 100644 --- a/drivers/input/touchscreen/cyttsp_core.c +++ b/drivers/input/touchscreen/cyttsp_core.c @@ -240,6 +240,14 @@ static int cyttsp_set_sysinfo_regs(struct cyttsp *ts) return retval; } +static void cyttsp_hard_reset(struct cyttsp *ts) +{ + gpiod_set_value_cansleep(ts->reset_gpio, 1); + msleep(CY_DELAY_DFLT); + gpiod_set_value_cansleep(ts->reset_gpio, 0); + msleep(CY_DELAY_DFLT); +} + static int cyttsp_soft_reset(struct cyttsp *ts) { unsigned long timeout; @@ -668,6 +676,8 @@ struct cyttsp *cyttsp_probe(const struct cyttsp_bus_ops *bus_ops, disable_irq(ts->irq); + cyttsp_hard_reset(ts); + error = cyttsp_power_on(ts); if (error) return ERR_PTR(error);