alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Mack <zonque@gmail.com>
To: Timur Tabi <timur@freescale.com>
Cc: alsa-devel@alsa-project.org, broonie@opensource.wolfsonmicro.com,
	lrg@ti.com
Subject: Re: [PATCH 1/2] ALSA: ASoC: add DT bindings for cs4270
Date: Tue, 24 Jul 2012 22:53:01 +0200	[thread overview]
Message-ID: <500F0B2D.9070303@gmail.com> (raw)
In-Reply-To: <500F07F9.8000408@freescale.com>

On 24.07.2012 22:39, Timur Tabi wrote:
> Daniel Mack wrote:
>> Yes, I'm aware of this, I just wonder how does your DT note looks like?
> 
> Take a look at arch/powerpc/boot/dts/mpc8610_hpcd.dts

Interesting, I didn't know that works without enabling the specific
string inside the driver. And that makes me wonder why many of the
Wolfson codec have them (like wm8580). I might lack something here,
maybe Mark can explain?

>> And are you ok with the 2nd patch?
> 
> Isn't that something that should be done in platform code?  It seems very
> platform-specific for a codec driver.  

Sure, the code I have at the moment does it that way, but the idea is to
have little to no platform specific code. And also, if anything in the
system needs to know when and how to drive the reset line, it should be
the driver, right?

> I have no problem using the CS4270
> on my board, and I don't need this feature.

Because you care for that either in the bootloader or the platform code
I believe?

> 
>> +	/* See if we way to bring the codec out of reset */
>> +	if (np) {
>> +		enum of_gpio_flags reset_gpio_flags;
> 
> Blank line after variable declarations
> 
>> +		int reset_gpio = of_get_named_gpio_flags(np, "reset-gpio", 0,
>> +							 &reset_gpio_flags);
> 
> Can you make this line shorter by using shorter variable names or something?

Right, fixed.

>> +		if (devm_gpio_request_one(&i2c_client->dev, reset_gpio,
>> +				     reset_gpio_flags & OF_GPIO_ACTIVE_LOW ?
>> +					GPIOF_OUT_INIT_LOW : GPIOF_OUT_INIT_HIGH,
>> +				     "cs4270 reset") < 0) {
>> +			reset_gpio = -EINVAL;
>> +		}
> 
> I don't see where you test whether the reset-gpio property is present.  It
> won't be present in my device tree.

The idea is that reset_gpio will be < 0 in that case, and so
devm_gpio_request_one() fails. So your platform should be ok and no
further checks are necessary.


Thanks for the review,
Daniel

  reply	other threads:[~2012-07-24 20:53 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-24 20:20 [PATCH 1/2] ALSA: ASoC: add DT bindings for cs4270 Daniel Mack
2012-07-24 20:20 ` [PATCH 2/2] ALSA: ASoC: Add reset-gpio DT property to cs4270 driver Daniel Mack
2012-07-24 20:22 ` [PATCH 1/2] ALSA: ASoC: add DT bindings for cs4270 Timur Tabi
2012-07-24 20:26   ` Daniel Mack
2012-07-24 20:30     ` Timur Tabi
2012-07-24 20:32       ` Daniel Mack
2012-07-24 20:39         ` Timur Tabi
2012-07-24 20:53           ` Daniel Mack [this message]
2012-07-24 21:01             ` Timur Tabi
2012-07-25  6:19               ` Daniel Mack
2012-07-24 22:01           ` Stephen Warren
2012-07-24 22:02             ` Timur Tabi
2012-07-24 22:42               ` Mark Brown
2012-07-24 22:41           ` Mark Brown
2012-07-24 22:00       ` Stephen Warren
2012-07-24 22:03         ` Timur Tabi
2012-07-24 22:44           ` Mark Brown
2012-07-25  6:12             ` Daniel Mack
2012-07-25  7:03               ` [PATCH 2/2 v2] ALSA: ASoC: Add reset-gpio DT property to cs4270 driver Daniel Mack
2012-07-25 13:18                 ` Mark Brown
2012-07-25 13:22                   ` Daniel Mack

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=500F0B2D.9070303@gmail.com \
    --to=zonque@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=lrg@ti.com \
    --cc=timur@freescale.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).