[PATCH v3 1/2] ASoC: amd: acp: Add support for nau8825 and max98360 card

Geert Uytterhoeven geert at linux-m68k.org
Mon May 23 15:52:10 CEST 2022


Hi Sujith,

On Mon, May 23, 2022 at 3:24 PM V sujith kumar Reddy
<Vsujithkumar.Reddy at amd.com> wrote:
> We have new platform with nau8825 as a primary codec and max98360 as an
> amp codec. Add machine struct to register sof audio based sound card
> on such Chrome machine.
>
> Signed-off-by: V sujith kumar Reddy <Vsujithkumar.Reddy at amd.com>

Thanks for your patch!

> --- a/sound/soc/amd/acp-config.c
> +++ b/sound/soc/amd/acp-config.c
> @@ -130,4 +130,25 @@ struct snd_soc_acpi_mach snd_soc_acpi_amd_sof_machines[] = {
>  };
>  EXPORT_SYMBOL(snd_soc_acpi_amd_sof_machines);
>
> +struct snd_soc_acpi_mach snd_soc_acpi_amd_rmb_sof_machines[] = {
> +       {
> +               .id = "AMDI1019",
> +               .drv_name = "rmb-dsp",
> +               .pdata = (void *)&acp_quirk_data,

You can assign an arbitrary pointer type to "void *" without casting.
In fact the cast makes the code less safe, as it prevents the compiler
from informing you in case a future patch changes types.

The same applies to below, and to the existing casts.

> +               .fw_filename = "sof-rmb.ri",
> +               .sof_tplg_filename = "sof-acp-rmb.tplg",
> +       },
> +       {
> +               .id = "10508825",
> +               .drv_name = "nau8825-max",
> +               .pdata = (void *)&acp_quirk_data,
> +               .machine_quirk = snd_soc_acpi_codec_list,
> +               .quirk_data = &amp_max,
> +               .fw_filename = "sof-rmb.ri",
> +               .sof_tplg_filename = "sof-acp-rmb.tplg",
> +       },
> +       {},
> +};

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds


More information about the Alsa-devel mailing list