From nobody Thu Apr 2 06:27:20 2026 Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com [209.85.208.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1B725349B15 for ; Mon, 23 Feb 2026 06:51:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771829467; cv=none; b=AbQMob5hLgUbuajBhvpAKPief29P2EWzG9czZr02ixCjaE7E/k1ezi5zWyWuKE5QF254xihYZFqu2vDx7b6IF1ka4krZrvp4fVhXpX3wjhZYSNc19E4dQQcrZBuuSTAN1IG5S2vlRGVbLQty6cfX/P/vB0abrYXqyqMlxD7r5bc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771829467; c=relaxed/simple; bh=xM19W5y6sBZhK63TGYfPq7Dcx+S+y11DhFbKJgJ2kiA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lnJvzgMXOFUVr4/nzNHTVzIDLko2LSmoc5AotG0awt9Pl/RMoKL31h0oZeEilfHWEqwP2VDdQCneB9WjUfnLFBNqbWJBaf3P+RFdctcoDUmFXU6DGfFjrKybP5PYhO/Et+f9Y17y3Ne20RTEM8KB7VM+aeMSedk9Qsbm+nHV5Fk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Nfsy6irm; arc=none smtp.client-ip=209.85.208.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Nfsy6irm" Received: by mail-lj1-f178.google.com with SMTP id 38308e7fff4ca-3870acaf78eso30785631fa.2 for ; Sun, 22 Feb 2026 22:51:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771829463; x=1772434263; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=S1uE9SbozYnquR9REkQsKIr4GVqaAJFPEg6pyN2tdEE=; b=Nfsy6irm/G6PU5E6FlxjQLziaEQQ8DAyWyGFPyDuCVBagpPV1VnkQ668fESXaAqCGh nIUr/nnjpV/uc7o2NwNfSpds5Vjyu/0Vm1NUJKwr52gTdjgIGc36F8uNPuQqILbjqUW/ ZruowoNcKs9Z+HtBKXNTYC4rl2vIYRbNr0t+UAe4LsYZvmFNIo1H5rWFuuo/4PtHiiqE lgrfE8gRuaVEO6VcMxPSWYF1+eZp7ETycmiyf9DBdP0L2B9FLt/P9FvwiAjNNiKlQwLP Tykty6M8+atmkiRlvF8koqhKm8e+zkiJreKVwtMshXQQk5ZkjvLdzwG88HIXBl7MDCYc fNvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771829463; x=1772434263; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=S1uE9SbozYnquR9REkQsKIr4GVqaAJFPEg6pyN2tdEE=; b=qJ5UYx9nC3G+uK+z3a4ziWwAxgWt1WEb4fkEmbvVyUSYdUPcqqOfIOOa7uIb+tlodH iElY6n4ojifuopTpvWE9a6u3FaMvneHvhKKhgjs5FX0tH1q/rIWOAlAPuxYUfMJ9Z+ek 0cicNSOxlhgxZ/xovEJ0Xv/BS4Smt9LJtECJVqTkRTG2N5kwSkWThE+xQVRYueYLO/Iz Q68joGjBCx5n5JIe5Joz9nr0/5NGY29tphOebd+ZdpprfrVFHXp1VrD1zToYaFTod83D Nab/JEZoEFCpFLcK4TVDbrpb6WmIeRGfv8U+tuMivumJbaX8DFpYpVOEJIa3EesHPlgn cR5w== X-Forwarded-Encrypted: i=1; AJvYcCUL2FhDkh6PTepZy/48u427y+zmMkozjg4RiwpuwSXv5qpHKLbu2JQe4rWVWjiG6K0/Rc87kdfVwVKXgQA=@vger.kernel.org X-Gm-Message-State: AOJu0YyDs2p5oeoxYZnKbmNcvBbOBTJ79DFObGsroy5Dndm1tIGSVMaO yyNCKsGZiqugbs6XD76avZcx4SZwgMm8kg6Tg1TuMGDWZTx5ODi/o0Sh X-Gm-Gg: AZuq6aJQpx8GuaDcS1ymDHSX029ZlilkNiZKJdHYhhxQ8FTlHs3cxLtL2O4+W9JF7Jl 1Hk5qAVJkhyOwPt7ew3KPXVRD1pS3p5Hyu7sjY0G65W27ZmZk0tc48TO5Ak3Hxm5Rc56nc4aqn1 bcEHJ+2B/63/J/7JA8W1Sb7kGxxK3c+EcstLosfKAS3cnqM3+eTwFymiesa35+df3u0hFuG0p8g AH7bKIWxjwLtkwb6Ys7Ecom2D8pJ1FIlNRiMjoL4l+7ncZMbxdonBuJrLZQpl91bn+7jTHGddlN Y4yzjML7/qAX0pp9ISBGDWhWRV15cXsNSUQm33WEwp/HSoudeJsen1tHNYyolS7Qaa8msxa8Wp9 jwbOITC+m9ZUOnJRgikT8RzSEolKSTs3V3PdVHqRlUozbfUmooB013M65NIL8eKZSWxIpxoI+z7 hR08U+bSwlffx4 X-Received: by 2002:a05:651c:1ca:b0:386:fdcd:b2c4 with SMTP id 38308e7fff4ca-389a5e6d6f7mr20783041fa.35.1771829462597; Sun, 22 Feb 2026 22:51:02 -0800 (PST) Received: from xeon ([188.163.112.76]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-389a78b4a45sm13916521fa.13.2026.02.22.22.51.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Feb 2026 22:51:02 -0800 (PST) From: Svyatoslav Ryhel To: Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Thierry Reding , Jonathan Hunter , Jaroslav Kysela , Takashi Iwai , Svyatoslav Ryhel , =?UTF-8?q?Jonas=20Schw=C3=B6bel?= Cc: linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 2/5] ASoC: tegra: Support CPCAP by machine driver Date: Mon, 23 Feb 2026 08:50:48 +0200 Message-ID: <20260223065051.13070-3-clamor95@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260223065051.13070-1-clamor95@gmail.com> References: <20260223065051.13070-1-clamor95@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add CPCAP codec support to the Tegra ASoC machine driver. This codec is found in Motorola T20 devices like Atrix 4G and Droid X2. Signed-off-by: Svyatoslav Ryhel --- sound/soc/tegra/Kconfig | 9 +++++ sound/soc/tegra/tegra_asoc_machine.c | 52 ++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) diff --git a/sound/soc/tegra/Kconfig b/sound/soc/tegra/Kconfig index 9dbd589879fb..dd58525b7079 100644 --- a/sound/soc/tegra/Kconfig +++ b/sound/soc/tegra/Kconfig @@ -294,6 +294,15 @@ config SND_SOC_TEGRA_SGTL5000 boards using the SGTL5000 codec, such as Apalis T30, Apalis TK1 or Colibri T30. =20 +config SND_SOC_TEGRA_CPCAP + tristate "SoC Audio support for Tegra boards using a CPCAP codec" + depends on I2C && GPIOLIB && MFD_CPCAP + select SND_SOC_TEGRA_MACHINE_DRV + select SND_SOC_CPCAP + help + Say Y or M here if you want to add support for SoC audio on Tegra + boards using the CPCAP codec, such as Motorola Atrix 4G or Droid X2. + endif =20 endmenu diff --git a/sound/soc/tegra/tegra_asoc_machine.c b/sound/soc/tegra/tegra_a= soc_machine.c index d48463ac16fc..10834f9c3422 100644 --- a/sound/soc/tegra/tegra_asoc_machine.c +++ b/sound/soc/tegra/tegra_asoc_machine.c @@ -287,6 +287,25 @@ static unsigned int tegra_machine_mclk_rate_6mhz(unsig= ned int srate) return mclk; } =20 +static unsigned int tegra_machine_mclk_rate_cpcap(unsigned int srate) +{ + unsigned int mclk; + + switch (srate) { + case 11025: + case 22050: + case 44100: + case 88200: + mclk =3D 26000000; + break; + default: + mclk =3D 256 * srate; + break; + } + + return mclk; +} + static int tegra_machine_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) { @@ -985,6 +1004,38 @@ static const struct tegra_asoc_data tegra_rt5631_data= =3D { .add_hp_jack =3D true, }; =20 +/* CPCAP machine */ + +SND_SOC_DAILINK_DEFS(cpcap_hifi, + DAILINK_COMP_ARRAY(COMP_EMPTY()), + DAILINK_COMP_ARRAY(COMP_CODEC(NULL, "cpcap-hifi")), + DAILINK_COMP_ARRAY(COMP_EMPTY())); + +static struct snd_soc_dai_link tegra_cpcap_dai =3D { + .name =3D "CPCAP", + .stream_name =3D "CPCAP PCM", + .init =3D tegra_asoc_machine_init, + .dai_fmt =3D SND_SOC_DAIFMT_I2S | + SND_SOC_DAIFMT_NB_NF | + SND_SOC_DAIFMT_CBP_CFP, + SND_SOC_DAILINK_REG(cpcap_hifi), +}; + +static struct snd_soc_card snd_soc_tegra_cpcap =3D { + .components =3D "codec:cpcap", + .dai_link =3D &tegra_cpcap_dai, + .num_links =3D 1, + .fully_routed =3D true, +}; + +static const struct tegra_asoc_data tegra_cpcap_data =3D { + .mclk_rate =3D tegra_machine_mclk_rate_cpcap, + .card =3D &snd_soc_tegra_cpcap, + .add_common_dapm_widgets =3D true, + .add_common_controls =3D true, + .add_common_snd_ops =3D true, +}; + static const struct of_device_id tegra_machine_of_match[] =3D { { .compatible =3D "nvidia,tegra-audio-trimslice", .data =3D &tegra_trimsl= ice_data }, { .compatible =3D "nvidia,tegra-audio-max98090", .data =3D &tegra_max9809= 0_data }, @@ -997,6 +1048,7 @@ static const struct of_device_id tegra_machine_of_matc= h[] =3D { { .compatible =3D "nvidia,tegra-audio-rt5640", .data =3D &tegra_rt5640_da= ta }, { .compatible =3D "nvidia,tegra-audio-alc5632", .data =3D &tegra_rt5632_d= ata }, { .compatible =3D "nvidia,tegra-audio-rt5631", .data =3D &tegra_rt5631_da= ta }, + { .compatible =3D "nvidia,tegra-audio-cpcap", .data =3D &tegra_cpcap_data= }, {}, }; MODULE_DEVICE_TABLE(of, tegra_machine_of_match); --=20 2.51.0