Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp961714pxb; Wed, 6 Apr 2022 05:24:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwdjCdnYp/Gq/WqNz0NW7otJsmrE3U5I7K9Ywm6vONyT3vCOGgCBQhc5Q/9JIxVRugOUQ9t X-Received: by 2002:a17:90a:6382:b0:1ca:800e:1790 with SMTP id f2-20020a17090a638200b001ca800e1790mr9579988pjj.234.1649247879276; Wed, 06 Apr 2022 05:24:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649247879; cv=none; d=google.com; s=arc-20160816; b=eiVW2NdB5rt5ZEpnpQxgXobCK2/Qqq4yyal22nv0xcZZRG9VABuki/6WgoROFPO3LY xPDFvuWCH7iHK6/HIG58u5w0feMHXx/kkScsjKJRNwxaj5s6SzfA9H4FF884szD5dYfj tICH7ymsmRgV91ANYweQ0YcW4xDm6Ygv/jrb6DP5YgQ449FHTy1Dt4zxeBlMHC6Vufcv /JxalBegM1IypqoYImMtcEIBqqxaN2Fw7wNhAfD79fhk7P1MHbBiZP68CARK76MoLNsh Hq17mJhmNw0kWaOMDVmoiK7nPgHCNt0J5/tmpWuN/q9BBFlN0NJ3SHZULM4TaNUs+Cu4 BcPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=B7dT7fupnPtsOMKX4D+6F3aCemW9VoFa0XVJDAF+5bM=; b=ylSdrRVRux8issi5fBlC2ozFRyff6IReyk1lilp1tZ1ziE7s6v4iyew5N/chLWR5LZ mgQmh/OsEjhyStsXZMRtAE+JB2Q+QQX6AMdT6vrk1H3HqM04yVupoBFR4VM9A0+giwaH COQiZF84s1e59S0ni0CwzVdIrcnGlufVVbOJahTlRUNo/i1mNDoeNP9abrh0Arj/LDkx OFLMzBBwKfTuD9c+5Hjq5VLT4FqS2x7Bva+tLe/TxPoZwu4XqKHWdromceeWfeyVD5IG ozdVqTShdMZa52LiQUqVmPacnIFwKQVR9VLRskISbFicAvoereEudCaZvbHcaQxTBB5l RDaQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=fedoraproject.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id q88-20020a17090a4fe100b001bf082ef447si4534448pjh.111.2022.04.06.05.24.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 05:24:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=fedoraproject.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3931260C6E1; Wed, 6 Apr 2022 04:34:04 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1573820AbiDEWxY convert rfc822-to-8bit (ORCPT + 99 others); Tue, 5 Apr 2022 18:53:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1457864AbiDEQxP (ORCPT ); Tue, 5 Apr 2022 12:53:15 -0400 Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9FF0326E6 for ; Tue, 5 Apr 2022 09:51:14 -0700 (PDT) Received: by mail-ej1-f41.google.com with SMTP id k23so24503510ejd.3 for ; Tue, 05 Apr 2022 09:51:14 -0700 (PDT) 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:content-transfer-encoding; bh=IPrQE+Xi3gKFHtaa4iFeqv2z1Mz1gUVNTO0GQNazrug=; b=7MoYEpMW8uhJs4XPW8BacZ5qjLb2PeXqwyzQ0K3deVvGUJEcx+gyEl6KT5NNldM298 WI9R+z+/YYaUaZxtQt8mFU7HaLSeuHRITaQf8YTo3aaLr40XD+Mn9pADeQ14P5u+kwJF Yy4m7yc/cMkEQSUjlSI5CBjGe8JxV831889R/fBUSeW6cwMU3/8InfiCqB6uHI7T6/r+ F6MG3uoycmXMYCEZkwcBv4ZuMBhcuBcNYWf9P8lk2D8ehuv5ay2j7Lk+gMTlBhmgURD3 gNDTK/LqJcn1vWjLCwjBUVhvIiSEBakVfMtIF08t730Uhf1mR6kpRO3SiiEhtB8hjSUq WNXg== X-Gm-Message-State: AOAM532fh6n9/ywHyFcpbw1R9iDjDs0EcWFSzrKbcqqHhagB3biMqrn9 0zo9C5JTfk2KMwKinYcIIqR2FGs2z1vxElhR/asz8g== X-Received: by 2002:a17:907:1b20:b0:6da:649b:d99e with SMTP id mp32-20020a1709071b2000b006da649bd99emr4506275ejc.712.1649177473217; Tue, 05 Apr 2022 09:51:13 -0700 (PDT) MIME-Version: 1.0 References: <20220405070407.513532867@linuxfoundation.org> <20220405070435.188697055@linuxfoundation.org> In-Reply-To: <20220405070435.188697055@linuxfoundation.org> From: Justin Forbes Date: Tue, 5 Apr 2022 11:51:02 -0500 Message-ID: Subject: Re: [PATCH 5.17 0943/1126] ASoC: Intel: sof_es8336: use NHLT information to set dmic and SSP To: Greg Kroah-Hartman Cc: LKML , Stable , Mauro Carvalho Chehab , Pierre-Louis Bossart , Bard Liao , =?UTF-8?Q?P=C3=A9ter_Ujfalusi?= , Mark Brown , Sasha Levin Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 5, 2022 at 4:14 AM Greg Kroah-Hartman wrote: > > From: Pierre-Louis Bossart > > [ Upstream commit 651c304df7f6e3fbb4779527efa3eb128ef91329 ] > > Since we see a proliferation of devices with various configurations, > we want to automatically set the DMIC and SSP information. This patch > relies on the information extracted from NHLT and partially reverts > existing DMI quirks added by commit a164137ce91a ("ASoC: Intel: add > machine driver for SOF+ES8336") > > Note that NHLT can report multiple SSPs, choosing from the > ssp_link_mask in an MSB-first manner was found experimentally to work > fine. > > The only thing that cannot be detected is the GPIO type, and users may > want to use the quirk override parameter if the 'wrong' solution is > provided. > > Tested-by: Mauro Carvalho Chehab > Signed-off-by: Pierre-Louis Bossart > Reviewed-by: Bard Liao > Reviewed-by: Péter Ujfalusi > Link: https://lore.kernel.org/r/20220308192610.392950-15-pierre-louis.bossart@linux.intel.com > Signed-off-by: Mark Brown > Signed-off-by: Sasha Levin It seems this patch is missing a dependent patch in the backport, specifically commit 679aa83a0fb70dcbf9e97cbdfd573e6fc8bf9b1a ASoC: soc-acpi: add information on I2S/TDM link mask sound/soc/intel/boards/sof_es8336.c: In function 'sof_es8336_probe': sound/soc/intel/boards/sof_es8336.c:482:32: error: 'struct snd_soc_acpi_mach_params' has no member named 'i2s_link_mask'; did you mean 'link_mask'? 482 | if (!mach->mach_params.i2s_link_mask) { | ^~~~~~~~~~~~~ | link_mask sound/soc/intel/boards/sof_es8336.c:494:39: error: 'struct snd_soc_acpi_mach_params' has no member named 'i2s_link_mask'; did you mean 'link_mask'? 494 | if (mach->mach_params.i2s_link_mask & BIT(2)) | ^~~~~~~~~~~~~ | link_mask sound/soc/intel/boards/sof_es8336.c:496:44: error: 'struct snd_soc_acpi_mach_params' has no member named 'i2s_link_mask'; did you mean 'link_mask'? 496 | else if (mach->mach_params.i2s_link_mask & BIT(1)) | ^~~~~~~~~~~~~ | link_mask sound/soc/intel/boards/sof_es8336.c:498:45: error: 'struct snd_soc_acpi_mach_params' has no member named 'i2s_link_mask'; did you mean 'link_mask'? 498 | else if (mach->mach_params.i2s_link_mask & BIT(0)) | ^~~~~~~~~~~~~ | link_mask make[4]: *** [scripts/Makefile.build:288: sound/soc/intel/boards/sof_es8336.o] Error 1 Justin > sound/soc/intel/boards/sof_es8336.c | 56 +++++++++++++++++++++-------- > 1 file changed, 41 insertions(+), 15 deletions(-) > > diff --git a/sound/soc/intel/boards/sof_es8336.c b/sound/soc/intel/boards/sof_es8336.c > index 20d577eaab6d..46e453915f82 100644 > --- a/sound/soc/intel/boards/sof_es8336.c > +++ b/sound/soc/intel/boards/sof_es8336.c > @@ -228,24 +228,25 @@ static int sof_es8336_quirk_cb(const struct dmi_system_id *id) > return 1; > } > > +/* > + * this table should only be used to add GPIO or jack-detection quirks > + * that cannot be detected from ACPI tables. The SSP and DMIC > + * information are providing by the platform driver and are aligned > + * with the topology used. > + * > + * If the GPIO support is missing, the quirk parameter can be used to > + * enable speakers. In that case it's recommended to keep the SSP and DMIC > + * information consistent, overriding the SSP and DMIC can only be done > + * if the topology file is modified as well. > + */ > static const struct dmi_system_id sof_es8336_quirk_table[] = { > - { > - .callback = sof_es8336_quirk_cb, > - .matches = { > - DMI_MATCH(DMI_SYS_VENDOR, "CHUWI Innovation And Technology"), > - DMI_MATCH(DMI_BOARD_NAME, "Hi10 X"), > - }, > - .driver_data = (void *)SOF_ES8336_SSP_CODEC(2) > - }, > { > .callback = sof_es8336_quirk_cb, > .matches = { > DMI_MATCH(DMI_SYS_VENDOR, "IP3 tech"), > DMI_MATCH(DMI_BOARD_NAME, "WN1"), > }, > - .driver_data = (void *)(SOF_ES8336_SSP_CODEC(0) | > - SOF_ES8336_TGL_GPIO_QUIRK | > - SOF_ES8336_ENABLE_DMIC) > + .driver_data = (void *)(SOF_ES8336_TGL_GPIO_QUIRK) > }, > {} > }; > @@ -470,11 +471,33 @@ static int sof_es8336_probe(struct platform_device *pdev) > card = &sof_es8336_card; > card->dev = dev; > > - if (!dmi_check_system(sof_es8336_quirk_table)) > - quirk = SOF_ES8336_SSP_CODEC(2); > + /* check GPIO DMI quirks */ > + dmi_check_system(sof_es8336_quirk_table); > > - if (quirk & SOF_ES8336_ENABLE_DMIC) > - dmic_be_num = 2; > + if (!mach->mach_params.i2s_link_mask) { > + dev_warn(dev, "No I2S link information provided, using SSP0. This may need to be modified with the quirk module parameter\n"); > + } else { > + /* > + * Set configuration based on platform NHLT. > + * In this machine driver, we can only support one SSP for the > + * ES8336 link, the else-if below are intentional. > + * In some cases multiple SSPs can be reported by NHLT, starting MSB-first > + * seems to pick the right connection. > + */ > + unsigned long ssp = 0; > + > + if (mach->mach_params.i2s_link_mask & BIT(2)) > + ssp = SOF_ES8336_SSP_CODEC(2); > + else if (mach->mach_params.i2s_link_mask & BIT(1)) > + ssp = SOF_ES8336_SSP_CODEC(1); > + else if (mach->mach_params.i2s_link_mask & BIT(0)) > + ssp = SOF_ES8336_SSP_CODEC(0); > + > + quirk |= ssp; > + } > + > + if (mach->mach_params.dmic_num) > + quirk |= SOF_ES8336_ENABLE_DMIC; > > if (quirk_override != -1) { > dev_info(dev, "Overriding quirk 0x%lx => 0x%x\n", > @@ -483,6 +506,9 @@ static int sof_es8336_probe(struct platform_device *pdev) > } > log_quirks(dev); > > + if (quirk & SOF_ES8336_ENABLE_DMIC) > + dmic_be_num = 2; > + > sof_es8336_card.num_links += dmic_be_num + hdmi_num; > dai_links = sof_card_dai_links_create(dev, > SOF_ES8336_SSP_CODEC(quirk), > -- > 2.34.1 > > >