[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <50343cff-bad4-7677-851f-f0b818ae7b29@amd.com>
Date: Mon, 23 Jul 2018 10:56:44 +0530
From: "Agrawal, Akshu" <Akshu.Agrawal@....com>
To: Mark Brown <broonie@...nel.org>
Cc: djkurtz@...omium.org, Alexander.Deucher@....com,
Liam Girdwood <lgirdwood@...il.com>,
Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>,
Dylan Reid <dgreid@...omium.org>,
"Mukunda, Vijendar" <Vijendar.Mukunda@....com>,
Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>,
Wei Yongjun <weiyongjun1@...wei.com>,
"moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..."
<alsa-devel@...a-project.org>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] ASoC: AMD: Add a fix voltage regulator for DA7219 and
ADAU7002
On 7/20/2018 5:48 PM, Mark Brown wrote:
> On Fri, Jul 20, 2018 at 02:38:11PM +0800, Akshu Agrawal wrote:
>
>> static int cz_probe(struct platform_device *pdev)
>> {
>> int ret;
>> struct snd_soc_card *card;
>> struct acp_platform_info *machine;
>> + static bool regulators_registered;
>> +
>> + if (!regulators_registered) {
>> + ret = platform_device_register(&acp_da7219_regulator);
>> + if (ret) {
>> + dev_err(&pdev->dev, "Failed to register regulator: %d\n",
>> + ret);
>> + return ret;
>> + }
>> + regulators_registered = true;
>> + }
>
> You should be unregistering the regulator in your remove function, not
> doing this hack here. I'd also expect to see the card made the parent
> of the device that gets registered.
>
This approach shows inconsistencies and in some boot cycles da7219 fails
to get regulator. Form the logs (below) it shows time gap between the
time we call “platform_device_register(&acp_da7219_regulator);” and when
the regulator actually gets registered.
[ 12.594237] regulator registered
**print after calling “platform_device_register(&acp_da7219_regulator);”
...
[ 13.583689] da7219 i2c-DLGS7219:00: i2c-DLGS7219:00 supply VDD not
found, using dummy regulator
[ 13.593818] da7219 i2c-DLGS7219:00: i2c-DLGS7219:00 supply VDDMIC not
found, using dummy regulator
[ 13.603242] da7219 i2c-DLGS7219:00: i2c-DLGS7219:00 supply VDDIO not
found, using dummy regulator
[ 13.612626] da7219 i2c-DLGS7219:00: Invalid VDDIO voltage
**Above DA7219 gets probed and does not find the regulator**
...
[ 13.750894] reg_fixed_voltage_probe: Supply -> reg-fixed-1.8V
[ 13.766746] reg-fixed-1.8V supplying 1800000uV
**Regulator actually gets registered**
Alternate and consistent approach to this is pushed by Daniel here:
https://patchwork.kernel.org/patch/10539485/
Thanks,
Akshu
Powered by blists - more mailing lists