Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp649953pxb; Wed, 6 Oct 2021 12:23:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzfYtCNvBCwdb7AcVmha4I8TvL4BGWZIuhLUd6zpzVS3UQzMV0PsE+5eBtqGajrWPzhg+dR X-Received: by 2002:a17:906:6c84:: with SMTP id s4mr1802ejr.121.1633548234926; Wed, 06 Oct 2021 12:23:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633548234; cv=none; d=google.com; s=arc-20160816; b=HabEfs9MsINWSkB2a0KZatbNuFY1CZtE1Ghw8N2cbl0oJQ6MAiWmidVHJxSMLnoxrW G3HWeZSeV4/2522Au/pkGX4qKJeG8mG3AC/U3heug3IpUXOg0HsmpXCQ8uXrCyJUUzJr NJFK50zeZj/LTOGg0patjEC2titJaAaCVyvw1kG5UdTDCE5ZUAHGvOFb/g/7HOVfJ5ZM GkGcVfZdWaeyiKPDeQkhMUPe147AjOYQoRvkBiC6qd8fHIaKFQOxoA64gxq3aRaL+mIl Su0FAu3n1DW0E4M/UceOUgBmvNqoldCQh7X/v4QIKdQuYWM4U4aWYvQKvBu6VxXSjfCv oM+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=FnP39XDqwUDKj+L29KvHYvVj6TkVRcAAokzYN+iUggs=; b=pzeFkSHoIPbDq19QiJmHrsF7hfXGaSynpDNN+caMj+UWpebLv8PSXCw6wV2SzfqwWs PHK4Ocx8PJxIypShCzHTNklDUlOE9nPUIJkIHCPvJv8qfiRT0RcnNgclNMJVKaimdZ/e sYAvXfkoPT/vqSJ8VABmoVIrRQVS37NRHWhtHo/kN2o+aFCy/IPgI87ucixvnNSBqdQ4 Z+VnLxDcLikDX81ReSfQ3uVMFh7hP3Oz7IsetpBgAIg7jtxh6lAEQAEiq1BoLAsFZwlR cppI29geHCHGWh4kn2mJbwIJ+cGBaguoIHr8ATrnR/21gs0bnh0GugdCncbF+FMj/PQp 9pzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=gZfxWS+j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d11si30468981edj.442.2021.10.06.12.23.28; Wed, 06 Oct 2021 12:23:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=gZfxWS+j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239265AbhJFTX6 (ORCPT + 99 others); Wed, 6 Oct 2021 15:23:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229926AbhJFTX5 (ORCPT ); Wed, 6 Oct 2021 15:23:57 -0400 Received: from mail-qk1-x733.google.com (mail-qk1-x733.google.com [IPv6:2607:f8b0:4864:20::733]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BBCFFC061746 for ; Wed, 6 Oct 2021 12:22:04 -0700 (PDT) Received: by mail-qk1-x733.google.com with SMTP id w14so3684924qkf.5 for ; Wed, 06 Oct 2021 12:22:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=FnP39XDqwUDKj+L29KvHYvVj6TkVRcAAokzYN+iUggs=; b=gZfxWS+jqL9gtoJjT6lfE5zR038UOUAf7kNBsMgig+N+zJ/tqvsCUPzzEuYUyT5leG 7VfGasx6WcAwyTAQrYWTLFpR+W5mp2bBf0+oWBcKUOgMdLS+2V/McWT0dEb7rndA3Hjr hUSseCiGIan9Zstcrha2TUnSkEskjxA/3IijYfmn8Wt2PlAZpiDmGzdhR0eiIRVHYgIi LVWj/qvuJWDhn0fvcWwIoqC1in5qkrVSovl5x9RLMMPa54bWO4W9ytOJXQwOe8mK2IE1 hg2bgQcARtfGrWkvXCD9Vk09nfIdKC2QifQZMhF/10hxluVhaa3Yo0TXsBHPa93pHqMf mupg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=FnP39XDqwUDKj+L29KvHYvVj6TkVRcAAokzYN+iUggs=; b=zOOlHtyx7QD+AQl4VmGTDQmtC4j/OteJrGOiEphaNVzrE15FujkNrKgnl/53hRwc3X e4lNgull7drmF6ulMNx7pTq500X0bJjkC8rx/NRFnhGTHABmnaxTscnF3UoIXcLetO4m 6uNeM4ZdQFQWnpQ8KGkp+5scHGXdQh6JvcaN5E9MubviI3fFcy275/zDuu+JuvilasXl ZkovaPg3/ZlLW7ErmmPuavUsCqVNXG7qy0pHFUdHNtywlS0ySsDVkW5CU+CwcHGCKzsE M4IjZrkSTaooGiNjWZDLZkGM29wWqakZF0BFOf/JqvXK0HsLTj44TgYoiniUxzY4k/BC 6CYA== X-Gm-Message-State: AOAM531E+czjp9EHp9cdJGE3AOvrhD86abhmK3EYmuyEJwoBJA991omZ ZpRDeRCUO8VJgA1C8kssgRpTCPEE3sKomycJZ14MzQ== X-Received: by 2002:a37:43d6:: with SMTP id q205mr474410qka.4.1633548122106; Wed, 06 Oct 2021 12:22:02 -0700 (PDT) MIME-Version: 1.0 References: <20211006161805.938950-1-brent.lu@intel.com> <20211006161805.938950-4-brent.lu@intel.com> <0482534d-46c4-5cee-25bd-8739e80a00f0@linux.intel.com> In-Reply-To: <0482534d-46c4-5cee-25bd-8739e80a00f0@linux.intel.com> From: Curtis Malainey Date: Wed, 6 Oct 2021 12:21:51 -0700 Message-ID: Subject: Re: [PATCH 3/3] ASoC: Intel: sof_rt5682: use id_alt to enumerate rt5682s To: Pierre-Louis Bossart Cc: Brent Lu , ALSA development , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Cezary Rojewski , Jie Yang , Kai Vehmanen , Guennadi Liakhovetski , Yong Zhi , Vamshi Krishna Gopal , Linux Kernel Mailing List , Rander Wang , Bard Liao , Malik_Hsu , Libin Yang , Hans de Goede , Charles Keepax , Paul Olaru , Curtis Malainey , Mac Chiang , Gongjun Song Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 6, 2021 at 11:43 AM Pierre-Louis Bossart 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 }