Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1014500ybi; Fri, 14 Jun 2019 07:12:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqzqWubbvr81r4dYsXt65oyd9XfyQ/Ewv7jZVeuk+3Kx66mYEHyO/XIgg2UC2K/vDv4gTG7B X-Received: by 2002:a17:90a:30aa:: with SMTP id h39mr11487692pjb.32.1560521558647; Fri, 14 Jun 2019 07:12:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560521558; cv=none; d=google.com; s=arc-20160816; b=js7vD0vgORZ0krxKu2rx9QQUyi8I9chWVu6RX1eyhWQ02nSIqiSFlZmRkfnaHxnDxJ tqyAmP8LCrJkmOADMWjMQdbbx2MOwH3ojeC/VhzZVBi2BraQK5GnNOWK2WHT/neRAqpu WgA5RRNkC9xwzrY183g78UkgV75LOdwpxBpiCpMZE/YaELLToyAWgOmnDhLrvRjlbslO hNgk89DJj0T4TkOPApdkN5LU0pcTe7nc408vB4yI6zetGG1c8a+DYNLm8E8AkdbyC2Oy a745CP7ei48K6RJC6of0fohwH1gaxR+s9Q2PS1EMBEddRhuStXY2uLsBiq7FfjnNsECX 8ELw== 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 :message-id:date:subject:cc:to:from; bh=kKTY71xwgwOx/Hb/7C1S4QUI7w+G9uD+Axb58MobyWY=; b=DBKsZBvV2G1JnoZRRDYdKvJ/pEo4c3ahKuBUftzHWWQgs8YxH6EAAxqS+P5pKdJIq4 yWyD4NESSexVGqcwRdLkPHKhEAO6MZ37Ax4RudPI8D9uqSLCpHqrzMsbtk8thT2FWj0X Jb32c5WGRlYnjI0iQEF7C4ntyxeYqGxNs/15amRgRBtGo3nSH6bgqta+4VHn0MsSJVbp RcY3lEvxv/30PXPbEq305icYzhPdm40UaOdryax/GMA4rPjGsyecWFVTwOo6F/LXk7as AcrV8tERN7eQAWYq6rLkkYNOi1HuAS/mzhtShZTSP7w7sexfhk63Cc60PcexpvfVXutd cMrA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y23si2587031pgj.185.2019.06.14.07.12.21; Fri, 14 Jun 2019 07:12:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728813AbfFNOL3 (ORCPT + 99 others); Fri, 14 Jun 2019 10:11:29 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:38485 "EHLO relay2-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728227AbfFNOL3 (ORCPT ); Fri, 14 Jun 2019 10:11:29 -0400 X-Originating-IP: 90.88.23.150 Received: from dell-desktop.home (aaubervilliers-681-1-81-150.w90-88.abo.wanadoo.fr [90.88.23.150]) (Authenticated sender: mylene.josserand@bootlin.com) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id C3AD04001E; Fri, 14 Jun 2019 14:11:17 +0000 (UTC) From: =?UTF-8?q?Myl=C3=A8ne=20Josserand?= To: gregkh@linuxfoundation.org, robh+dt@kernel.org, mark.rutland@arm.com Cc: linux-serial@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, mylene.josserand@bootlin.com, thomas.petazzoni@bootlin.com Subject: [PATCH v1] tty: serial: max310x: Add optional reset gpio Date: Fri, 14 Jun 2019 16:11:12 +0200 Message-Id: <20190614141112.29962-1-mylene.josserand@bootlin.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add the possibility to use a gpio as reset. Signed-off-by: Mylène Josserand --- Documentation/devicetree/bindings/serial/maxim,max310x.txt | 1 + drivers/tty/serial/max310x.c | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/Documentation/devicetree/bindings/serial/maxim,max310x.txt b/Documentation/devicetree/bindings/serial/maxim,max310x.txt index 79e10a05a96a..1d7d8a0b4260 100644 --- a/Documentation/devicetree/bindings/serial/maxim,max310x.txt +++ b/Documentation/devicetree/bindings/serial/maxim,max310x.txt @@ -15,6 +15,7 @@ Required properties: "osc" if an external clock source is used. Optional properties: +- reset-gpios: Gpio to use for reset. - gpio-controller: Marks the device node as a GPIO controller. - #gpio-cells: Should be two. The first cell is the GPIO number and the second cell is used to specify the GPIO polarity: diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c index e5aebbf5f302..d056fa2eed1b 100644 --- a/drivers/tty/serial/max310x.c +++ b/drivers/tty/serial/max310x.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -1413,12 +1414,18 @@ static int max310x_spi_probe(struct spi_device *spi) return ret; if (spi->dev.of_node) { + struct gpio_desc *reset_gpio; const struct of_device_id *of_id = of_match_device(max310x_dt_ids, &spi->dev); if (!of_id) return -ENODEV; devtype = (struct max310x_devtype *)of_id->data; + reset_gpio = devm_gpiod_get_optional(&spi->dev, "reset", + GPIOD_OUT_HIGH); + if (IS_ERR(reset_gpio)) + return PTR_ERR(reset_gpio); + gpiod_set_value_cansleep(reset_gpio, 0); } else { const struct spi_device_id *id_entry = spi_get_device_id(spi); -- 2.11.0