Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp656939ybk; Wed, 20 May 2020 08:44:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8/mdmDvxsTv+39FYVex2y3Uqv/3dGBi5+SJjwz2OOcuMPLU0YTtqGC/ERYoUQzEgT/wS+ X-Received: by 2002:a17:906:7d90:: with SMTP id v16mr4007168ejo.554.1589989460464; Wed, 20 May 2020 08:44:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589989460; cv=none; d=google.com; s=arc-20160816; b=eohvtHQ8smULoVYQMOXRUXcFU2RgDW/RDZ8LAgtcL5qEEE5Xa/MKKbJO+2pQyaUVGE P0OSPKOsw033uTbv495M9qcK/dc5PJESTaLqKLXJ1HIMw8cIb1iamkOzhEZ5BppQE/wK ZxBju9xdXNdeo6b2c7sM6XJtaxeLnDGqQrqJCRd/rX6uBDKuwaX14zDzy2umlS10CjSo rPEOyF9YJfCTAIcN5+nXmlDjknXsgYNpYbCRk4nCoFxbg6XW69+Bj1RCa75wYx9LItEy v2+sWg2J1ayZ/kxBbjYQxPMzIsOmakWk+fsj+dz90kq+KyM/hTEjGBupQJR5GtehhI0F dg9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=ZaC0n98vlhM774t0ZtQS0xp7oomFt9FRuFM7+TZ7ZWk=; b=Q1FQJUV2+JbontFfoiz3xpYopJJye+yfNqrxd+G/tewb2YsEyz04OiQp6L1bvIq931 G9kivktdLORkFoe97VLyMs5IFbT9vcfj9l8Ch6hXIPbo62yb+gIPBt+j+ig2OdR9KNxl vTv576lXLjRP7BHlhg7dtADw5dd0d+a+Gtlv6FTG68ubmXjK97MRRWNwWvS60l6tIG07 nvgvbC9Ylbnpx+s9YBe+Fxzdb9Hy6SrHyT5ZUINVASIJhKZJUcxlX+BHTbRPCtPJ8gux DWM3ii/XRixzf6uhKS95udNPUw4bptYqj0qWdgjomtRe5UgX/nRPHhqbi0hgoioSMx93 a9cg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g7si1938647ejc.469.2020.05.20.08.43.57; Wed, 20 May 2020 08:44:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727056AbgETPj7 (ORCPT + 99 others); Wed, 20 May 2020 11:39:59 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:38850 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726845AbgETPjv (ORCPT ); Wed, 20 May 2020 11:39:51 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: sre) with ESMTPSA id 856132A0313 Received: by jupiter.universe (Postfix, from userid 1000) id 6DD05480103; Wed, 20 May 2020 17:39:45 +0200 (CEST) From: Sebastian Reichel To: Dmitry Torokhov , Ahmet Inan , Martin Fuzzey Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@collabora.com, Sebastian Reichel Subject: [PATCHv3 5/5] Input: EXC3000: Add reset gpio support Date: Wed, 20 May 2020 17:39:36 +0200 Message-Id: <20200520153936.46869-6-sebastian.reichel@collabora.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200520153936.46869-1-sebastian.reichel@collabora.com> References: <20200520153936.46869-1-sebastian.reichel@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add basic support for an optional reset gpio. Signed-off-by: Sebastian Reichel --- .../input/touchscreen/eeti,exc3000.yaml | 2 ++ drivers/input/touchscreen/exc3000.c | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/Documentation/devicetree/bindings/input/touchscreen/eeti,exc3000.yaml b/Documentation/devicetree/bindings/input/touchscreen/eeti,exc3000.yaml index 7e6e23f8fa00..007adbc89c14 100644 --- a/Documentation/devicetree/bindings/input/touchscreen/eeti,exc3000.yaml +++ b/Documentation/devicetree/bindings/input/touchscreen/eeti,exc3000.yaml @@ -22,6 +22,8 @@ properties: const: 0x2a interrupts: maxItems: 1 + reset-gpios: + maxItems: 1 touchscreen-size-x: true touchscreen-size-y: true touchscreen-inverted-x: true diff --git a/drivers/input/touchscreen/exc3000.c b/drivers/input/touchscreen/exc3000.c index b5a3bbb63504..de9d0ae1210a 100644 --- a/drivers/input/touchscreen/exc3000.c +++ b/drivers/input/touchscreen/exc3000.c @@ -8,7 +8,9 @@ */ #include +#include #include +#include #include #include #include @@ -33,6 +35,9 @@ #define EXC3000_TIMEOUT_MS 100 +#define EXC3000_RESET_MS 10 +#define EXC3000_READY_MS 100 + static const struct i2c_device_id exc3000_id[]; struct eeti_dev_info { @@ -66,6 +71,7 @@ struct exc3000_data { const struct eeti_dev_info *info; struct input_dev *input; struct touchscreen_properties prop; + struct gpio_desc *reset; struct timer_list timer; u8 buf[2 * EXC3000_LEN_FRAME]; struct completion wait_event; @@ -325,6 +331,17 @@ static int exc3000_probe(struct i2c_client *client) init_completion(&data->wait_event); mutex_init(&data->query_lock); + data->reset = devm_gpiod_get_optional(&client->dev, "reset", + GPIOD_OUT_HIGH); + if (IS_ERR(data->reset)) + return PTR_ERR(data->reset); + + if (data->reset) { + msleep(EXC3000_RESET_MS); + gpiod_set_value_cansleep(data->reset, 0); + msleep(EXC3000_READY_MS); + } + input = devm_input_allocate_device(&client->dev); if (!input) return -ENOMEM; -- 2.26.2