Re: [PATCH 2/3] ASoC: loongson: Add Loongson Generic ASoC Sound Card Support

From: YingKun Meng
Date: Thu Jun 08 2023 - 23:58:01 EST


Hi Brown,

Thanks for your kindly work.

On 2023/6/5 20:47, Mark Brown wrote:
On Mon, Jun 05, 2023 at 08:09:33PM +0800, YingKun Meng wrote:

The driver supports the use of ACPI table to describe device resources.
On loongson 7axxx platforms, the audio device is an ACPI device.
I'm not seeing any ACPI IDs added here, this is all DT other than this:

I use the special ACPI ID "PRP0001", it provides a means to use the existing

DT-compatible device identification in ACPI.

As described in the document "ACPI Based Device Enumeration".

+ if (has_acpi_companion(&pdev->dev)) {
+ device_property_read_string(&pdev->dev, "codec-name",
+ &codec_name);
+ for (i = 0; i < card->num_links; i++)
+ loongson_dai_links[i].codecs->name = codec_name;
+
+ device_property_read_string(&pdev->dev, "codec-dai-name",
+ &codec_dai_name);
+ for (i = 0; i < card->num_links; i++)
+ loongson_dai_links[i].codecs->dai_name = codec_dai_name;
+ } else {
which doesn't look *great* from an ACPI point of view TBH. I thought
there were now some (semi?) standard ACPI bindings these days to support
referencing other devices better?
Got it! I will rewrite this part.