Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3442745ybi; Tue, 2 Jul 2019 07:53:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqwZhzr/qKSiXWn/pCIF9tO5QBpwgDRnCCHPqECg26aoZVJnhasoY+4KxXVyHlAtTiLeqXZ7 X-Received: by 2002:a17:902:44a4:: with SMTP id l33mr35619860pld.174.1562079184541; Tue, 02 Jul 2019 07:53:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562079184; cv=none; d=google.com; s=arc-20160816; b=ZDbw+rWlTXd2+aPjaHVKocF9y6wENP2nC1P3RYtfICoQTw+QlbhVkeWs5AQzCDxQQp 51LVwItM9BH4LqA0RHCQ5Uvr/zxmCUZ0CA34Ku38lukuydxALJ09HG5BlHZbOEjpxlY3 DlH9gcvB/TN211Duh5zVjMAlfRFN9FSxbY/5EhwGuBCJn08xt8UtYrICErcHrMLrzS5h YaLR3X3IqV8neioRIw9HTajSHtlM15SGikljWjyYfuQIXWoCDK3krJcftImuoEMA3OpL HxMMTd0RLRKAagu5ovE9N3imQGoTbjwtbwoOoUGkzZWhviVWTezBQQtW/T5PLPyY5u1M S0vQ== 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:user-agent :organization:references:in-reply-to:message-id:mime-version:date :subject:cc:to:from:dkim-signature; bh=qW1FNQVp0z6X5XtOPtt+yydz6FyGhgdAlTaFXUsn36I=; b=eT6AR2rClHBxc0WWrBAc8CwBe/AGa82Bspeo5x6QbCVt4Fy2F51gSnsiDhhv/uOPGn AapjgMReHyUb49jS0R8bBb/P603Po62rAfS3WQEKvZx/ew5taqe3TvYNkt6OQzj7LXId QvpfkkHXTE+eXTLWHLINoi3TnaKxeqtiXVuTvIZ6mR6fLixIIOvwCnQ0lEWgd8ZRKraP yMJSQG1rhtsuFP8vMBLofQ4aDsM9IdrgxycMRoi2tU/C+Dlyw9BmZwZapZWp7jNL5h5n ubW+oJwrWhxGJRhA6k0sFifOp5OF6F89h44bImUJk8782IvMWJjDSNaPwE5EP3SoREEU BBkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cesnet.cz header.s=office2 header.b=hVFwOXXv; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cesnet.cz Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h69si3634708pge.543.2019.07.02.07.52.48; Tue, 02 Jul 2019 07:53:04 -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; dkim=pass header.i=@cesnet.cz header.s=office2 header.b=hVFwOXXv; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cesnet.cz Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726960AbfGBOwK (ORCPT + 99 others); Tue, 2 Jul 2019 10:52:10 -0400 Received: from office2.cesnet.cz ([195.113.144.244]:59328 "EHLO office2.cesnet.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726150AbfGBOwK (ORCPT ); Tue, 2 Jul 2019 10:52:10 -0400 X-Greylist: delayed 462 seconds by postgrey-1.27 at vger.kernel.org; Tue, 02 Jul 2019 10:52:08 EDT Received: from localhost (unknown [IPv6:2001:718:1:2c:b88f:a570:7aec:4192]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by office2.cesnet.cz (Postfix) with ESMTPSA id 29D02400066; Tue, 2 Jul 2019 16:44:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cesnet.cz; s=office2; t=1562078663; bh=qW1FNQVp0z6X5XtOPtt+yydz6FyGhgdAlTaFXUsn36I=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=hVFwOXXv5dSaG5A0OecsMLG4o/9VEBvb1xXmz2XJFiyCjy+FTFTY8PX10MNntWPhw hBb5OHUEQ2cFfcNUwYC5gvhTyf1NC9sxPwUn9A8yAiQR1jEXEPocCALb1Reqgd5akb ZWQs/PjkpPkcDUH9j4lEDuTnSky1x3y4Nf+Y+yvg= From: =?iso-8859-1?Q?Jan_Kundr=E1t?= To: =?iso-8859-1?Q?Myl=E8ne_Josserand?= Cc: , , , , , , Subject: Re: [PATCH v1] tty: serial: max310x: Add optional reset gpio Date: Tue, 02 Jul 2019 16:44:20 +0200 MIME-Version: 1.0 Message-ID: In-Reply-To: <20190614141112.29962-1-mylene.josserand@bootlin.com> References: <20190614141112.29962-1-mylene.josserand@bootlin.com> Organization: CESNET User-Agent: Trojita/v0.7-402-g68ee77c9; Qt/5.13.0; xcb; Linux; Gentoo Base System release 2.4.1 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On p=C3=A1tek 14. =C4=8Dervna 2019 16:11:12 CEST, Myl=C3=A8ne Josserand wrote= : > --- 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. > =20 > Optional properties: > +- reset-gpios: Gpio to use for reset. "GPIO", not "Gpio", for consistency. > =09if (spi->dev.of_node) { > +=09=09struct gpio_desc *reset_gpio; > =09=09const struct of_device_id *of_id =3D > =09=09=09of_match_device(max310x_dt_ids, &spi->dev); > =09=09if (!of_id) > =09=09=09return -ENODEV; > =20 > =09=09devtype =3D (struct max310x_devtype *)of_id->data; > +=09=09reset_gpio =3D devm_gpiod_get_optional(&spi->dev, "reset", > +=09=09=09=09=09=09 GPIOD_OUT_HIGH); > +=09=09if (IS_ERR(reset_gpio)) > +=09=09=09return PTR_ERR(reset_gpio); > +=09=09gpiod_set_value_cansleep(reset_gpio, 0); > =09} else { The RST signal is active-low on the chip, but the code initializes the=20 output to GPIOD_OUT_HIGH. Are you perhaps relying on a DT binding setting=20 an ACTIVE_LOW flag on the reset GPIO lane? This should be documented. Assuming that this polarity inversion works, the code first asserts the=20 reset, then it performs no explicit waiting, and then it clears the RST=20 signal. I checked MAX14830's datasheet, and there's no minimal reset=20 duration, so perhaps this is safe, but it looks a bit odd to me. With kind regards, Jan