Received: by 10.223.185.116 with SMTP id b49csp5495800wrg; Tue, 27 Feb 2018 14:31:53 -0800 (PST) X-Google-Smtp-Source: AH8x225Y5Pcbt/GnqXy3e9e+jfx/nuVrrsLGZvud8DzKKRWrsae/oylCv+RRY79kbb0nefek+XYd X-Received: by 2002:a17:902:6805:: with SMTP id h5-v6mr15653223plk.46.1519770713808; Tue, 27 Feb 2018 14:31:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519770713; cv=none; d=google.com; s=arc-20160816; b=pj70NsOhYn4gojD8ynKPwFDkMoI1sTo30RKlwf+Ge318zTV2PcEoXVGhy2Tj6SE6S8 8O9GqpcgHnGMQ2elj/NbbrqoXEzEBlglkMdm9/gRxvFm7xLKuAgdE63JuvGHjloQSG0v vH+tY61F/USVaUJ6qxD7EfFTyEet+apJF3uTHtyxsbCBHBpbu9hOCSCY7K5hDF1rP3e8 jPSH/wA9IDWPEnZ6fn5RmsSyNEu15yq43kBLsqsaF4Qi1wilGzLCw3NcKXYG2WvsGHao DHSQFZih4q7SUKOEUNNDBG+l+XYCqx5KKI/4+Z/Rcl64ZKQQQI/ADX7iVat4psxbAGcZ /u0w== 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:cc:to:subject :message-id:date:from:references:in-reply-to:mime-version :dkim-signature:arc-authentication-results; bh=6GO8vEIr+yL7JWHVtlZXo7a028bP1w2DWJQeZa2BeQA=; b=ITIKYP4VgKg6VIZ0nm8SYptOD74czpYlnBpGJQ2SKp3iZmMtvbbYw5AGB3T4Aflt2C 4hh93nNuIEkwI3culujc+hW1FVYkgKeB5yznrWwl6AuW88a9KFQ/jQPL5JTZfkSgaVCL 9He0KCDJ5ESMnAzvq9kO1Z2ZTe1NxCb3qNli9Pi255rwt8qdaENeaKpumWsdLYVbASOy 4LelcEx808KDos5OiMX80auPaTweWoG2c49zbcboYjDuYSy1rjXYHgV7Z6AC8CXBbdxe a0QGxdl+89nflEyakawuVpxvQA3EGbyTs7/IbrshKZR2QfXcHyh9QyaxVERgjgZ9hTUf nx+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RCoYvQiV; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m37-v6si141513pla.244.2018.02.27.14.31.39; Tue, 27 Feb 2018 14:31:53 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RCoYvQiV; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752256AbeB0WaQ (ORCPT + 99 others); Tue, 27 Feb 2018 17:30:16 -0500 Received: from mail-ot0-f172.google.com ([74.125.82.172]:42000 "EHLO mail-ot0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752357AbeB0WaM (ORCPT ); Tue, 27 Feb 2018 17:30:12 -0500 Received: by mail-ot0-f172.google.com with SMTP id l5so425265otf.9; Tue, 27 Feb 2018 14:30:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=6GO8vEIr+yL7JWHVtlZXo7a028bP1w2DWJQeZa2BeQA=; b=RCoYvQiVHv+6CFfA3brqqQU6LprrR9qUfb+SM5/qTq4HG+CI9pq2j/2wG7Jp/BuaaM wQoUhcZpoo61RHqydFvPEoJ1Qd2DEkQ4IQ/xzocu947LPgFxpuEsllW2172CejImWF2V M+/tqC/AkZ8IO6UhKU/xyXL+K4eHDJQut+bYG8vtVcizxStvU/Ao9eJWgb8vM7ybeSYm SRRzfFdTAhp8jLU8U3BQFMaIZeINxilPyzQec49OCryr3mRPEMnqgOSBxp2KPRWuVwdl 2Sr39fjMNsYN8tnHaKHAPrD7wFSof8pcwzgqzjyS45ujCeHGsUBsGuiOy+hzCTbPZEG+ MU7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=6GO8vEIr+yL7JWHVtlZXo7a028bP1w2DWJQeZa2BeQA=; b=YDcyq4R7G12LdHE93EoHYMort6G8DCO3UXBlBIuMTrLUWvnXSHpE1vWwxtFEVoTnEE nMjl9Dwf68X9oeoDTs7G62igUSSycM7ceGdmpNV0PtNiFm5FA3yZxjqPsF1iv4l8hzAr UlFERN/rDTxxzMnVjhWp+bIFzB69DI7lpT1lEYxZNGx37Ah/lrgk7pGQndH6BVU2vieM 2vTRegaWrw58HsI6jr9gzyJ5Ny3g8nC/HcA8M8Fn/uXlRHgT2V1N9+TnOi7u3ty2lwTc LFw/e5Vzda8ZXoHBPtBn4tIFq/yCXu/bZgx7Ha8PEAyGBUYOlerkXUOWHbR1NQBbqxEP tYPw== X-Gm-Message-State: APf1xPD7EK1063l60oqD9mj0s9SLsSDLWJfjmOoQxWw2/nwBLjoFxRmr y48w6mZd+VcNalhYGxCoxs7Pc9xYnfJaDU457vI= X-Received: by 10.157.5.183 with SMTP id 52mr10829671otd.61.1519770611912; Tue, 27 Feb 2018 14:30:11 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.5.137 with HTTP; Tue, 27 Feb 2018 14:30:11 -0800 (PST) In-Reply-To: <20180227212433.2189-4-mylene.josserand@bootlin.com> References: <20180227212433.2189-1-mylene.josserand@bootlin.com> <20180227212433.2189-4-mylene.josserand@bootlin.com> From: Fabio Estevam Date: Tue, 27 Feb 2018 19:30:11 -0300 Message-ID: Subject: Re: [PATCH v1 3/4] ASoC: codecs: pcm179x: Add reset gpio To: =?UTF-8?Q?Myl=C3=A8ne_Josserand?= 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 Content-Type: text/plain; charset="UTF-8" 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 Tue, Feb 27, 2018 at 6:24 PM, Myl=C3=A8ne Josserand wrote: > + pcm179x->reset =3D of_get_named_gpio(np, "reset-gpios", 0); > + if (gpio_is_valid(pcm179x->reset)) { > + ret =3D 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. 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);