From patchwork Thu Jan 21 22:21:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oreste Salerno X-Patchwork-Id: 8085231 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E8F64BEEE5 for ; Thu, 21 Jan 2016 22:22:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8B56920373 for ; Thu, 21 Jan 2016 22:22:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B25BD20453 for ; Thu, 21 Jan 2016 22:22:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751016AbcAUWWE (ORCPT ); Thu, 21 Jan 2016 17:22:04 -0500 Received: from mail3.tomtom.com ([85.90.76.132]:7420 "EHLO mail3.tomtom.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751149AbcAUWVo (ORCPT ); Thu, 21 Jan 2016 17:21:44 -0500 Received: from NLSRVWP-EXC01.ttg.global (10.96.72.11) by nlsrvwp-tmg01.ttg.global (10.96.64.21) with Microsoft SMTP Server (TLS) id 14.3.169.1; Thu, 21 Jan 2016 23:22:24 +0100 Received: from NLSRVWP-EXN11.ttg.global (10.98.64.12) by NLSRVWP-EXC01.ttg.global (10.96.72.11) with Microsoft SMTP Server (TLS) id 14.3.235.1; Thu, 21 Jan 2016 23:21:38 +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 23:21:37 +0100 From: Oreste Salerno To: CC: , , , , , , , , , Subject: [PATCH v5 4/4] Input: cyttsp - perform hard reset of the chip during probe Date: Thu, 21 Jan 2016 23:21:32 +0100 Message-ID: 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-EXN08.ttg.global (10.98.64.9) 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 | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/input/touchscreen/cyttsp_core.c b/drivers/input/touchscreen/cyttsp_core.c index d91668d..0fd0956 100644 --- a/drivers/input/touchscreen/cyttsp_core.c +++ b/drivers/input/touchscreen/cyttsp_core.c @@ -240,6 +240,16 @@ static int cyttsp_set_sysinfo_regs(struct cyttsp *ts) return retval; } +static void cyttsp_hard_reset(struct cyttsp *ts) +{ + if (ts->reset_gpio) { + 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; @@ -663,6 +673,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);