mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stefan Agner <stefan@agner.ch>
To: Jon Hunter <jonathanh@nvidia.com>
Cc: Marcel Ziswiler <marcel@ziswiler.com>,
	alsa-devel@alsa-project.org, linux-tegra@vger.kernel.org,
	Marcel Ziswiler <marcel.ziswiler@toradex.com>,
	Jaroslav Kysela <perex@perex.cz>,
	Thierry Reding <thierry.reding@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	linux-kernel@vger.kernel.org, Takashi Iwai <tiwai@suse.com>,
	Liam Girdwood <lgirdwood@gmail.com>
Subject: Re: [PATCH v2] ASoC: tegra: probe deferral error reporting
Date: Sat, 18 Aug 2018 15:02:31 +0200	[thread overview]
Message-ID: <1edf4e289d6ede7d6bac43a6a9fdb613@agner.ch> (raw)
In-Reply-To: <930b05df-c502-192e-3cb9-9e1874701cce@nvidia.com>

On 15.08.2018 18:02, Jon Hunter wrote:
> On 14/08/18 15:01, Marcel Ziswiler wrote:
>> From: Marcel Ziswiler <marcel.ziswiler@toradex.com>
>>
>> Actually report the error codes from of_get_named_gpio() resp.
>> devm_gpio_request_one() upon trying to get the codec reset resp. sync
>> GPIOs unless it is just a probe deferral.
>>
>> Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
>>
>> ---
>>
>> Changes in v2:
>> - Silence probe deferral as suggested by Stefan.
>> - Fix line over 80 characters as reported by checkpatch.
>>
>>  sound/soc/tegra/tegra20_ac97.c | 19 ++++++++++++++++---
>>  1 file changed, 16 insertions(+), 3 deletions(-)
>>
>> diff --git a/sound/soc/tegra/tegra20_ac97.c b/sound/soc/tegra/tegra20_ac97.c
>> index 682ef33afb5f..2ac6b2d73980 100644
>> --- a/sound/soc/tegra/tegra20_ac97.c
>> +++ b/sound/soc/tegra/tegra20_ac97.c
>> @@ -351,18 +351,31 @@ static int tegra20_ac97_platform_probe(struct platform_device *pdev)
>>  		ret = devm_gpio_request_one(&pdev->dev, ac97->reset_gpio,
>>  					    GPIOF_OUT_INIT_HIGH, "codec-reset");
>>  		if (ret) {
>> -			dev_err(&pdev->dev, "could not get codec-reset GPIO\n");
>> +			if (ret != -EPROBE_DEFER)
>> +				dev_err(&pdev->dev,
>> +					"could not get codec-reset GPIO: %d\n",
>> +					ret);
>> +
>>  			goto err_clk_put;
>>  		}
>>  	} else {
>> -		dev_err(&pdev->dev, "no codec-reset GPIO supplied\n");
>> +		ret = ac97->reset_gpio;
>> +		if (ret != -EPROBE_DEFER)
>> +			dev_err(&pdev->dev,
>> +				"no codec-reset GPIO supplied: %d\n",
>> +				ret);
>> +
>>  		goto err_clk_put;
>>  	}
>>
>>  	ac97->sync_gpio = of_get_named_gpio(pdev->dev.of_node,
>>  					    "nvidia,codec-sync-gpio", 0);
>>  	if (!gpio_is_valid(ac97->sync_gpio)) {
>> -		dev_err(&pdev->dev, "no codec-sync GPIO supplied\n");
>> +		ret = ac97->sync_gpio;
>> +		if (ret != -EPROBE_DEFER)
>> +			dev_err(&pdev->dev, "no codec-sync GPIO supplied: %d\n",
>> +				ret);
>> +
>>  		goto err_clk_put;
>>  	}
> 
> Thanks, looks good to me. However, I wonder why we don't request the
> 'sync_gpio' in the probe like we do for the reset? Otherwise ...

The comment in tegra20_ac97_codec_warm_reset() is probably the reason:

/*
 * although sync line is driven by the DAC pad group warm reset using
 * the controller cmd is not working, have to toggle sync line
 * manually.
 */

I guess the GPIO need to be freed so that the DAC pad group can use the
sync line?

> 
> Acked-by: Jon Hunter <jonathanh@nvidia.com>

Also looks good to me:

Reviewed-by: Stefan Agner <stefan@agner.ch>

--
Stefan

      reply	other threads:[~2018-08-18 13:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-14 14:01 Marcel Ziswiler
2018-08-15 16:02 ` Jon Hunter
2018-08-18 13:02   ` Stefan Agner [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=1edf4e289d6ede7d6bac43a6a9fdb613@agner.ch \
    --to=stefan@agner.ch \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=jonathanh@nvidia.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=marcel.ziswiler@toradex.com \
    --cc=marcel@ziswiler.com \
    --cc=perex@perex.cz \
    --cc=thierry.reding@gmail.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

Powered by JetHome