lkml.org 
[lkml]   [2023]   [Jul]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 1/2] ASoC: Intel: maxim-common: get codec number from ACPI
On Wed, Jul 26, 2023 at 10:08:47PM +0800, Brent Lu wrote:
> Implement a helper function to get number of codecs from ACPI
> subsystem to remove the need of quirk flag in machine driver.

...

> +void max_98390_dai_link(struct snd_soc_dai_link *link)
> +{
> + unsigned int num_codecs = get_num_codecs(MAX_98390_ACPI_HID);
> +
> + link->codecs = max_98390_components;
> +
> + switch (num_codecs) {
> + case 2:
> + case 4:
> + link->num_codecs = num_codecs;
> + break;
> + default:

> + pr_err("invalid codec number %d for %s\n", num_codecs,
> + MAX_98390_ACPI_HID);

I believe you have struct device pointer available, use dev_err().

> + break;
> + }
> +
> + link->init = max_98390_init;
> + link->ops = &max_98390_ops;
> +}

...

> +void max_98390_set_codec_conf(struct snd_soc_card *card)
> {
> + unsigned int num_codecs = get_num_codecs(MAX_98390_ACPI_HID);
> +
> + card->codec_conf = max_98390_codec_conf;
> +
> + switch (num_codecs) {
> + case 2:
> + case 4:
> + card->num_configs = num_codecs;
> + break;
> + default:
> + pr_err("invalid codec number %d for %s\n", num_codecs,
> + MAX_98390_ACPI_HID);

Ditto.

> + break;
> }
> }

--
With Best Regards,
Andy Shevchenko


\
 
 \ /
  Last update: 2023-07-26 18:30    [W:0.053 / U:0.584 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site