mbox series

[v2,0/3] AMD Vangogh support for NAU8821/MAX98388

Message ID 20230705134341.175889-1-cristian.ciocaltea@collabora.com
Headers show
Series AMD Vangogh support for NAU8821/MAX98388 | expand

Message

Cristian Ciocaltea July 5, 2023, 1:43 p.m. UTC
This patch series extends the Vangogh machine driver to support a variant
based on the Nuvoton NAU88L21 Codec and the Analog Devices MAX98388 
Speaker Amplifier.

Changes in v2:
 * Reworked series to ensure the existing devices based on the CS35L41 
   codec continue to work fine
 * Rebased onto next-20230703

Cristian Ciocaltea (3):
  ASoC: amd: vangogh: Make use of DRV_NAME
  ASoC: amd: vangogh: Use dmi_first_match() for DMI quirk handling
  ASoC: amd: vangogh: Add support for NAU8821/MAX98388 variant

 sound/soc/amd/Kconfig              |   5 +-
 sound/soc/amd/vangogh/acp5x-mach.c | 167 +++++++++++++++++++++++++----
 2 files changed, 149 insertions(+), 23 deletions(-)

Comments

Mark Brown July 5, 2023, 4:16 p.m. UTC | #1
On Wed, Jul 05, 2023 at 04:43:41PM +0300, Cristian Ciocaltea wrote:

> +static int acp5x_max98388_hw_params(struct snd_pcm_substream *substream,
> +				    struct snd_pcm_hw_params *params)
> +{
> +	struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
> +	struct snd_soc_dai *dai = snd_soc_card_get_codec_dai(rtd->card,
> +							     ACP5X_MAX98388_DAI_NAME);
> +	int ret;
> +
> +	ret = snd_soc_dai_set_fmt(dai,
> +				  SND_SOC_DAIFMT_CBS_CFS | SND_SOC_DAIFMT_I2S |
> +				  SND_SOC_DAIFMT_NB_NF);
> +	if (ret < 0)
> +		dev_err(dai->dev, "Failed to set format: %d\n", ret);
> +
> +	return ret;
> +}

This never varies, why not just set it up statically in the dai_link?