From nobody Mon Feb 9 18:43:36 2026 Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (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 EFDB041B34F for ; Fri, 6 Feb 2026 17:34:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770399281; cv=none; b=H2aFzccbq0zl/NM1ffyas6piE3pbkpJIYhqX1kBMB+hoztL+eeY579ku+o+eASW20Hh8LlhELo/i4QXtN3su5H9OCDSYJEleJhr19ovatGgSYKN5z5/n/9mmGAd1UZMHwMxqSRLRv6hl7ebvo3ElfYEa9qWcZJMCF4J4rAA/XQw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770399281; c=relaxed/simple; bh=xM19W5y6sBZhK63TGYfPq7Dcx+S+y11DhFbKJgJ2kiA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Blr+mdy5A0zDOu+tI/TUKb6SQYSjT73pEIJjmA6nU7TK0eOBtZqs0xo4we/TvfEhG4M7zqvTsY+ihwg98T6wO8buw9onDj6yvvAuQ/0KU3/tVczjU2hnfOpDUMgbEug52qkrEl23nUPgtWoJ+PGNNDNueQYjgRYrWWuNDyAEQXM= 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=LCBLrlXm; arc=none smtp.client-ip=209.85.221.42 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="LCBLrlXm" Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-4359a316d89so1963604f8f.0 for ; Fri, 06 Feb 2026 09:34:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770399279; x=1771004079; 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=LCBLrlXmGPDxM+vdCHjLYlxhSDszn0WfxISbJVKJYEL6IjQJ1WaSAFawaE1/hd6WjS lLgCj2wFxzIvz8BI23nSkEMKJMqTp8soqYS1qwQTGRiS6QMhn/PPdvSpIMo2GpomzJJ/ 6iA6MbKsouvpZeiKJrR80Ap6VjdwjEdLbkKQvJupfn4IDril9Je2mV06s2admJHaSyEa JocKfoX3+APeJxoitxyEgVs851iiNyT7JsHjUlJY5JGzy86/xN8Uea1FDceKrg8CGi3S TyoVLkxQtvOJU5aixf+ol+K3RwWPgu02gGdCg/5P4Gyq5FBM9zZUEl0kRzG5ExDXZPAI Bo6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770399279; x=1771004079; 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=Lny4din0UD8NBR6lCeJkaL/2ZtsyUkt4R+ETxW4/+1fWwmK+Gb9FWp2qVVlr8z2dFy qkXBkOpVz+E5YtBw/AkaDQctS+7l0zyypdctNmB0yfRZxGKMGabYyj54tNqr2G2cn53g u7OvAano3NnNTgnRjFpt51cWD3xj3TqCDLUxF9v7eyMFw3ugxFeKB+W6PYgl4hqj/vAi YGtbvCMYwWYGt8jB4qCmCBEpwmXEytxYAY/za652fvSbTsgOzhDCfIMZ12Ry8yuI01Gj 5JpZ0E6t4hNpfRGonDUqsGhDFeEcic+m9NfDziY1P59VGsWRGqKCJBaMUvFMjjwM4Go8 URBw== X-Forwarded-Encrypted: i=1; AJvYcCX8z/OCAH2RYG8aVUOUPq1RR5uOeZ175zbTHfI//TlnM/wFXVxePJBpXIcUUM2AiAe9UeFCQw3UlCbuMb4=@vger.kernel.org X-Gm-Message-State: AOJu0YwXiesK7LTqUMo6AaEFDB+c8D1yRNX45TUXTYuDx8WVrRHWSdBk b848xaaK4IIwr+fWzwjgMeQ5mPb2o1zywByMhWCiZ0KO7RcTZsWWJ+SG X-Gm-Gg: AZuq6aLXfiKMhnoiBb8U8tB+ftq5f8DZB/DAa6UKaJlqB7i+DKyKYNzkLm1+XSfeIRN fvzhT14ZKLWObtxkezTATjb01e4nAAIIlwPl0wVUAvvzAgr+jtasYx9nskyoZOk72Kc4+Naw0YN /hXtUsz7BBHejiXwWFU33TVoTGOGRblSAFvf/xAuGx45g2jG0OE7NAzbVYE8Se6PVXI8PqKbbIh gJJs9FHNhaozHnkHybEJaI+meba9TjAynDUzcB8X1KvrRgrEtp6E15h3rZEDqtSLxOdj6SKp7em JgvU5jKWuqGiDqZopozFfUo6BTT6NSiydBh9XjZJLsbITu8+/3mRWq41J+cFCVLROMc2f2F6xZQ 4WtKlUOTJ+HL228DiE6WQtxHKjjkqWC63YbTTNo7jT9i1b1g5CTongO0hpWUp14avERP9n5VtDC I7 X-Received: by 2002:a05:6000:186d:b0:433:42d1:f71f with SMTP id ffacd0b85a97d-4362934c50amr5948476f8f.38.1770399279228; Fri, 06 Feb 2026 09:34:39 -0800 (PST) Received: from xeon ([188.163.112.49]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-436296bd4a1sm7454523f8f.17.2026.02.06.09.34.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Feb 2026 09:34:38 -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 v2 2/5] ASoC: tegra: Support CPCAP by machine driver Date: Fri, 6 Feb 2026 19:34:19 +0200 Message-ID: <20260206173423.145954-3-clamor95@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260206173423.145954-1-clamor95@gmail.com> References: <20260206173423.145954-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