Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3281422pxj; Mon, 7 Jun 2021 07:00:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzt7tjg07xMSUIUCBFFjKJEv1MM7vNjD5RwDNl/WOJ2WLeXbJwomP3Y+0BovlcZvqL0dwpz X-Received: by 2002:a05:6402:10c9:: with SMTP id p9mr20262835edu.370.1623074440498; Mon, 07 Jun 2021 07:00:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623074440; cv=none; d=google.com; s=arc-20160816; b=j74C3jGoP8GPj5i0Dufi40uAQY9lLOZ+HtoquPyjTyHi+JYHwfbsljNTdXR8k3rx6U Tf9iFS/ESlg+z2kWWF3dMvm7kzclsQNyzm+WTnoF4l230dLGCBcE07EKv7QOBhsxwTy+ 8gjPYV2Ao7upn6Ea2es+zgihzJApfB1i9GAmDF0nh2r/Gds9gD9jFzVTuhuIMXMY3aWj Z2ByR4BAvdtZb4HXBTS6aqxpycnRItA6S4b8AbvaZFStGZHb7iJAxg6P/dVrT+1wBOOw ursfL4317lCwj8zxmlk/pPpCDXXVbR3AG1BNGS2qtUV7KJoMSIb5R2W7L2d69MCgP3zm 9TNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:ironport-sdr:ironport-sdr; bh=ZYKR0bsZn1V/a12MZiShsiZWONHWhoVFJ7OWR872nvY=; b=njyf3shiWDW2zPyBV+n//1Ar4U+GmVtjUNK63+jIOrUXZdounrINxx73UUicf69Mgm OlV//jbbPxikRab6KKapiNAkF1dXpD+4pkluIsCMPye3wsXbFwRWgIO1YRxBC2XAfVLI zsQvJorHFDl5NiDhHLcR1OStAeSRdZDyXnRO7HFLhBZOXF1hrVU558/8r1t66b1qtO5P 7ClZN+L7ycFbUa4ABg9a7Sw+5t0yt8nTeQLDWsnyjuUGfq+mU8vKrUcCOGLRuAy7sGQf 3XNNoHsywCZbDR5IrHWzLeuF3kmYz4EiVTT2lUv3KAPU7JIE5Qt083SbX20BEZqoabFx c5bg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g4si12412381ejj.325.2021.06.07.07.00.16; Mon, 07 Jun 2021 07:00:40 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230353AbhFGOAY (ORCPT + 99 others); Mon, 7 Jun 2021 10:00:24 -0400 Received: from mga09.intel.com ([134.134.136.24]:17126 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230328AbhFGOAX (ORCPT ); Mon, 7 Jun 2021 10:00:23 -0400 IronPort-SDR: 4JD6xIvLxFgEuMb8r1OqzqT34dgj/hC9G87UY67DViwk8lkeIGDIndUnJTMS5vh8sKlPm/pSVO IpKAUrLLXR5w== X-IronPort-AV: E=McAfee;i="6200,9189,10008"; a="204594342" X-IronPort-AV: E=Sophos;i="5.83,255,1616482800"; d="scan'208";a="204594342" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2021 06:58:31 -0700 IronPort-SDR: PMgHgFA2Pq/OzjyuHeOKRoET1itANVY6jX8ucvGI1shsQ8DmFZ0LxBPMfR/smLxxJFrKaSPKU/ Bogf+fx4AIKQ== X-IronPort-AV: E=Sophos;i="5.83,255,1616482800"; d="scan'208";a="401636390" Received: from flobatol-mobl1.amr.corp.intel.com (HELO [10.209.152.154]) ([10.209.152.154]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2021 06:58:29 -0700 Subject: Re: [PATCH 3/4] ASoC: intel: sof_cs42l42: add support for jsl_cs4242_mx98360a To: Brent Lu , alsa-devel@alsa-project.org Cc: Cezary Rojewski , Liam Girdwood , Jie Yang , Mark Brown , Jaroslav Kysela , Takashi Iwai , Rander Wang , Guennadi Liakhovetski , linux-kernel@vger.kernel.org, Ranjani Sridharan , Kai Vehmanen , Dharageswari R , Sathyanarayana Nujella , Bard Liao , Kuninori Morimoto , Naveen Manohar , Yong Zhi , Vamshi Krishna Gopal , Fred Oh , Tzung-Bi Shih References: <20210606004102.26190-1-brent.lu@intel.com> <20210606004102.26190-4-brent.lu@intel.com> From: Pierre-Louis Bossart Message-ID: <505c7e46-316c-9fa1-feaa-115f4561ed19@linux.intel.com> Date: Mon, 7 Jun 2021 08:40:44 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210606004102.26190-4-brent.lu@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/5/21 7:41 PM, Brent Lu wrote: > This patch adds driver data for jsl_cs4242_mx98360a which supports two > max98360a speaker amplifiers on SSP1 and cs42l42 headphone codec on > SSP0 running on JSL platform. DAI format is leveraged from sof_rt5682 > machine driver to reuse the topology. This also looks like we have two topologies configuring the same DAIs differently on different platforms. Why can't we pick one configuration that would work in all cases? > Also use module device table to replace module alias. Humm, this looks like a missing dependency, I modified this a while ago. > > Signed-off-by: Brent Lu > --- > sound/soc/intel/boards/sof_cs42l42.c | 22 +++++++++++++++---- > .../intel/common/soc-acpi-intel-jsl-match.c | 8 +++++++ > 2 files changed, 26 insertions(+), 4 deletions(-) > > diff --git a/sound/soc/intel/boards/sof_cs42l42.c b/sound/soc/intel/boards/sof_cs42l42.c > index e3171242f612..d712cfb91fd1 100644 > --- a/sound/soc/intel/boards/sof_cs42l42.c > +++ b/sound/soc/intel/boards/sof_cs42l42.c > @@ -36,7 +36,9 @@ > #define SOF_CS42L42_NUM_HDMIDEV_MASK (GENMASK(9, 7)) > #define SOF_CS42L42_NUM_HDMIDEV(quirk) \ > (((quirk) << SOF_CS42L42_NUM_HDMIDEV_SHIFT) & SOF_CS42L42_NUM_HDMIDEV_MASK) > -#define SOF_MAX98357A_SPEAKER_AMP_PRESENT BIT(10) > +#define SOF_CS42L42_BCLK_2400000 BIT(10) > +#define SOF_MAX98357A_SPEAKER_AMP_PRESENT BIT(11) > +#define SOF_MAX98360A_SPEAKER_AMP_PRESENT BIT(12) > > /* Default: SSP2 */ > static unsigned long sof_cs42l42_quirk = SOF_CS42L42_SSP_CODEC(2); > @@ -122,7 +124,10 @@ static int sof_cs42l42_hw_params(struct snd_pcm_substream *substream, > struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); > int clk_freq, ret; > > - clk_freq = 3072000; /* BCLK freq */ > + if (sof_cs42l42_quirk & SOF_CS42L42_BCLK_2400000) > + clk_freq = 2400000; /* BCLK freq */ > + else > + clk_freq = 3072000; /* BCLK freq */ > > /* Configure sysclk for codec */ > ret = snd_soc_dai_set_sysclk(codec_dai, 0, > @@ -281,6 +286,8 @@ static int create_spk_amp_dai_links(struct device *dev, > > if (sof_cs42l42_quirk & SOF_MAX98357A_SPEAKER_AMP_PRESENT) { > max_98357a_dai_link(&links[*id]); > + } else if (sof_cs42l42_quirk & SOF_MAX98360A_SPEAKER_AMP_PRESENT) { > + max_98360a_dai_link(&links[*id]); > } else { > dev_err(dev, "no amp defined\n"); > ret = -EINVAL; > @@ -584,8 +591,17 @@ static const struct platform_device_id board_ids[] = { > SOF_MAX98357A_SPEAKER_AMP_PRESENT | > SOF_CS42L42_SSP_AMP(1)), > }, > + { > + .name = "jsl_cs4242_mx98360a", > + .driver_data = (kernel_ulong_t)(SOF_CS42L42_SSP_CODEC(0) | > + SOF_SPEAKER_AMP_PRESENT | > + SOF_MAX98360A_SPEAKER_AMP_PRESENT | > + SOF_CS42L42_SSP_AMP(1)) | > + SOF_CS42L42_BCLK_2400000, > + }, > { } > }; > +MODULE_DEVICE_TABLE(platform, board_ids); > > static struct platform_driver sof_audio = { > .probe = sof_audio_probe, > @@ -601,7 +617,5 @@ module_platform_driver(sof_audio) > MODULE_DESCRIPTION("SOF Audio Machine driver for CS42L42"); > MODULE_AUTHOR("Brent Lu "); > MODULE_LICENSE("GPL"); > -MODULE_ALIAS("platform:sof_cs42l42"); > -MODULE_ALIAS("platform:glk_cs4242_max98357a"); > MODULE_IMPORT_NS(SND_SOC_INTEL_HDA_DSP_COMMON); > MODULE_IMPORT_NS(SND_SOC_INTEL_SOF_MAXIM_COMMON); > diff --git a/sound/soc/intel/common/soc-acpi-intel-jsl-match.c b/sound/soc/intel/common/soc-acpi-intel-jsl-match.c > index 73fe4f89a82d..8e86476d48de 100644 > --- a/sound/soc/intel/common/soc-acpi-intel-jsl-match.c > +++ b/sound/soc/intel/common/soc-acpi-intel-jsl-match.c > @@ -73,6 +73,14 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_jsl_machines[] = { > .quirk_data = &mx98360a_spk, > .sof_tplg_filename = "sof-jsl-rt5682-mx98360a.tplg", > }, > + { > + .id = "10134242", > + .drv_name = "jsl_cs4242_mx98360a", > + .sof_fw_filename = "sof-jsl.ri", > + .machine_quirk = snd_soc_acpi_codec_list, > + .quirk_data = &mx98360a_spk, > + .sof_tplg_filename = "sof-jsl-rt5682-mx98360a.tplg", > + }, > {}, > }; > EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_jsl_machines); >