From patchwork Fri Apr 18 06:31:02 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Primoz Fiser X-Patchwork-Id: 14056940 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 CC16AC369AB for ; Fri, 18 Apr 2025 07:02:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=NLx7swwHxHHTCepO4+SoCsQwWTaWjIPAb7kUrhK5E1I=; b=u2OK+lM/iGayf8VLibyarJJYvj 7641XBqTaTqC6Wr2YUfEk5mBtyr2FlbM5oQG57YsI7WOWNcTaOHlZQ0KG7fH6QYFzi2IxJf8aQk2t j8c+khvgYtHqcdagkhyqcO4/AzGxAQhRxCK2rx9QgqVBQqB6ccplE84aEDG60Oigyoftu88VUE6iR D9rIhlvH7bj28spRPbHgCOfymxB77enhtuxPESEz0JuEbXThaQ80b/IxUP9H5DmJhPqI0DUeVNAP3 yNhxQe1m2N5Ik62/x/99FU2OYNXscp4DWvuUqrnFW5hTJmJOo13aew0fQzlz3SwW/Oh2KC103gxv0 2tE62fUQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1u5fjL-0000000FOnh-0Me0; Fri, 18 Apr 2025 07:01:55 +0000 Received: from cpanel.siel.si ([46.19.9.99]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1u5fG1-0000000FGkN-1k5P for linux-arm-kernel@lists.infradead.org; Fri, 18 Apr 2025 06:31:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=norik.com; s=default; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=NLx7swwHxHHTCepO4+SoCsQwWTaWjIPAb7kUrhK5E1I=; b=mU9K+NlNRzlm3cf2t9tThEOkCq FU4uvXzAGmT5rvSxtKJHsNi9pslIUhx0yWduDMs00HBiF/76eL1tmaWd6daUqsz/C6OED3acJdLxd oEa8wRsBV3RH8BI8lzk9YOXupHByVF3h4LcPkePxRkZjp/7QR/2GxDnZSmKr6W8RlmsuhQboj3A7J QOkEi9ExSgP6wkqBIcZcpvUoqXwSPq5iJBi/7qZ/CXcaYoVh9i1GBmB2Xi4K4qszZvNZVkbZeN1QS atOfJd2F+cL8d0pxUdxCXil/OucCRFa0qAtItBf2IyFHCMrIpqme20kJqgPgbyEEyncNUaOu5do8X FK5enkVQ==; Received: from [89.212.21.243] (port=56446 helo=localhost.localdomain) by cpanel.siel.si with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1u5fG0-00AbM0-13; Fri, 18 Apr 2025 08:31:24 +0200 From: Primoz Fiser To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, upstream@lists.phytec.de Subject: [PATCH v3 13/15] arm64: dts: freescale: imx93-phyboard-segin: Add I2S audio Date: Fri, 18 Apr 2025 08:31:02 +0200 Message-Id: <20250418063104.2202085-14-primoz.fiser@norik.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250418063104.2202085-1-primoz.fiser@norik.com> References: <20250418063104.2202085-1-primoz.fiser@norik.com> MIME-Version: 1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cpanel.siel.si X-AntiAbuse: Original Domain - lists.infradead.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - norik.com X-Get-Message-Sender-Via: cpanel.siel.si: authenticated_id: primoz.fiser@norik.com X-Authenticated-Sender: cpanel.siel.si: primoz.fiser@norik.com X-Source: X-Source-Args: X-Source-Dir: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250417_233125_607497_E2374576 X-CRM114-Status: UNSURE ( 7.54 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add support for I2S audio found on phyBOARD-Segin-i.MX93. Audio codec TLV320AIC3007 is connected to SAI1 interface as a DAI master. MCLK is provided from the SAI's internal audio PLL (19.2 MHz). Signed-off-by: Primoz Fiser Reviewed-by: Frank Li Reviewed-by: Daniel Baluta --- Changes in v3: - add Reviewed-by tag .../dts/freescale/imx93-phyboard-segin.dts | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/arch/arm64/boot/dts/freescale/imx93-phyboard-segin.dts b/arch/arm64/boot/dts/freescale/imx93-phyboard-segin.dts index e4f959f665b2..54e084e69706 100644 --- a/arch/arm64/boot/dts/freescale/imx93-phyboard-segin.dts +++ b/arch/arm64/boot/dts/freescale/imx93-phyboard-segin.dts @@ -35,6 +35,20 @@ flexcan1_tc: can-phy0 { enable-gpios = <&gpio4 16 GPIO_ACTIVE_HIGH>; }; + reg_sound_1v8: regulator-sound-1v8 { + compatible = "regulator-fixed"; + regulator-max-microvolt = <1800000>; + regulator-min-microvolt = <1800000>; + regulator-name = "VCC1V8_AUDIO"; + }; + + reg_sound_3v3: regulator-sound-3v3 { + compatible = "regulator-fixed"; + regulator-max-microvolt = <3300000>; + regulator-min-microvolt = <3300000>; + regulator-name = "VCC3V3_ANALOG"; + }; + reg_usdhc2_vmmc: regulator-usdhc2 { compatible = "regulator-fixed"; enable-active-high; @@ -45,6 +59,34 @@ reg_usdhc2_vmmc: regulator-usdhc2 { regulator-max-microvolt = <3300000>; regulator-name = "VCC_SD"; }; + + sound: sound { + compatible = "simple-audio-card"; + simple-audio-card,name = "phyBOARD-Segin-TLV320AIC3007"; + simple-audio-card,format = "i2s"; + simple-audio-card,bitclock-master = <&dailink_master>; + simple-audio-card,frame-master = <&dailink_master>; + simple-audio-card,widgets = + "Line", "Line In", + "Line", "Line Out", + "Speaker", "Speaker"; + simple-audio-card,routing = + "Line Out", "LLOUT", + "Line Out", "RLOUT", + "Speaker", "SPOP", + "Speaker", "SPOM", + "LINE1L", "Line In", + "LINE1R", "Line In"; + + simple-audio-card,cpu { + sound-dai = <&sai1>; + }; + + dailink_master: simple-audio-card,codec { + sound-dai = <&audio_codec>; + clocks = <&clk IMX93_CLK_SAI1>; + }; + }; }; /* CAN */ @@ -62,6 +104,17 @@ &lpi2c2 { pinctrl-0 = <&pinctrl_lpi2c2>; status = "okay"; + /* Codec */ + audio_codec: audio-codec@18 { + compatible = "ti,tlv320aic3007"; + reg = <0x18>; + #sound-dai-cells = <0>; + AVDD-supply = <®_sound_3v3>; + IOVDD-supply = <®_sound_3v3>; + DRVDD-supply = <®_sound_3v3>; + DVDD-supply = <®_sound_1v8>; + }; + /* RTC */ i2c_rtc: rtc@68 { compatible = "microcrystal,rv4162"; @@ -80,6 +133,17 @@ &lpuart1 { status = "okay"; }; +/* Audio */ +&sai1 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_sai1>; + assigned-clocks = <&clk IMX93_CLK_SAI1>; + assigned-clock-parents = <&clk IMX93_CLK_AUDIO_PLL>; + assigned-clock-rates = <19200000>; + fsl,sai-mclk-direction-output; + status = "okay"; +}; + /* USB */ &usbotg1 { disable-over-current; @@ -148,6 +212,16 @@ MX93_PAD_ENET2_RD2__GPIO4_IO26 0x31e >; }; + pinctrl_sai1: sai1grp { + fsl,pins = < + MX93_PAD_UART2_RXD__SAI1_MCLK 0x1202 + MX93_PAD_SAI1_TXFS__SAI1_TX_SYNC 0x1202 + MX93_PAD_SAI1_TXC__SAI1_TX_BCLK 0x1202 + MX93_PAD_SAI1_TXD0__SAI1_TX_DATA00 0x1402 + MX93_PAD_SAI1_RXD0__SAI1_RX_DATA00 0x1402 + >; + }; + pinctrl_usdhc2_cd: usdhc2cdgrp { fsl,pins = < MX93_PAD_SD2_CD_B__GPIO3_IO00 0x31e