From nobody Thu Apr 2 03:19:03 2026 Received: from mail-ed1-f68.google.com (mail-ed1-f68.google.com [209.85.208.68]) (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 1F25CDF76 for ; Mon, 23 Feb 2026 08:48:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.68 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771836538; cv=none; b=ajRJQ3RgXz53f7JVBr5nzxx8uNMGQnqehdkvvPBrRIzxf8sG+ITrAUtSXY+zh6S/d9FkTB+teBuimDJmCUxauX+73cT+QmZ/AYsTHQS+w+deB+0PzCKEVhphuRzhnDWy8KAyMQpyGQjImBtdCLHlqeoP9UDwuF0iVTHDjLIl6qM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771836538; c=relaxed/simple; bh=QeLyuN/2seU7NDyjmTtE2l7+boc7LAWG8fBCNm5LX8M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tSBf2u+dCIOZBXU2G6gtv1Sc1QveeVjVw85oCnBDO2dw6FqjsLXqdAAygJtIXMwPqbanvhgQNDcsGZkCJNDzMZdk8lyMEoh1y/Vw9xB7xHs+2FiEH5BiwolRcXtK5/dRZrGr3QbutQ6eBzT3yzP9Ky4e4KH4vegLnvfofHO8mxk= 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=aNRDhNFM; arc=none smtp.client-ip=209.85.208.68 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="aNRDhNFM" Received: by mail-ed1-f68.google.com with SMTP id 4fb4d7f45d1cf-65c0e2cbde1so6886284a12.0 for ; Mon, 23 Feb 2026 00:48:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771836535; x=1772441335; 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=wwfoQIZP8rgjlqT6i1sqvtnJ8vCvBM4mV5XScfELGpI=; b=aNRDhNFM0qxrcLHIzeZeNMbSG9rncYqOZJqUpyXZfyrxWXGuAoDhrRXiyUTx1U8mJM PR6qz0/dFhfiOn0NZVdBTL5W/fGP3kpbOIzUhSpaH+jkxVyrBdANUQ+/MMqXMs/JYpAC /jOzBdMTTcDdIUa53gbd4KSVLczg7YYLls7zaPPVGoifamcJZyY2fIGKTKx1ZVkyNMf0 HUJhop5pf3zDb02iDnq4OJOHP6TIojZIh8zLw4t4wVp6ksh8f4U41R7jLTlMxHA2ZcpO s78bJrorlimdyC5+IiuqqttvYcjSqdxz8UX3Mjvp104JhPlfkYJVe5JlYjLFYYzKHgJh oAgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771836535; x=1772441335; 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=wwfoQIZP8rgjlqT6i1sqvtnJ8vCvBM4mV5XScfELGpI=; b=rPlMDyLPBGq2UFBN+tyiWIKjlzo1dc8Do8NUNPEpqNTBm8fsZDk+L8aAmLrrK89ScO r/O2gD65WlaBVsMVrCObXWZtSXKxajzJFw3cdFx5UtUkGcmp0aFqrtTO1oiVqGR5eFro 5yZiMb4EfYODUU6u0SFwR83mjsQxSz1cV1B/MA4/lLBgL5TsqKni9nWg1UG1UdbcGnEf KjCsw+D7GBrMuaKwLqA3BamO12wZraGZzT/4XXXrRXKunxoRaU7DLiRoCj6NIBQhYJGH 9GrLYKzQMTzdHDH8ef9SG0rGld9djQTP6cZ9eT7PZ/tVvTDOJ7yu1IhU9QxPIYFXIMsD mhEg== X-Forwarded-Encrypted: i=1; AJvYcCXxs2zkcNgbAVEcB7K0MFwVGcPbuSTG3+TADFy7HXGci/ObBNQhpnnj8+hxePvZSTQ1mCQzVdORKtAJQ8M=@vger.kernel.org X-Gm-Message-State: AOJu0Yzb7zqbtMHBBTmYv39dqgMe6BAEcPhpeNzZpN/6gLI5L9bbBwvU AFiWEZNc4MNvQKf9kgXN5Noho7nSSBHZ1l2LLbmiI5PXwcroR2NIE7Qei2s/NM4i X-Gm-Gg: AZuq6aJLWiCi/qdXNvDaQSncu0tN3qybYuOnvhilRixHUm/83aMFtU7TmXE3jCjgBmW SBS8HHxrOr3q7zUTmeSIiWImG/1crrh0ne0X39n1d1QJgifaUTWxJmkx4QDM0M3333JsUNcTC7r TD8xEUkrekCkO41tKxEpfvJ80HJ27cbhuDikFZ8QF7r/1ZeE1K/GpaMW6FX596t1u/qwp5zhOEI 1FIUaJL/LLJCLhDDCbcAi2NiZcvw0Pi1wvAiTN2RAETHwJmJERkwdOURX6h3SVWCZqwXCjjEPPj EnyG5fC/NpphPYFr9ebRPo9cnjJTc4gmN+djyIP/GPFBzntTgJir1huMAUOIei+htnH6xPvC+a7 VHf3yf3lrBJUAFEQpDEmjCdXvR8i7hGJh+pa8MPmPemWliyrpDYeVFB9vwgT5WCUNKIoLv3Ttzf LhKwa5TkQbMmxY X-Received: by 2002:a05:6512:1081:b0:5a0:f5e6:7f91 with SMTP id 2adb3069b0e04-5a0f5e67ffbmr142293e87.43.1771829461585; Sun, 22 Feb 2026 22:51:01 -0800 (PST) Received: from xeon ([188.163.112.76]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-389a78b4a45sm13916521fa.13.2026.02.22.22.51.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Feb 2026 22:51:01 -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 1/5] ASoC: dt-bindings: nvidia,tegra-audio: document CPCAP CODEC Date: Mon, 23 Feb 2026 08:50:47 +0200 Message-ID: <20260223065051.13070-2-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 dt-binding for CPCAP CODEC. Signed-off-by: Svyatoslav Ryhel --- .../sound/nvidia,tegra-audio-cpcap.yaml | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra-au= dio-cpcap.yaml diff --git a/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-cpc= ap.yaml b/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-cpcap.= yaml new file mode 100644 index 000000000000..69af2022d0fa --- /dev/null +++ b/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-cpcap.yaml @@ -0,0 +1,90 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/nvidia,tegra-audio-cpcap.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: NVIDIA Tegra audio complex with CPCAP CODEC + +maintainers: + - Svyatoslav Ryhel + +allOf: + - $ref: nvidia,tegra-audio-common.yaml# + +properties: + compatible: + items: + - pattern: '^motorola,tegra-audio-cpcap(-[a-z0-9]+)+$' + - const: nvidia,tegra-audio-cpcap + + nvidia,audio-routing: + $ref: /schemas/types.yaml#/definitions/non-unique-string-array + description: + A list of the connections between audio components. Each entry is a + pair of strings, the first being the connection's sink, the second + being the connection's source. Valid names for sources and sinks are + the pins (documented in the binding document), and the jacks on the + board. + minItems: 2 + items: + enum: + # Board Connectors + - Speakers + - Int Spk + - Earpiece + - Int Mic + - Headset Mic + - Internal Mic 1 + - Internal Mic 2 + - Headphone + - Headphones + - Headphone Jack + - Mic Jack + + # CODEC Pins + - MICR + - HSMIC + - EMUMIC + - MICL + - EXTR + - EXTL + - EP + - SPKR + - SPKL + - LINER + - LINEL + - HSR + - HSL + - EMUR + - EMUL + +unevaluatedProperties: false + +examples: + - | + #include + #include + sound { + compatible =3D "motorola,tegra-audio-cpcap-olympus", + "nvidia,tegra-audio-cpcap"; + nvidia,model =3D "Motorola Atrix 4G (MB860) CPCAP"; + + nvidia,audio-routing =3D + "Headphones", "HSR", + "Headphones", "HSL", + "Int Spk", "SPKR", + "Int Spk", "SPKL", + "Earpiece", "EP", + "HSMIC", "Mic Jack", + "MICR", "Internal Mic 1", + "MICL", "Internal Mic 2"; + + nvidia,i2s-controller =3D <&tegra_i2s1>; + nvidia,audio-codec =3D <&cpcap_audio>; + + clocks =3D <&tegra_car TEGRA20_CLK_PLL_A>, + <&tegra_car TEGRA20_CLK_PLL_A_OUT0>, + <&tegra_car TEGRA20_CLK_CDEV1>; + clock-names =3D "pll_a", "pll_a_out0", "mclk"; + }; --=20 2.51.0 From nobody Thu Apr 2 03:19:03 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 From nobody Thu Apr 2 03:19:03 2026 Received: from mail-ej1-f65.google.com (mail-ej1-f65.google.com [209.85.218.65]) (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 BDC5A2BE03B for ; Mon, 23 Feb 2026 08:28:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.65 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771835318; cv=none; b=fsR8ifTLmkamSG60YXBOO6YEUB7ZybLFgYE4AYun1c49LTlSjKx9kvmJDIhThpa4V4+WqoxqWsusGGxlOBniNBWYD/t/2V/kDAR8kqGEUvfguSnK/Ir+/YVYXs9LrtrsbEuvksooCUl0UQJmrE/kI+6JClSnP9z5CSdkdJfD/PM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771835318; c=relaxed/simple; bh=E50Z0kZ8QEC/+gID4A4p9F54kc2DuevigG1LcHQ1FUU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UydCpkqtNfoU81qUvWWxLg8N+R0TtHNCMW7JjQe7u/APdhvK8iKjuIszq8kpK1vxgMFmFEdn354pQEV8PkGBgaKARz3NsvGL5IerFnPh59NbtYX/o2p0tP9F05/kAp0sjHZFEVmqXuxcYOOO5kED8pj73vFs6k7MEJsF1tncDzM= 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=Hmq4rwZy; arc=none smtp.client-ip=209.85.218.65 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="Hmq4rwZy" Received: by mail-ej1-f65.google.com with SMTP id a640c23a62f3a-b8fbb24a9a9so728410166b.0 for ; Mon, 23 Feb 2026 00:28:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771835315; x=1772440115; 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=CDk6pvEbCDbKFm0MEs5hS5v1vRZPcd+sQDBn0D1BQXQ=; b=Hmq4rwZyPmdjc1hPy/9bPmcgQgHnHogr02mM+U04olRF8JJFaJ9ULwcoVj8VH960bV 9fmfNJT0Vk80P/2cwEIOngNrDZ/J6PDztvDgfHSC2e1aJspzILvXwxpqPEBG+7wyHR+U bVeVpKDyMs/0hYjHbDGMYiEUkxY3mqDvs6XNya9685hGkhfhbR0ucWOZeV5/vx+Is52z T42S9Z46QR+lUbY3y2UW6wSoE/rYjKP+qIQ8Ragf2r61wzgpIM4X1jKq7ZUz05B8nhu8 7HzH8B1H3fk5GszeYoOtPiR2FlfKhI3MhlANudFR/qR5ssrC29aa9sWVUnwAb/AGpAVo cRIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771835315; x=1772440115; 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=CDk6pvEbCDbKFm0MEs5hS5v1vRZPcd+sQDBn0D1BQXQ=; b=GkskVo8RtLvcETCeQpI5kFRPVqRWGF3kkt0XJXTmdhKSXDKoqklk9x5m4PBraXnvwH n4Kxol0vdyHeOlkU3v5gu+Hjz7Ht2fn31hlUGUGUt1ZZuFD/5Hb98h5zN+e+GVuYVgfw o4sHzC87yvQzW79xxtIEItC1+h20aulrv+Tt/5/JU5XweuXBffCdXnsg6d4nZZ4HK+HI KYAapYCZ/8Z8eGg/CLBO0VWGiv4Wxi33jWjAXFqnyZURzMQqBvSvkYAcNSI30mrwIDUp ojAIn1TUXDI9smGqV5nBL9EfxZUhPlXEcNcszsS2duJVnhEn3aJjNxs9iUB4eIwcFfBE uIYA== X-Forwarded-Encrypted: i=1; AJvYcCVTd9uD3V+T5tOAj0yZUJ8fnXv9UaXjXCZ+0TEnKNjH6JHjgBQIeZz+cE8LjiW8kq0dJql6d5ABSgeLUq0=@vger.kernel.org X-Gm-Message-State: AOJu0YxVtTNaUTxKnvFvQRBsoGsTAfskOYcl8ofyg6ecWk5+hivFafmI 8maZGiT1o96k3bGoS7eC5491BpbSM7bZcM2SM+amXnJZD5Ya+65XaKoO2H8bMwMn X-Gm-Gg: AZuq6aJfmHAixnUFxTzo8ILVZjvXTbrvLOy/VZu8GmjqWFtbyuKRy4wImtAZQ6U76HN cgeclTVwv+xL6166kqVPh49/gyR7tyxdqmiGV0IxuxD5t7dTmTQWZUNM0Q2Gu2t/u61QR5dAexe FThuja8zP1ranGr3ZsX2pyYQJwzduSg1mp1MBx0p4GPVv41lLnnuVyOwJRCvZFGd4Ar7CiDNj5E HVuXnTy0jA/5mHyi2i+4nxL+sNON2g2Z7+5/97yoHrK/T4RSD9SIvcANbW6CGEUo6cawSGk+yGM B7R1Gx7zr5Nss2Ppm9szmvQI/1BsZyOvuV1ZHNKP9A6j4kWN1flqMZRQnpJQIhCsN1z8YlFTvl4 6Q/XW22J9k31eWHKggVLyA4sISFEdnIqVm4w8vkmv4iiqrtlvZKACNlME6Ac3qoTxcKnnKTbU/I QiSkfbLxbJWxCD+Byk0FlLudA= X-Received: by 2002:a05:651c:41c7:b0:386:34b5:aed2 with SMTP id 38308e7fff4ca-389a6072e4amr24552671fa.5.1771829463626; Sun, 22 Feb 2026 22:51:03 -0800 (PST) Received: from xeon ([188.163.112.76]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-389a78b4a45sm13916521fa.13.2026.02.22.22.51.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Feb 2026 22:51:03 -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 3/5] ASoC: dt-bindings: nvidia,tegra-audio: document WM8962 CODEC Date: Mon, 23 Feb 2026 08:50:49 +0200 Message-ID: <20260223065051.13070-4-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 dt-binding for WM8962 CODEC. Signed-off-by: Svyatoslav Ryhel --- .../sound/nvidia,tegra-audio-wm8962.yaml | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra-au= dio-wm8962.yaml diff --git a/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-wm8= 962.yaml b/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-wm896= 2.yaml new file mode 100644 index 000000000000..2c3bf5a02a34 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-wm8962.yaml @@ -0,0 +1,88 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/nvidia,tegra-audio-wm8962.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: NVIDIA Tegra audio complex with WM8962 CODEC + +maintainers: + - Svyatoslav Ryhel + +allOf: + - $ref: nvidia,tegra-audio-common.yaml# + +properties: + compatible: + items: + - pattern: '^[a-z0-9]+,tegra-audio-wm8962(-[a-z0-9]+)+$' + - const: nvidia,tegra-audio-wm8962 + + nvidia,audio-routing: + $ref: /schemas/types.yaml#/definitions/non-unique-string-array + description: + A list of the connections between audio components. Each entry is a + pair of strings, the first being the connection's sink, the second + being the connection's source. Valid names for sources and sinks are + the pins (documented in the binding document), and the jacks on the + board. + minItems: 2 + items: + enum: + # Board Connectors + - Speakers + - Int Spk + - Earpiece + - Int Mic + - Headset Mic + - Internal Mic 1 + - Internal Mic 2 + - Headphone + - Headphones + - Headphone Jack + - Mic Jack + + # CODEC Pins + - IN1L + - IN1R + - IN2L + - IN2R + - IN3L + - IN3R + - IN4L + - IN4R + - DMICDAT + - HPOUTL + - HPOUTR + - SPKOUT + - SPKOUTL + - SPKOUTR + +required: + - nvidia,i2s-controller + +unevaluatedProperties: false + +examples: + - | + #include + #include + sound { + compatible =3D "microsoft,tegra-audio-wm8962-surface-rt", + "nvidia,tegra-audio-wm8962"; + nvidia,model =3D "Microsoft Surface RT WM8962"; + + nvidia,audio-routing =3D + "Headphone Jack", "HPOUTR", + "Headphone Jack", "HPOUTL", + "Int Spk", "SPKOUTR", + "Int Spk", "SPKOUTL"; + + nvidia,i2s-controller =3D <&tegra_i2s1>; + nvidia,audio-codec =3D <&wm8962>; + + clocks =3D <&tegra_car TEGRA30_CLK_PLL_A>, + <&tegra_car TEGRA30_CLK_PLL_A_OUT0>, + <&tegra_pmc TEGRA_PMC_CLK_OUT_1>; + clock-names =3D "pll_a", "pll_a_out0", "mclk"; + }; --=20 2.51.0 From nobody Thu Apr 2 03:19:03 2026 Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) (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 C89283451B5 for ; Mon, 23 Feb 2026 06:51:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771829468; cv=none; b=C76Op2IO4zBwYgwJk+RaSC1F+QG8o1aC5HxiM7beV0WX7Ty90xNXOlQ8DL36qB+IeR2s6dbf3WJwJZ2WzVNmZ0KYY5cA2xG+XC1KoveO8YIBS9RaeiVUbJKtaqKawgiEMBF/smzciteIkY4deNhKyfAY8gY4nMu957n1wNpuvRE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771829468; c=relaxed/simple; bh=yQseu6gM2haEIm/ayUoG3639fNPMyxWFXUHZI+hw/MA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=rQTPIIvo0UlFM+U0aMNpSwhnnaz6KhTicKIf7iq00mXPA7kLmkWlmeVuca2HI2viVCwnfzM14T+K7BzoNc7/taACsuCRtUoasr8UhGmHjhqI4+fn867a2ouAcXboqXpQTClb0W6IFZyZOQmpdsXs9p8/kF796T4hWC8qVQ57OLg= 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=I4NLqrtP; arc=none smtp.client-ip=209.85.167.53 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="I4NLqrtP" Received: by mail-lf1-f53.google.com with SMTP id 2adb3069b0e04-59e57973dbfso3921742e87.1 for ; Sun, 22 Feb 2026 22:51:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771829465; x=1772434265; 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=htXBvNPgxXNOHZBCLFJRJ5Aq3ZtCWpOxvSqLp1RXyrk=; b=I4NLqrtPHh+gW6u5qIrPsHNzjyQWwfyP16vOKgmm01EACoIygnFeinBzIQcvahnX/s zuy+6G/C6T/ELNl5jnZoU+RqPXcd0qymeB6GhUDdgLh6TmlwdeVFmtJ2Pz+UblRAq9r4 ZTB3HbaCAIu8ycEnneljBBFVCmmeY+kqlcpj6lamNBcTE8aSYgyjgwpNuoGuYQWjFWs7 yPz3IT9AJprs5GiHAOkm8/oxZfo9kCVURt4ZlQZlpowBbvllgFUsZwixH3W2ACOpBWDx H741DrlmP1m6/HCCK5SSj9LGU+6US0RYf4WS/hNsziiEeZ0vxvZ9BwnzQT8e2moaFAMX YtWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771829465; x=1772434265; 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=htXBvNPgxXNOHZBCLFJRJ5Aq3ZtCWpOxvSqLp1RXyrk=; b=MWb5HCwc0PbMgj3ol5I+JT3DN5wmGYqpXLc7E7VOgZhBLj4Yo3XpuS+s/kZ8Thzx5j eR3Ku1sw1Yn+xfVcCpJlhwA6Pu9VS7/RYfe8HCxtpa8DSRroecWoVGUsWcHDnqTKFyxV Mw737Wj8wIei0F/dE6Y+Wrwt7NFCBA5OxJTIeFks2KjLMPt3Fze1X86rgHd4LcF8NAD2 eAj0PAPi96hlFK+8AdDYPdsajqn4VM+/Mrcr4w0+Bb4BmDTzBT8mAVK8NOH6Aqb38uyh BbPr7oFdDy9S+EDzMhoyihhs9c6FJGJ+j7lvG0ROy0n7ISdZIXPeQqdqZ8nT3aovCQ1o 7wpA== X-Forwarded-Encrypted: i=1; AJvYcCUyI+eVB8/ymCjnu0OSQmXpaMOR0ZOFwKz9qMYfa4JOWT0n0e/ZEN3cyInhv88fyBYmb0cMn0tMZTBKC+k=@vger.kernel.org X-Gm-Message-State: AOJu0Yw31TKdzuuFdOZkGVXmgKGMzQXB2F3si9vus/WtIHipoYUF85iQ FV6Z/mtWRxm9zvu2dbebE2/7mf2k1gRq0X7upr0K8BgLyURLkHdhyTdc X-Gm-Gg: AZuq6aJxoWcyQn6cwdv65oxJlJtYYAJ3oHzF+aDKof6RWYzMqPrV3U9MVcv3fjSyAtI Nm7mErVFJIFyPl7qJyAVzsbAKLdQg/5F7OlnKjgL6ZdmSPpGua3AWV8LWA5p+qF/zjW0sM+Nr8v j8wkV0Kx/ffxc+OD0Q4TSAaBvAFhUlWp3E8orbG+VZggvqZ4o4ixMKsRiM6VjJ0yXVOLfulm1xS eSyVDEHBs/ZB2VzfgoZkZqoJQN4KF3i2Iy+D3mc2e+PmsC62ktJHQfFer7g0GjmgCNjJC+qLvdT UvpM0IeLDNYmtIMSO4mRRHRH0cR3tFAKSPvtt8rXo1ae23s/e8hRXp2jUGW5fmC/XInsoCu+alb cMLPrYf1GBS7HV775wGNyQVRr8/H46EIuI2i2pUkXN04IlOBF6FBEbyCPa8uua9BcmC+zcEIPrW /N01VT7/l4ef8l X-Received: by 2002:a05:6512:ac5:b0:59e:5589:26c6 with SMTP id 2adb3069b0e04-59f8abe6f22mr4724303e87.9.1771829464668; Sun, 22 Feb 2026 22:51:04 -0800 (PST) Received: from xeon ([188.163.112.76]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-389a78b4a45sm13916521fa.13.2026.02.22.22.51.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Feb 2026 22:51:04 -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 4/5] ASoC: tegra: Support WM8962 by machine driver Date: Mon, 23 Feb 2026 08:50:50 +0200 Message-ID: <20260223065051.13070-5-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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable From: Jonas Schw=C3=B6bel Add Wolfson Microelectronics WM8962 codec support to the Tegra ASoC machine driver. The WM8962 codec is found on devices like Microsoft Surface RT and Microsoft Surface 2 Windows RT based tablets. Co-developed-by: Svyatoslav Ryhel Signed-off-by: Svyatoslav Ryhel Signed-off-by: Jonas Schw=C3=B6bel --- sound/soc/tegra/Kconfig | 10 ++ sound/soc/tegra/Makefile | 2 + sound/soc/tegra/tegra_wm8962.c | 165 +++++++++++++++++++++++++++++++++ 3 files changed, 177 insertions(+) create mode 100644 sound/soc/tegra/tegra_wm8962.c diff --git a/sound/soc/tegra/Kconfig b/sound/soc/tegra/Kconfig index dd58525b7079..fdc954028d62 100644 --- a/sound/soc/tegra/Kconfig +++ b/sound/soc/tegra/Kconfig @@ -229,6 +229,16 @@ config SND_SOC_TEGRA_WM8903 boards using the WM8093 codec. Currently, the supported boards are Harmony, Ventana, Seaboard, Kaen, and Aebl. =20 +config SND_SOC_TEGRA_WM8962 + tristate "SoC Audio support for Tegra boards using a WM8962 codec" + depends on I2C && INPUT && GPIOLIB + select SND_SOC_TEGRA_MACHINE_DRV + select SND_SOC_WM8962 + help + Say Y or M here if you want to add support for SoC audio on Tegra + boards using the WM8962 codec. Currently, the supported boards are + Microsoft Surface RT. + config SND_SOC_TEGRA_WM9712 tristate "SoC Audio support for Tegra boards using a WM9712 codec" depends on GPIOLIB diff --git a/sound/soc/tegra/Makefile b/sound/soc/tegra/Makefile index defea7f53f11..3f396c87802e 100644 --- a/sound/soc/tegra/Makefile +++ b/sound/soc/tegra/Makefile @@ -43,9 +43,11 @@ obj-$(CONFIG_SND_SOC_TEGRA210_OPE) +=3D snd-soc-tegra210= -ope.o =20 # Tegra machine Support snd-soc-tegra-wm8903-y :=3D tegra_wm8903.o +snd-soc-tegra-wm8962-y :=3D tegra_wm8962.o snd-soc-tegra-machine-y :=3D tegra_asoc_machine.o snd-soc-tegra-audio-graph-card-y :=3D tegra_audio_graph_card.o =20 obj-$(CONFIG_SND_SOC_TEGRA_WM8903) +=3D snd-soc-tegra-wm8903.o +obj-$(CONFIG_SND_SOC_TEGRA_WM8962) +=3D snd-soc-tegra-wm8962.o obj-$(CONFIG_SND_SOC_TEGRA_MACHINE_DRV) +=3D snd-soc-tegra-machine.o obj-$(CONFIG_SND_SOC_TEGRA_AUDIO_GRAPH_CARD) +=3D snd-soc-tegra-audio-grap= h-card.o diff --git a/sound/soc/tegra/tegra_wm8962.c b/sound/soc/tegra/tegra_wm8962.c new file mode 100644 index 000000000000..31f9d9181595 --- /dev/null +++ b/sound/soc/tegra/tegra_wm8962.c @@ -0,0 +1,165 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * tegra_wm8962.c - Tegra machine ASoC driver for boards using WM8962 code= c. + * + * Copyright (C) 2021-2024 Jonas Schw=C3=B6bel + * Svyatoslav Ryhel + * + * Based on tegra_wm8903 code copyright/by: + * + * Author: Stephen Warren + * Copyright (C) 2010-2012 - NVIDIA, Inc. + * + * Based on code copyright/by: + * + * (c) 2009, 2010 Nvidia Graphics Pvt. Ltd. + * + * Copyright 2007 Wolfson Microelectronics PLC. + * Author: Graeme Gregory + * graeme.gregory@wolfsonmicro.com or linux@wolfsonmicro.com + */ + +#include +#include +#include +#include + +#include +#include +#include + +#include "../codecs/wm8962.h" + +#include "tegra_asoc_machine.h" + +static struct snd_soc_jack_pin tegra_wm8962_mic_jack_pins[] =3D { + { .pin =3D "Mic Jack", .mask =3D SND_JACK_MICROPHONE }, +}; + +static unsigned int tegra_wm8962_mclk_rate(unsigned int srate) +{ + unsigned int mclk; + + switch (srate) { + case 8000: + case 16000: + case 24000: + case 32000: + case 48000: + case 64000: + case 96000: + mclk =3D 12288000; + break; + case 11025: + case 22050: + case 44100: + case 88200: + mclk =3D 11289600; + break; + default: + mclk =3D 12000000; + break; + } + + return mclk; +} + +static int tegra_wm8962_init(struct snd_soc_pcm_runtime *rtd) +{ + struct tegra_machine *machine =3D snd_soc_card_get_drvdata(rtd->card); + struct snd_soc_card *card =3D rtd->card; + struct snd_soc_dapm_context *dapm =3D snd_soc_card_to_dapm(card); + int err; + + err =3D tegra_asoc_machine_init(rtd); + if (err) + return err; + + if (!machine->gpiod_mic_det && machine->asoc->add_mic_jack) { + struct snd_soc_dai *codec_dai =3D snd_soc_rtd_to_codec(rtd, 0); + struct snd_soc_component *component =3D codec_dai->component; + + err =3D snd_soc_card_jack_new_pins(rtd->card, "Mic Jack", + SND_JACK_MICROPHONE, + machine->mic_jack, + tegra_wm8962_mic_jack_pins, + ARRAY_SIZE(tegra_wm8962_mic_jack_pins)); + if (err) { + dev_err(rtd->dev, "Mic Jack creation failed: %d\n", err); + return err; + } + + wm8962_mic_detect(component, machine->mic_jack); + } + + snd_soc_dapm_force_enable_pin(dapm, "MICBIAS"); + + return 0; +} + +static int tegra_wm8962_remove(struct snd_soc_card *card) +{ + struct snd_soc_dai_link *link =3D &card->dai_link[0]; + struct snd_soc_pcm_runtime *rtd =3D snd_soc_get_pcm_runtime(card, link); + struct snd_soc_dai *codec_dai =3D snd_soc_rtd_to_codec(rtd, 0); + struct snd_soc_component *component =3D codec_dai->component; + + wm8962_mic_detect(component, NULL); + + return 0; +} + +SND_SOC_DAILINK_DEFS(wm8962_hifi, + DAILINK_COMP_ARRAY(COMP_EMPTY()), + DAILINK_COMP_ARRAY(COMP_CODEC(NULL, "wm8962")), + DAILINK_COMP_ARRAY(COMP_EMPTY())); + +static struct snd_soc_dai_link tegra_wm8962_dai =3D { + .name =3D "WM8962", + .stream_name =3D "WM8962 PCM", + .init =3D tegra_wm8962_init, + .dai_fmt =3D SND_SOC_DAIFMT_I2S | + SND_SOC_DAIFMT_NB_NF | + SND_SOC_DAIFMT_CBC_CFC, + SND_SOC_DAILINK_REG(wm8962_hifi), +}; + +static struct snd_soc_card snd_soc_tegra_wm8962 =3D { + .components =3D "codec:wm8962", + .owner =3D THIS_MODULE, + .dai_link =3D &tegra_wm8962_dai, + .num_links =3D 1, + .remove =3D tegra_wm8962_remove, + .fully_routed =3D true, +}; + +static const struct tegra_asoc_data tegra_wm8962_data =3D { + .mclk_rate =3D tegra_wm8962_mclk_rate, + .card =3D &snd_soc_tegra_wm8962, + .add_common_dapm_widgets =3D true, + .add_common_controls =3D true, + .add_common_snd_ops =3D true, + .add_mic_jack =3D true, + .add_hp_jack =3D true, +}; + +static const struct of_device_id tegra_wm8962_of_match[] =3D { + { .compatible =3D "nvidia,tegra-audio-wm8962", .data =3D &tegra_wm8962_da= ta }, + {}, +}; +MODULE_DEVICE_TABLE(of, tegra_wm8962_of_match); + +static struct platform_driver tegra_wm8962_driver =3D { + .driver =3D { + .name =3D "tegra-wm8962", + .of_match_table =3D tegra_wm8962_of_match, + .pm =3D &snd_soc_pm_ops, + }, + .probe =3D tegra_asoc_machine_probe, +}; +module_platform_driver(tegra_wm8962_driver); + +MODULE_AUTHOR("Jonas Schw=C3=B6bel "); +MODULE_AUTHOR("Svyatoslav Ryhel "); +MODULE_DESCRIPTION("Tegra+WM8962 machine ASoC driver"); +MODULE_LICENSE("GPL"); --=20 2.51.0 From nobody Thu Apr 2 03:19:03 2026 Received: from mail-lj1-f196.google.com (mail-lj1-f196.google.com [209.85.208.196]) (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 E641434A3D0 for ; Mon, 23 Feb 2026 06:51:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.196 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771829469; cv=none; b=t+syu8iFGsgM/3joBeowZSF1l86VVmGdLFfq4P+hayf5Ovyu725f/X7/6edEbMGFeaMmFY1zKMFEdXJP7t/I+gd7pqIx+dnpBJQd4RrytO/67nCLwuu2g4AoTAbuW68Zi3z3PiKjlOZoLXyIYCESkZFrRWYTQQBVT4jgw0Uj8Ho= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771829469; c=relaxed/simple; bh=hj2gh+LQFnJF61Wo8g+AzdFuv8OMSKkxORkVErAo4zE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Oi8km0mecTSBtvs8Iap6IjgE9SmG39abQBitwkaQR5cjX7TfZPGT4J1QXgi8c3XDsMqhUnrT5lp4nwICkgbjsBjl7hZVNfmWx0bUGCJ/tbDuSmGRnhdDuUD4e3UImpnAfL87OKqCUXVHJ4TJVgBd0NV/DL6rpi54L3vNw71AoZc= 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=EDqjI3a8; arc=none smtp.client-ip=209.85.208.196 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="EDqjI3a8" Received: by mail-lj1-f196.google.com with SMTP id 38308e7fff4ca-3870cbd6c40so35453011fa.0 for ; Sun, 22 Feb 2026 22:51:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771829466; x=1772434266; 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=bou2oRwzCjakShdBOoto0Gx5SGWPIs6HOrLc27z4TMY=; b=EDqjI3a8oIraC8th/vKe3a+NMT1AQqUeLkcjTFm9RfyB37c2VdoFAHZ+W2YAOxQogh aCIdiVl6Be97/DuLXiGwPEPvJChBRtTssjhw0f6pKoAk4w/30ddpHYFyY5dywDuxsLX0 xXAN+yBKEjs0MZJ4Th/XawYlZi87AoCR4HcY4DBLVhCDQvld+5ap4F1LS/QQIwtq/MHb hF4os2YidLId4iSfBezQUfBpiK6WN+y9L35t/RL5LwFKhCgYoTpB4sUUZh1O3K9lojx0 NOvE30hWdD/Dgiv3qPrFv88/zWnH3Kp+HnqNJsnzGfzW5WCxID35X7HS/TJVq385Tu8P IBZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771829466; x=1772434266; 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=bou2oRwzCjakShdBOoto0Gx5SGWPIs6HOrLc27z4TMY=; b=ISzxP8S1PUMgayl2sW8SdgvLtPFy0gpYS7rL2krKPnsaNVB3YiTWxoCnEbu6QxfAou yCArWLaIiq9l5YDb5KAJbw0QXsdByNlQJ5ZWUT0TITqPjQYSoNmSWxN9EVNjpEG6mUS1 nHIthNbNDNera2lAGupAO0o95lBnhlyHP3DqWxkHbzxwrrFyJGW6wa+p5gZP15RB3bUr vsCl5vbSYoYD2PRENH3ywE9Shkmy1Gl+X7kUyW8h/JrIlegJ9R3dFz42X47gPEoUlkZa 4E4kQ5YEnsfPZD8lQCeqAucIP27xiW/h4pXD0SPQ6AV86mODBmyuV0C0hauKVAp0jvyj h8gA== X-Forwarded-Encrypted: i=1; AJvYcCXLmN0UHlhYAZ+r1jNL483v5yHiagIL6mK5XHTsFVBGUAqdZR6r51M4xPNKxQ+l59Mq9O3934dkTuKtJVU=@vger.kernel.org X-Gm-Message-State: AOJu0YyGIPQ+M/kbCOmLJC2MOeQk29zkNpwjnp9Tb/mDeWckTnCRFgRj 1k22v/MPnHNSuQMGRCfHY7zW72qSPoODSlZNTsAmq6yctaY341Z3yzp7 X-Gm-Gg: AZuq6aJXbYx0TDIyrYwXnrSuhHCcd9qWBgBDmEcq+myqEvcdNILoPaWqG92Cwml7pZE o1rSbg+9LBgzSTsQlZI3/NWm1uFv+eUQ5uAYtNA+4sms2dWg1XtEHEWqASvutNz+c4hMK2fsT+G WFqZPpvYTUswmCur4/QTPmV+2QuWtk8Xs0EDHv8Oaxra3xVpvNpxSYF6CJ7+8KYoQWFQUbgKqrn nglnDCdmQ30menpAVvsHr0G0NSBlI/mLc5avNONICWfWLm3mfZXu8TKZmxJGVLgLPxsXByT6TA/ 5pyzL2Z7NY3ChhayugN8cawUJ0vpO9ERTFKc5j1G9auX2kyvihHcDD2w+DX62yVbs3uydlh00o7 /I0Homr1w/ofMHCDdbr7pOq6Df4+SzACyZgOkn9WddBoQjuxzsBMqov22l57Vkk14hK97FT87im 98/Xdf03oNsnHG X-Received: by 2002:a05:651c:b21:b0:387:1c06:f747 with SMTP id 38308e7fff4ca-389a5daa3f4mr19110221fa.20.1771829465937; Sun, 22 Feb 2026 22:51:05 -0800 (PST) Received: from xeon ([188.163.112.76]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-389a78b4a45sm13916521fa.13.2026.02.22.22.51.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Feb 2026 22:51:05 -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 5/5] ASoC: dt-bindings: nvidia,tegra-audio-max9808x: document additional board pins Date: Mon, 23 Feb 2026 08:50:51 +0200 Message-ID: <20260223065051.13070-6-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" Document additional board pins that may be used in routing. Signed-off-by: Svyatoslav Ryhel Acked-by: Rob Herring (Arm) --- .../bindings/sound/nvidia,tegra-audio-max9808x.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-max= 9808x.yaml b/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-max= 9808x.yaml index 241d20f3aad0..4957645a8e03 100644 --- a/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-max9808x.y= aml +++ b/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-max9808x.y= aml @@ -35,10 +35,15 @@ properties: items: enum: # Board Connectors + - Speakers - Int Spk + - Headphone + - Headphones - Headphone Jack - Earpiece - Headset Mic + - Mic Jack + - Int Mic - Internal Mic 1 - Internal Mic 2 =20 --=20 2.51.0