All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Agrawal, Akshu" <Akshu.Agrawal@amd.com>
To: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Cc: "djkurtz@chromium.org" <djkurtz@chromium.org>,
	"Alexander.Deucher@amd.com" <Alexander.Deucher@amd.com>,
	Support Opensource <Support.Opensource@diasemi.com>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	"moderated list:SOUND" <alsa-devel@alsa-project.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3] ASoC: da7219: read fmw property to get mclk for non-dts systems
Date: Mon, 7 May 2018 10:20:10 +0530	[thread overview]
Message-ID: <e17e2c9e-923d-fea6-26be-5f14c99a45cb@amd.com> (raw)
In-Reply-To: <2E89032DDAA8B9408CB92943514A0337014C1EA102@SW-EX-MBX01.diasemi.com>



On 5/4/2018 2:45 PM, Adam Thomson wrote:
> On 03 May 2018 08:59, Akshu Agrawal wrote:
> 
>> Non-dts based systems can use ACPI DSDT to pass on the mclk
>> to da7219.
>> This enables da7219 mclk to be linked to system clock.
>> Enable/Disable of the mclk is already handled in the codec so
>> platform drivers don't have to explicitly do handling of mclk.
>>
>> Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
>> ---
>> v2: Fixed kbuild error
>> v3: Add corresponding clk_put for clk_get
>>  include/sound/da7219.h    |  2 ++
>>  sound/soc/codecs/da7219.c | 10 +++++++++-
>>  2 files changed, 11 insertions(+), 1 deletion(-)
>>
>> diff --git a/include/sound/da7219.h b/include/sound/da7219.h
>> index 1bfcb16..df7ddf4 100644
>> --- a/include/sound/da7219.h
>> +++ b/include/sound/da7219.h
>> @@ -38,6 +38,8 @@ struct da7219_pdata {
>>
>>  	const char *dai_clks_name;
>>
>> +	const char *mclk_name;
>> +
>>  	/* Mic */
>>  	enum da7219_micbias_voltage micbias_lvl;
>>  	enum da7219_mic_amp_in_sel mic_amp_in_sel;
>> diff --git a/sound/soc/codecs/da7219.c b/sound/soc/codecs/da7219.c
>> index 980a6a8..ecd46fc 100644
>> --- a/sound/soc/codecs/da7219.c
>> +++ b/sound/soc/codecs/da7219.c
>> @@ -1624,6 +1624,8 @@ static struct da7219_pdata *da7219_fw_to_pdata(struct
>> snd_soc_component *compone
>>  		dev_warn(dev, "Using default clk name: %s\n",
>>  			 pdata->dai_clks_name);
>>
>> +	device_property_read_string(dev, "dlg,mclk-name", &pdata->mclk_name);
>> +
> 
> Personally am still not keen on this. To me the use of a device_property_*
> function suggests the same property resides in both DT and ACPI, but here we're
> only using this for the ACPI case. DT has no want or need for this. I still feel
> we should look at something more generic in the clock framework, although I do
> agree with Mark that this should be properly specced.
> 

I am not an expert in field of ACPI, IMO forming a Spec and changing
ACPI to have DT like clock framework is good to have but a bigger change
which should be taken up later.

The current code of handling of mclk in the driver is usable only by DT.
The device_property (though ACPI specific) makes this code, a common
code for DT and ACPI based devices.

https://www.kernel.org/doc/Documentation/acpi/DSD-properties-rules.txt
"....Still, for the sake of code re-use, it may make sense to provide as
much of the configuration data as possible in the form of device
properties and complement that with an ACPI-specific mechanism suitable
for the use case at hand......"

Thanks,
Akshu

WARNING: multiple messages have this Message-ID (diff)
From: "Agrawal, Akshu" <Akshu.Agrawal@amd.com>
To: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Cc: "moderated list:SOUND" <alsa-devel@alsa-project.org>,
	Support Opensource <Support.Opensource@diasemi.com>,
	open list <linux-kernel@vger.kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	"djkurtz@chromium.org" <djkurtz@chromium.org>,
	Takashi Iwai <tiwai@suse.com>, Mark Brown <broonie@kernel.org>,
	"Alexander.Deucher@amd.com" <Alexander.Deucher@amd.com>
Subject: Re: [PATCH v3] ASoC: da7219: read fmw property to get mclk for non-dts systems
Date: Mon, 7 May 2018 10:20:10 +0530	[thread overview]
Message-ID: <e17e2c9e-923d-fea6-26be-5f14c99a45cb@amd.com> (raw)
In-Reply-To: <2E89032DDAA8B9408CB92943514A0337014C1EA102@SW-EX-MBX01.diasemi.com>



On 5/4/2018 2:45 PM, Adam Thomson wrote:
> On 03 May 2018 08:59, Akshu Agrawal wrote:
> 
>> Non-dts based systems can use ACPI DSDT to pass on the mclk
>> to da7219.
>> This enables da7219 mclk to be linked to system clock.
>> Enable/Disable of the mclk is already handled in the codec so
>> platform drivers don't have to explicitly do handling of mclk.
>>
>> Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
>> ---
>> v2: Fixed kbuild error
>> v3: Add corresponding clk_put for clk_get
>>  include/sound/da7219.h    |  2 ++
>>  sound/soc/codecs/da7219.c | 10 +++++++++-
>>  2 files changed, 11 insertions(+), 1 deletion(-)
>>
>> diff --git a/include/sound/da7219.h b/include/sound/da7219.h
>> index 1bfcb16..df7ddf4 100644
>> --- a/include/sound/da7219.h
>> +++ b/include/sound/da7219.h
>> @@ -38,6 +38,8 @@ struct da7219_pdata {
>>
>>  	const char *dai_clks_name;
>>
>> +	const char *mclk_name;
>> +
>>  	/* Mic */
>>  	enum da7219_micbias_voltage micbias_lvl;
>>  	enum da7219_mic_amp_in_sel mic_amp_in_sel;
>> diff --git a/sound/soc/codecs/da7219.c b/sound/soc/codecs/da7219.c
>> index 980a6a8..ecd46fc 100644
>> --- a/sound/soc/codecs/da7219.c
>> +++ b/sound/soc/codecs/da7219.c
>> @@ -1624,6 +1624,8 @@ static struct da7219_pdata *da7219_fw_to_pdata(struct
>> snd_soc_component *compone
>>  		dev_warn(dev, "Using default clk name: %s\n",
>>  			 pdata->dai_clks_name);
>>
>> +	device_property_read_string(dev, "dlg,mclk-name", &pdata->mclk_name);
>> +
> 
> Personally am still not keen on this. To me the use of a device_property_*
> function suggests the same property resides in both DT and ACPI, but here we're
> only using this for the ACPI case. DT has no want or need for this. I still feel
> we should look at something more generic in the clock framework, although I do
> agree with Mark that this should be properly specced.
> 

I am not an expert in field of ACPI, IMO forming a Spec and changing
ACPI to have DT like clock framework is good to have but a bigger change
which should be taken up later.

The current code of handling of mclk in the driver is usable only by DT.
The device_property (though ACPI specific) makes this code, a common
code for DT and ACPI based devices.

https://www.kernel.org/doc/Documentation/acpi/DSD-properties-rules.txt
"....Still, for the sake of code re-use, it may make sense to provide as
much of the configuration data as possible in the form of device
properties and complement that with an ACPI-specific mechanism suitable
for the use case at hand......"

Thanks,
Akshu

  reply	other threads:[~2018-05-07  4:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-03  7:58 [PATCH v3] ASoC: da7219: read fmw property to get mclk for non-dts systems Akshu Agrawal
2018-05-03  7:58 ` Akshu Agrawal
2018-05-04  9:15 ` Adam Thomson
2018-05-07  4:50   ` Agrawal, Akshu [this message]
2018-05-07  4:50     ` Agrawal, Akshu
2018-05-07  6:39     ` Daniel Kurtz
2018-05-15  9:43       ` Agrawal, Akshu
2018-05-17  6:13         ` Mark Brown
2018-05-16  9:37     ` Adam Thomson
2018-05-16  9:37       ` Adam Thomson

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=e17e2c9e-923d-fea6-26be-5f14c99a45cb@amd.com \
    --to=akshu.agrawal@amd.com \
    --cc=Adam.Thomson.Opensource@diasemi.com \
    --cc=Alexander.Deucher@amd.com \
    --cc=Support.Opensource@diasemi.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=djkurtz@chromium.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.