From patchwork Thu Apr 11 22:03:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 787971 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 79746C4345F for ; Thu, 11 Apr 2024 22:34:01 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id D68AB2C20; Fri, 12 Apr 2024 00:33:49 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D68AB2C20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1712874839; bh=V80U71ZVk1BSbUWzsi/2PM4s6/P91O4qwdizAbM2i2A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=dr2Izh4FTfxcbdCvQnaj4Mxkm/XRPpYL8lsh0a4Q5c5W1kO5cdJI5C4gmL6pNyqDT rVR6hx8Qv6OaV1V9RkHWkTJlmN7Ro3N70tJ9WEpofJadUKmwRyfWmnMyKbWvUNWQRh YHqq3v64VUMbcs/e9kJd+zqLncmuUb39SA9LtkH8= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 018F5F8069C; Fri, 12 Apr 2024 00:32:07 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 04426F8069A; Fri, 12 Apr 2024 00:32:07 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 44B32F80236; Fri, 12 Apr 2024 00:16:50 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 343B3F80579 for ; Fri, 12 Apr 2024 00:04:27 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 343B3F80579 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=KRRc2AsL DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1712873069; x=1744409069; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=V80U71ZVk1BSbUWzsi/2PM4s6/P91O4qwdizAbM2i2A=; b=KRRc2AsLBcvQgWjB5zFdfmH/x1bBk2BwvvX/Yd9MSzruMeb8tPyDfGOK pE0qDOQmz+FHQvG2ydBHh4ULChJ7Z0sKF/k1c0mKFLq8+0Ubz41++0FAQ bPwIESvWbhZDKnbzlzrjfmN1UbYZ3+/Lrvmh66u8+KOZsy83RVVt/BUUz ZtWWqQL63e0eycyHoU05hu6isxED8udpunSQhnpkoiaXcYdukD0DtSXkJ I/Bry0/12Hg+EzOfedr4HdM1JvfBUk4EGDzAOYzyE/jh1pBFuBHVPtvbT SzIckD1rfSuRNNkBgvrDgMpBWrBHvLQhPxeWuTLmoJ1XcBXinEa6qF5MA A==; X-CSE-ConnectionGUID: PEwojOc2RHaewcNgqd6PAQ== X-CSE-MsgGUID: lMVzGFl3T2KQta61oQbTqA== X-IronPort-AV: E=McAfee;i="6600,9927,11041"; a="19708382" X-IronPort-AV: E=Sophos;i="6.07,194,1708416000"; d="scan'208";a="19708382" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Apr 2024 15:04:20 -0700 X-CSE-ConnectionGUID: bIENvs6YTASXeV35ZC/E2w== X-CSE-MsgGUID: QrMlRKCdSeWXMnRWhgs61Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,194,1708416000"; d="scan'208";a="21628764" Received: from aramana1-mobl.amr.corp.intel.com (HELO pbossart-mobl6.lan) ([10.213.177.233]) by orviesa008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Apr 2024 15:04:19 -0700 From: Pierre-Louis Bossart To: linux-sound@vger.kernel.org Cc: alsa-devel@alsa-project.org, tiwai@suse.de, broonie@kernel.org, Brent Lu , Chao Song , Pierre-Louis Bossart Subject: [PATCH 10/12] ASoC: Intel: sof_rt5682: support ALC1011 on cml boards Date: Thu, 11 Apr 2024 17:03:45 -0500 Message-Id: <20240411220347.131267-11-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240411220347.131267-1-pierre-louis.bossart@linux.intel.com> References: <20240411220347.131267-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: WA334MY6OLCT7RT32AMZ4DCD22FTZYCM X-Message-ID-Hash: WA334MY6OLCT7RT32AMZ4DCD22FTZYCM X-MailFrom: pierre-louis.bossart@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: <> List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Brent Lu For cml boards, ALC1011 speaker amplifier is supported by machine driver cml_rt1011_rt5682. Use same driver name for backward compatibility with existing devices on market. Reviewed-by: Chao Song Signed-off-by: Brent Lu Signed-off-by: Pierre-Louis Bossart --- sound/soc/intel/boards/sof_rt5682.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/sound/soc/intel/boards/sof_rt5682.c b/sound/soc/intel/boards/sof_rt5682.c index 326d23dd79de..735e07ea62bd 100644 --- a/sound/soc/intel/boards/sof_rt5682.c +++ b/sound/soc/intel/boards/sof_rt5682.c @@ -606,6 +606,7 @@ static int sof_audio_probe(struct platform_device *pdev) { struct snd_soc_acpi_mach *mach = pdev->dev.platform_data; struct sof_card_private *ctx; + char *card_name; bool is_legacy_cpu = false; int ret; @@ -631,14 +632,27 @@ static int sof_audio_probe(struct platform_device *pdev) return -ENOMEM; if (ctx->codec_type == CODEC_RT5650) { - sof_audio_card_rt5682.name = devm_kstrdup(&pdev->dev, "rt5650", - GFP_KERNEL); + card_name = devm_kstrdup(&pdev->dev, "rt5650", GFP_KERNEL); + if (!card_name) + return -ENOMEM; + + sof_audio_card_rt5682.name = card_name; /* create speaker dai link also */ if (ctx->amp_type == CODEC_NONE) ctx->amp_type = CODEC_RT5650; } + if (ctx->amp_type == CODEC_RT1011 && soc_intel_is_cml()) { + /* backward-compatible with existing cml devices */ + card_name = devm_kstrdup(&pdev->dev, "cml_rt1011_rt5682", + GFP_KERNEL); + if (!card_name) + return -ENOMEM; + + sof_audio_card_rt5682.name = card_name; + } + if (is_legacy_cpu) { ctx->rt5682.is_legacy_cpu = true; ctx->dmic_be_num = 0;