Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2077638ioo; Mon, 23 May 2022 09:34:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzP8qmA4R01PBCqkgha9EYWIynsFJmKNP5kpvP5nhnzPjPHBKiOXoR/MoBTU2niHTTnHQa X-Received: by 2002:aa7:888c:0:b0:505:7832:98fc with SMTP id z12-20020aa7888c000000b00505783298fcmr24245751pfe.0.1653323684614; Mon, 23 May 2022 09:34:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653323684; cv=none; d=google.com; s=arc-20160816; b=i7dBLapccbsXPotSf0QuH9QLKAolDc5GvUD/cEE/JzJGJc3A9GmkVatt6E/RI4Jkfx 8BOvg1vB5TzJcEYaW3+PW/hj05hbljrETiIh1hpsyXzs4DZUtD4AvvwIoFPTdsnwdBix yJS6m7SqCaeJ0Iy1/7bbEdMsP/joXJCCnYMxXOxGfB9Wn/lvRbpt1xEv2smwx7o1v7Nk uY0K5knkDbt3xOa05fEfgM184AFc0YQ+WPXarXTF3kffEgTSKs+ziuyh+HBPci7rfJnl b1CDxCh97TKNflhgoS6Fi0jJxemK43LFKS5jtwjVFjsDkvU1t/VfcllpASUeaZFE/Mo+ rlSg== 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=G/XA8ganN6D8SJro5978H4m5Fr+5l+LHKXISgC45i6U=; b=oad2fiwFcdQnjOTsQ8f7DfYTjViBXfDkekW2UDb4cbutetESSZi/PVYaqhoPJRLZU1 GdWx0DA1+NSKONDjBzYPBdy4KQOu1kui0AuCjv+DCZMHYBcT7Bp0crPrQ6SGiQJbe1EP biuAJ8kK0bzN6uxza7TCoCHCLlPnR/dwJG3rfT38c9LaJMgfBU/az0FLp1s81EkeyNZS qVOoeAYDUneAiIywK7RFvnMmOJUWeT+dJPpVcypEejgKW/+kg6vVSFphXw+j5KA7Kmcf OAfBXBpy6UNJDmMM/Y7kAXpiRvSljmdKUq3jPeGTQuq7/IAMR+L+//TW0CM+l7R67VO0 8fiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=V4gZGewx; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id co20-20020a17090afe9400b001dc681e0241si12936138pjb.27.2022.05.23.09.34.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 09:34:44 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=V4gZGewx; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C9832692AB; Mon, 23 May 2022 09:34:39 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238959AbiEWQee (ORCPT + 99 others); Mon, 23 May 2022 12:34:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238906AbiEWQec (ORCPT ); Mon, 23 May 2022 12:34:32 -0400 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 330AF68316 for ; Mon, 23 May 2022 09:34:31 -0700 (PDT) Received: by mail-ej1-x62b.google.com with SMTP id jx22so16541391ejb.12 for ; Mon, 23 May 2022 09:34:31 -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=G/XA8ganN6D8SJro5978H4m5Fr+5l+LHKXISgC45i6U=; b=V4gZGewx8jIJhhKQRA3xFN/sZpiyapULO/rXmi27p0MmEibaEgQ8lH/+ejDyKRD2aK JmXLAC7N1DBNvBcq6khSV/szTMTFxbwPoyH9ag/RcgAZaLNvfFa3NkmSZnlOFIpQRGBG HFWAMTzc4Rih6kdSZ+4g38GMRpnnlGT5Wdqqc9FBi+RFYs78DfAuap/qX/8zm5NqMwNf /4H1Fb+2qzFVUINXJzpsdgOq38PEpU6MP0ML/oB1mqpNOYziflnFlyEbbEs4QQo6/+k8 e56iow3cMFrFf4soDANOpi2DTNdbdI7R93SpDItrN+4tg+aL6OKiO4E5MZ95N9GZFqWc 84IQ== 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=G/XA8ganN6D8SJro5978H4m5Fr+5l+LHKXISgC45i6U=; b=2VEqFLBtlBXdhzvLS42w+OHtYh4jJL4yAvJx2SaMy9sTO1vU9bHVnRBw7Md65QTyyg Z2ik/peOh8v32VjysEzx/l/oRMr9hPVPNG7yVKDYMSh11XB2rUnyUz3atDZQec+1obvK 7ZRsJS1pC0TdgPtgT7VK/ADOSrFlSnjStaOpMqX+hcOsLmJuQAVyaw/ca27wrBJ5Mjif N5aFHaDd8j3C1Ko1SmnKvBC+T15MKK+r/5wmP+RU1K3LQpuvKR1hABV7RoUwOXqdnkgO mMWfviDHR4iqroIEG7LZQiTCj02AOdsqH2PvdlH8eGAS1TQxIcRZoyYeJ+hczPJF68QV SvzA== X-Gm-Message-State: AOAM532TXUC0Dk4lRjef46zYinC07yP20mHauRHkgXFhvuaA/os2rWnY b5alK2DWmSEosmg+WH9/RFwL7WHMDkHI4PMj9OhxGA== X-Received: by 2002:a17:907:3f19:b0:6f5:6b2:9615 with SMTP id hq25-20020a1709073f1900b006f506b29615mr21628853ejc.659.1653323669337; Mon, 23 May 2022 09:34:29 -0700 (PDT) MIME-Version: 1.0 References: <20220518013140.1467326-1-terry_chen@wistron.corp-partner.google.com> <00e58668-ca30-0048-6cd1-b2dd4ad66d7a@linux.intel.com> In-Reply-To: From: Curtis Malainey Date: Mon, 23 May 2022 09:34:18 -0700 Message-ID: Subject: Re: [v6] FROMLIST: ASoC: Intel: sof_cs42l42: adding support for ADL configuration and BT offload audio To: Terry Chen Cc: Pierre-Louis Bossart , ALSA development , Cezary Rojewski , Liam Girdwood , Jie Yang , Mark Brown , Jaroslav Kysela , Takashi Iwai , "Lu, Brent" , Curtis Malainey , Sean Paul , "Bowman, Casey G" , Mark Hsieh , "Gopal, Vamshi Krishna" , Mac Chiang , Kai Vehmanen , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL 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, May 17, 2022 at 8:34 PM Terry Chen wrote: > > Hi Pierre > > We upload v7 patch to follow the coding style as other components. Thanks > > On Wed, May 18, 2022 at 10:02 AM Pierre-Louis Bossart wrote: >> >> >> >> On 5/17/22 20:31, Terry Chen wrote: >> > To be able to do driver data for adl_mx98360a_cs4242 which supports >> > two max98360a speaker amplifiers on SSP1 and cs42l42 headphone codec >> > on SSP0 running on ADL platform. Also add the capability to machine driver >> > of creating DAI Link for BT offload. Although BT offload always uses SSP2 >> > port but we reserve the flexibility to assign the port number in macro. >> > >> > Signed-off-by: Terry Chen >> > (am from https://patchwork.kernel.org/patch/12845884/) >> > (also found at https://lore.kernel.org/r/20220511075522.1764114-1-terry_chen@wistron.corp-partner.google.com) >> >> not sure what this is about, what's the point of adding information on >> the v5 in the v6 patch? Hi Terry, I think Pierre's confusion here is that you used chromeos style guides but didn't upload to gerrit, you sent it to ALSA. When sending to ALSA you should use the kernel style guides upstream. >> >> > >> > --- >> > sound/soc/intel/boards/sof_cs42l42.c | 92 ++++++++++++++++++- >> > .../intel/common/soc-acpi-intel-adl-match.c | 7 ++ >> > 2 files changed, 95 insertions(+), 4 deletions(-) >> > >> > diff --git a/sound/soc/intel/boards/sof_cs42l42.c b/sound/soc/intel/boards/sof_cs42l42.c >> > index ce78c18798876..2efffc7933479 100644 >> > --- a/sound/soc/intel/boards/sof_cs42l42.c >> > +++ b/sound/soc/intel/boards/sof_cs42l42.c >> > @@ -41,8 +41,13 @@ >> > #define SOF_CS42L42_DAILINK_MASK (GENMASK(24, 10)) >> > #define SOF_CS42L42_DAILINK(link1, link2, link3, link4, link5) \ >> > ((((link1) | ((link2) << 3) | ((link3) << 6) | ((link4) << 9) | ((link5) << 12)) << SOF_CS42L42_DAILINK_SHIFT) & SOF_CS42L42_DAILINK_MASK) >> > -#define SOF_MAX98357A_SPEAKER_AMP_PRESENT BIT(25) >> > -#define SOF_MAX98360A_SPEAKER_AMP_PRESENT BIT(26) >> > +#define SOF_BT_OFFLOAD_PRESENT BIT(25) >> > +#define SOF_CS42L42_SSP_BT_SHIFT 26 >> > +#define SOF_CS42L42_SSP_BT_MASK (GENMASK(28, 26)) >> > +#define SOF_CS42L42_SSP_BT(quirk) \ >> > + (((quirk) << SOF_CS42L42_SSP_BT_SHIFT) & SOF_CS42L42_SSP_BT_MASK) >> > +#define SOF_MAX98357A_SPEAKER_AMP_PRESENT BIT(29) >> > +#define SOF_MAX98360A_SPEAKER_AMP_PRESENT BIT(30) >> > >> > enum { >> > LINK_NONE = 0, >> > @@ -50,6 +55,7 @@ enum { >> > LINK_SPK = 2, >> > LINK_DMIC = 3, >> > LINK_HDMI = 4, >> > + LINK_BT = 5, >> > }; >> > >> > /* Default: SSP2 */ >> > @@ -278,6 +284,13 @@ static struct snd_soc_dai_link_component dmic_component[] = { >> > } >> > }; >> > >> > +static struct snd_soc_dai_link_component dummy_component[] = { >> > + { >> > + .name = "snd-soc-dummy", >> > + .dai_name = "snd-soc-dummy-dai", >> > + } >> > +}; >> > + >> > static int create_spk_amp_dai_links(struct device *dev, >> > struct snd_soc_dai_link *links, >> > struct snd_soc_dai_link_component *cpus, >> > @@ -467,9 +480,56 @@ static int create_hdmi_dai_links(struct device *dev, >> > return -ENOMEM; >> > } >> > >> > +static int create_bt_offload_dai_links(struct device *dev, >> > + struct snd_soc_dai_link *links, >> > + struct snd_soc_dai_link_component *cpus, >> > + int *id, int ssp_bt) >> > +{ >> > + int ret = 0; >> >> either you remove this useless init... >> >> > + >> > + /* bt offload */ >> > + if (!(sof_cs42l42_quirk & SOF_BT_OFFLOAD_PRESENT)) >> > + return 0; >> > + >> > + links[*id].name = devm_kasprintf(dev, GFP_KERNEL, "SSP%d-BT", >> > + ssp_bt); >> > + if (!links[*id].name) { >> > + ret = -ENOMEM; >> > + goto devm_err; >> > + } >> > + >> > + links[*id].id = *id; >> > + links[*id].codecs = dummy_component; >> > + links[*id].num_codecs = ARRAY_SIZE(dummy_component); >> > + links[*id].platforms = platform_component; >> > + links[*id].num_platforms = ARRAY_SIZE(platform_component); >> > + >> > + links[*id].dpcm_playback = 1; >> > + links[*id].dpcm_capture = 1; >> > + links[*id].no_pcm = 1; >> > + links[*id].cpus = &cpus[*id]; >> > + links[*id].num_cpus = 1; >> > + >> > + links[*id].cpus->dai_name = devm_kasprintf(dev, GFP_KERNEL, >> > + "SSP%d Pin", >> > + ssp_bt); >> > + if (!links[*id].cpus->dai_name) { >> > + ret = -ENOMEM; >> > + goto devm_err; >> > + } >> > + >> > + (*id)++; >> > + >> > + return 0; >> >> ... or you remove the return 0; >> >> pick one. >> >> > + >> > +devm_err: >> > + return ret; >> > +} >> > + >> >> > }, >> > + { >> > + .id = "10134242", >> > + .drv_name = "adl_mx98360a_cs4242", >> > + .machine_quirk = snd_soc_acpi_codec_list, >> > + .quirk_data = &adl_max98360a_amp, >> > + .sof_tplg_filename = "sof-adl-max98360a-rt5682.tplg", >> >> No, I've told this before in previous reviews: do not use a topology >> name that was designed for a different platform, this is not >> maintainable. If the topologies happen to be the same, either generate >> them twice or use a symlink.