Received: by 10.223.185.116 with SMTP id b49csp7150867wrg; Thu, 1 Mar 2018 00:15:10 -0800 (PST) X-Google-Smtp-Source: AG47ELvl1gH86ep60htApQ+AOaunsWN5v+2lMdjaK+XUQuyk95XMxxqPHnJWowzOF8hycgYwADKJ X-Received: by 10.98.69.76 with SMTP id s73mr1096903pfa.31.1519892110707; Thu, 01 Mar 2018 00:15:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519892110; cv=none; d=google.com; s=arc-20160816; b=wuqpsF0SqoSB0nlwrFbHPjbEUlOA+Hy03ubiY3FnbR+s6CDJoDtLRcrhkszry63ou/ uwv14GwByzCxUuRePVF6sRdjK0ytaMbu7nzKKdC6UyAQR5UNyBQi2VAeLiXiY+k35ezA u856NNeD4k7b59LU+PfCPNqF2+yOSu4d9NUWgg5rV6hWE4eCRfltrvrE4FXQGHA38ZWr YJhrwj0jTEEeHKbypkM3uiq+HM7d2vNe4OgDOtZsO49bzguBBpXqvn+JvmZuG/OxbnM7 KfEsZTf+/ekdQoAmHVzo/qS/gEMa33iEYcSZsGrai5yaSygG/xQOYC5xKsXR6t7N/8Sa wjjg== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date:arc-authentication-results; bh=jReZpsGX02auFiT8TvO3fCo1yPSfusEJzX2hZQXUxx0=; b=oAyhGa3f4iHB6tO5fT8TtRBG8r3PBD43l1o/HiWpQWtQ2qRfRRwUjXxA7dby3S9Pe9 cHmw9vvS4vgg3Oj+9CE3W3ontAdboYm7VZ/gElE/OoCeiP15NDFDHkN9kuufM6MsHYTV 4fWc31zAMuu3HCJDariBr2lzNbjOAdM/tI2lAiIqKdXbd9hTM3lZ6Eg69yS9Ni5nrvcz QEIkvu2bD5Y2E3wH3X4rnRkBAVIFyhDbNnHS0LgBxs4l3rs45VwWL/gf+RvazxCykVJz WTlLbOeJ4YeE9TNEGR6BK7wIKpP6gqVJETwRltld1/8zhlOvbE6HOxKHQWfGVWRekYhf p65g== 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 j66si2620587pfj.181.2018.03.01.00.14.55; Thu, 01 Mar 2018 00:15:10 -0800 (PST) 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 S935820AbeCAINv convert rfc822-to-8bit (ORCPT + 99 others); Thu, 1 Mar 2018 03:13:51 -0500 Received: from mail.bootlin.com ([62.4.15.54]:60747 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935665AbeCAINt (ORCPT ); Thu, 1 Mar 2018 03:13:49 -0500 Received: by mail.bootlin.com (Postfix, from userid 110) id BFFDC20715; Thu, 1 Mar 2018 09:13:46 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from dell-desktop.home (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.bootlin.com (Postfix) with ESMTPSA id 56490203A0; Thu, 1 Mar 2018 09:13:46 +0100 (CET) Date: Thu, 1 Mar 2018 09:13:47 +0100 From: =?UTF-8?B?TXlsw6huZQ==?= Josserand To: Fabio Estevam Cc: Liam Girdwood , Mark Brown , Rob Herring , Mark Rutland , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , linux-kernel , alexandre.belloni@bootlin.com, Thomas Petazzoni Subject: Re: [PATCH v1 3/4] ASoC: codecs: pcm179x: Add reset gpio Message-ID: <20180301091347.6575e621@dell-desktop.home> In-Reply-To: References: <20180227212433.2189-1-mylene.josserand@bootlin.com> <20180227212433.2189-4-mylene.josserand@bootlin.com> Organization: Bootlin X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) 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 Hello Fabio, Thank you for the review! On Tue, 27 Feb 2018 19:30:11 -0300 Fabio Estevam wrote: > On Tue, Feb 27, 2018 at 6:24 PM, Mylène Josserand > wrote: > > > + pcm179x->reset = of_get_named_gpio(np, "reset-gpios", 0); > > + if (gpio_is_valid(pcm179x->reset)) { > > + ret = devm_gpio_request_one(dev, pcm179x->reset, > > + GPIOF_OUT_INIT_LOW, > > + "pcm179x reset"); > > + if (ret) { > > + dev_err(dev, > > + "Failed to request GPIO %d as reset pin, error %d\n", > > + pcm179x->reset, ret); > > + return ret; > > + } > > + > > + gpio_set_value(pcm179x->reset, 1); > > It would be better to use the gpiod API, which takes the GPIO polarity > into account. > > There may be systems that have an inverter connected to this pin, and > this can be changed in dts via GPIO_ACTIVE_HIGH. Oh, true, I should have used gpiod. Thanks for pointing me out. > > Also, as the reset pin can be connected to an I2C expander, for > example, so it is safer to use the cansleep variant: > > gpiod_set_value_cansleep(pcm179x->reset, 0); Sure, I will update it. Thanks, Mylène -- Mylène Josserand, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering http://bootlin.com