linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Mylène Josserand" <mylene.josserand@bootlin.com>
To: Fabio Estevam <festevam@gmail.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	alsa-devel@alsa-project.org,
	"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
	<devicetree@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	alexandre.belloni@bootlin.com,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: Re: [PATCH v1 3/4] ASoC: codecs: pcm179x: Add reset gpio
Date: Thu, 1 Mar 2018 09:13:47 +0100	[thread overview]
Message-ID: <20180301091347.6575e621@dell-desktop.home> (raw)
In-Reply-To: <CAOMZO5C+Ub2R6srR+2jv2pY8zwjwkPSecpO1gbXvmXMTTnhU8Q@mail.gmail.com>

Hello Fabio,

Thank you for the review!

On Tue, 27 Feb 2018 19:30:11 -0300
Fabio Estevam <festevam@gmail.com> wrote:

> On Tue, Feb 27, 2018 at 6:24 PM, Mylène Josserand
> <mylene.josserand@bootlin.com> 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

  reply	other threads:[~2018-03-01  8:13 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-27 21:24 [PATCH v1 0/4] ASoC: Add support for DAC PCM1789 Mylène Josserand
2018-02-27 21:24 ` [PATCH v1 1/4] ASoC: codecs: pcm179x: Add PCM1789 id Mylène Josserand
2018-02-27 21:51   ` Thomas Petazzoni
2018-03-01  7:43     ` Mylène Josserand
2018-03-01  9:04       ` [alsa-devel] " Michael Nazzareno Trimarchi
2018-03-01 13:53         ` Mylène Josserand
2018-02-27 21:24 ` [PATCH v1 2/4] ASoC: codecs: pcm179x: Add support for PCM1789 Mylène Josserand
2018-02-27 21:56   ` Thomas Petazzoni
2018-03-01  7:47     ` Mylène Josserand
2018-02-27 21:24 ` [PATCH v1 3/4] ASoC: codecs: pcm179x: Add reset gpio Mylène Josserand
2018-02-27 22:02   ` Thomas Petazzoni
2018-03-01  7:48     ` Mylène Josserand
2018-02-27 22:30   ` Fabio Estevam
2018-03-01  8:13     ` Mylène Josserand [this message]
2018-02-27 21:24 ` [PATCH v1 4/4] ASoC: codecs: pcm179x: Add trigger function to perform a reset Mylène Josserand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180301091347.6575e621@dell-desktop.home \
    --to=mylene.josserand@bootlin.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=perex@perex.cz \
    --cc=robh+dt@kernel.org \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).