Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jarkko Nikula <jarkko.nikula@linux.intel.com>
To: Mark Brown <broonie@kernel.org>
Cc: Liam Girdwood <liam.r.girdwood@linux.intel.com>,
	alsa-devel@alsa-project.org, Liam Girdwood <lgirdwood@gmail.com>
Subject: Re: [PATCH] ASoC: Intel: Add Baytrail byt-max98090 machine driver
Date: Mon, 19 May 2014 10:56:11 +0300	[thread overview]
Message-ID: <5379B91B.5010306@linux.intel.com> (raw)
In-Reply-To: <20140516185429.GR22111@sirena.org.uk>

Hi

On 05/16/2014 09:54 PM, Mark Brown wrote:
>> +
>> +	/*
>> +	 * ASoC still uses legacy GPIOs so we look both GPIOs using
>> +	 * descriptors here, convert them to numbers and release the
>> +	 * acquired descriptors. Once ASoC switches over to GPIO descriptor
>> +	 * APIs we can pass them directly.
>> +	 */
> You could just add the required support to the framework...  it seems
> quicker and simpler.

Looks like Mika was already proposing it :-)
>> +	hp_desc = gpiod_get_index(card->dev->parent, NULL, 0);
>> +	if (IS_ERR(hp_desc))
>> +		return 0;
> This just eats errors, it's broken for deferred probe.

Indeed yes.
>> +	snd_soc_jack_report(jack, SND_JACK_LINEOUT | SND_JACK_LINEIN,
>> +			    SND_JACK_HEADSET | SND_JACK_LINEOUT |
>> +			    SND_JACK_LINEIN);
> Why is this here?

Hmm.. I'd guess either a left over from a test code or attempt to send a 
wrong initial jack state. I'll check.

>> +static int byt_max98090_remove(struct platform_device *pdev)
>> +{
>> +	struct snd_soc_card *soc_card = platform_get_drvdata(pdev);
>> +	struct byt_max98090_private *drv = snd_soc_card_get_drvdata(soc_card);
>> +
>> +	snd_soc_jack_free_gpios(&drv->jack, ARRAY_SIZE(hs_jack_gpios),
>> +				hs_jack_gpios);
>> +	snd_soc_card_set_drvdata(soc_card, NULL);
>> +	snd_soc_unregister_card(soc_card);
>> +	platform_set_drvdata(pdev, NULL);
> Setting the data to NULL on removal is just a waste of time and is done
> by the core anyway.
>
> You're freeing these in the device level remove path but allocating them
> in the ASoC level probe path.  They should be managed consistently.

Right, thanks for pointing, I was blind to see this.

Your other comments are valid to byt-rt5640 too. I'll update it also 
accordingly.

-- 
Jarkko

      reply	other threads:[~2014-05-19  7:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-16 13:58 [PATCH] ASoC: Intel: Add Baytrail byt-max98090 machine driver Jarkko Nikula
2014-05-16 18:54 ` Mark Brown
2014-05-19  7:56   ` Jarkko Nikula [this message]

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=5379B91B.5010306@linux.intel.com \
    --to=jarkko.nikula@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=liam.r.girdwood@linux.intel.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