lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOReqxisH_9TuP_v77JzdQ+v+duPvvyHNHBxXzGJZ3dMoyMczQ@mail.gmail.com>
Date:   Wed, 6 Oct 2021 12:21:51 -0700
From:   Curtis Malainey <cujomalainey@...gle.com>
To:     Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>
Cc:     Brent Lu <brent.lu@...el.com>,
        ALSA development <alsa-devel@...a-project.org>,
        Liam Girdwood <lgirdwood@...il.com>,
        Mark Brown <broonie@...nel.org>,
        Jaroslav Kysela <perex@...ex.cz>,
        Takashi Iwai <tiwai@...e.com>,
        Cezary Rojewski <cezary.rojewski@...el.com>,
        Jie Yang <yang.jie@...ux.intel.com>,
        Kai Vehmanen <kai.vehmanen@...ux.intel.com>,
        Guennadi Liakhovetski <guennadi.liakhovetski@...ux.intel.com>,
        Yong Zhi <yong.zhi@...el.com>,
        Vamshi Krishna Gopal <vamshi.krishna.gopal@...el.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Rander Wang <rander.wang@...el.com>,
        Bard Liao <bard.liao@...el.com>,
        Malik_Hsu <malik_hsu@...tron.corp-partner.google.com>,
        Libin Yang <libin.yang@...el.com>,
        Hans de Goede <hdegoede@...hat.com>,
        Charles Keepax <ckeepax@...nsource.cirrus.com>,
        Paul Olaru <paul.olaru@....nxp.com>,
        Curtis Malainey <cujomalainey@...omium.org>,
        Mac Chiang <mac.chiang@...el.com>,
        Gongjun Song <gongjun.song@...el.com>
Subject: Re: [PATCH 3/3] ASoC: Intel: sof_rt5682: use id_alt to enumerate rt5682s

On Wed, Oct 6, 2021 at 11:43 AM Pierre-Louis Bossart
<pierre-louis.bossart@...ux.intel.com> wrote:
>
>
>
> On 10/6/21 1:34 PM, Curtis Malainey wrote:
> >>  };
> >>
> >> +static struct snd_soc_acpi_codecs adl_rt5682s_hp = {
> >> +       .num_codecs = 1,
> >> +       .codecs = {"RTL5682"}
> >> +};
> >> +
> >>  struct snd_soc_acpi_mach snd_soc_acpi_intel_adl_machines[] = {
> >>         {
> >>                 .id = "10EC5682",
> >> +               .id_alt = &adl_rt5682s_hp,
> >>                 .drv_name = "adl_mx98373_rt5682",
> >>                 .machine_quirk = snd_soc_acpi_codec_list,
> >>                 .quirk_data = &adl_max98373_amp,
> >> @@ -296,6 +302,7 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_adl_machines[] = {
> >>         },
> >>         {
> >>                 .id = "10EC5682",
> >> +               .id_alt = &adl_rt5682s_hp,
> >>                 .drv_name = "adl_mx98357_rt5682",
> >>                 .machine_quirk = snd_soc_acpi_codec_list,
> >>                 .quirk_data = &adl_max98357a_amp,
> >> @@ -304,6 +311,7 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_adl_machines[] = {
> >>         },
> >>         {
> >>                 .id = "10EC5682",
> >> +               .id_alt = &adl_rt5682s_hp,
> >>                 .drv_name = "adl_mx98360_rt5682",
> >>                 .machine_quirk = snd_soc_acpi_codec_list,
> >>                 .quirk_data = &adl_max98360a_amp,
> >
> > Is there any way we can collapse this and the primary id into a single
> > list to avoid having 2 locations to track for the IDs?
>
> I was thinking about that too, but in that case we would want to have a
> list of strings, rather than the address of a structure which adds one
> layer of indirection.
>
> Something like
>
> .id = { "10EC5682", "RTL5682" }
>
> and the .num_codecs removed and some termination added.
>

I don't see an issue with still using a struct since we are using the
same list across multiple machines, but this makes me wonder if maybe
we should refactor this into another layer, having the ids at a top
structure and then the speaker matches a layer down. E.g.

 struct snd_soc_acpi_mach snd_soc_acpi_intel_adl_machines[] = {
        {
                .drv_name = "adl_mx98373_rt5682",
                .machine_quirk = snd_soc_acpi_codec_list,
                .quirk_data = &adl_max98373_amp,
        },
        {
                .drv_name = "adl_mx98357_rt5682",
                .machine_quirk = snd_soc_acpi_codec_list,
                .quirk_data = &adl_max98357a_amp,
        },
        {
                .drv_name = "adl_mx98360_rt5682",
                .machine_quirk = snd_soc_acpi_codec_list,
                .quirk_data = &adl_max98360a_amp,
        }
}

struct machine_driver adl_rt5682_driver_match {
  .id = { "10EC5682", "RTL5682" }
  .instances = &adl_rt5682_machines
}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ