[alsa-devel] [PATCH v2 1/2] ASoC: rt5645: change gpio to gpiod APIs

Bard Liao bardliao at realtek.com
Wed Jun 3 14:03:06 CEST 2015


> -----Original Message-----
> From: Mark Brown [mailto:broonie at kernel.org]
> Sent: Wednesday, June 03, 2015 1:17 AM
> To: Lars-Peter Clausen
> Cc: Bard Liao; lgirdwood at gmail.com; Oder Chiou;
> alsa-devel at alsa-project.org; zhengxing at rock-chips.com;
> yang.a.fang at intel.com; koro.chen at mediatek.com; John Lin;
> Leilk.Liu at mediatek.com; Flove
> Subject: Re: [alsa-devel] [PATCH v2 1/2] ASoC: rt5645: change gpio to
> gpiod APIs
> 
> On Fri, May 29, 2015 at 06:31:08PM +0200, Lars-Peter Clausen wrote:
> 
> > Three things, don't use the _index API if there is only a single gpio
> > for the property, either don't use a name at all or use a descriptive
> > name something like "hp-detect" and use the new version of the API
> > which has the flags parameter.
> 
> > So this should be: devm_gpiod_get(&i2c->dev, NULL, GPIOD_IN);
> 
> > and then drop the gpiod_direction_input()...
> 
> It seems better if people use names where possible if there's any chance
> that we could add support for other GPIOs in the future, that avoids
> confusion further down the line with extension.

Do you mean use a well-described gpio name such as "hp-detect" so that
we can use another name if we need to add other gpios in the future?

> 
> ------Please consider the environment before printing this e-mail.


More information about the Alsa-devel mailing list