From patchwork Mon May 29 09:57:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 100201 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1399560vqr; Mon, 29 May 2023 03:05:18 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6XDNY6jPmde8poO2faGi3Fs40ZN15Wm72J7ZwTPCp6/TY5uN5iCeWQH7fvRr9KUj4BmEep X-Received: by 2002:aa7:88c8:0:b0:64d:42f6:4c7b with SMTP id k8-20020aa788c8000000b0064d42f64c7bmr14541847pff.27.1685354717906; Mon, 29 May 2023 03:05:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685354717; cv=none; d=google.com; s=arc-20160816; b=qr3FC22zWoPIHKBfhvNFEM0/I30J/3pzWsLgZYdS5gp/RqzoTerJk3BoZh3y/RVTsz MIjepRHaWJkTehD4l1MhGl8Z3fOFsCWgrEyJArmovvuAd9jCzDH3+f139lC9kWCc7gp0 8braZqC+WzuawKoDurJHJoxxK1fexeakmTu604vSQ2TgZz2H86iUkXrAuH+3qA37qdWq EIJtUBQ8XWjoz9fBdGD1P6IRgSK+F8KOR2pjuMrsthqWY2Ya6Cm6tfcQ9wE8JWG1c4Ws /Q8SZ+tK8rmePd24d/cTMHe0PMxV826/ifjg/wYEkXI5WCzyQWgXbJA+WtIj6HfYfUXD v1cQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=SxmIAh8GDseBZYntGUc44Z35aazp12eXjBcsoorWiBw=; b=tjGfbrbBuv8VLfLrQ8nAzgws8Xg/8GaUSEMHZH3DcliRQJhfxFma+aPm36erfBmYNL K2nz8+h9RVrxfJ4Zf/UFz6mXnwIi/cV3bOXcoBGXkhs+se6aNQ81B5IsQsKsB2i8k9mJ qXWRZgrew3wtjO9bDZmZIiC6b1iqUGmcEDspHsk9KSnR51R4mk5bYlWTk1GmFqBQbpR1 veP4+deKivdFfl2fR72vH5pIBUQenqNkNKXCC3Q92dRVG0mS51VmlgDv7EcTbG7DZ9dm QCevDqmJVgbmNMMxUX4Juo5zqDCxilqhOujmJD2xVXcwXHUH8piOzmqjZ7ZyMHGVlxY8 mAGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=MPMZnN+K; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w126-20020a623084000000b0064d6a4089e1si9458885pfw.182.2023.05.29.03.05.03; Mon, 29 May 2023 03:05:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=MPMZnN+K; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231664AbjE2J5i (ORCPT + 99 others); Mon, 29 May 2023 05:57:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229678AbjE2J5h (ORCPT ); Mon, 29 May 2023 05:57:37 -0400 Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7AF02A7; Mon, 29 May 2023 02:57:34 -0700 (PDT) X-GND-Sasl: luca.ceresoli@bootlin.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1685354253; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=SxmIAh8GDseBZYntGUc44Z35aazp12eXjBcsoorWiBw=; b=MPMZnN+KYG/+ouKEjouxriDE/jepLFdXO5DxpcQr6YK2v6ReIMqv4irstra0t8aMds7m7+ u9LPkrn24GLJRjIrIWLdmvY67dSj8e6S1hJC8cr7RBt8ttHTMeM68lrhQyr2gi5eJJjOBq pKdqr5d0LZSold8WsIouK4zurxoPfvSTLb/EjIg/VsSs/2VNwwen5ug9jlHcrGiL4PH/CX 0XTzNoqWeK+jSb5Vwwed4VqxsJTidRQRLYGEmP0X9vquN6D81fpM0SD7Qk1PDtYE0bic91 NAznIauWv4YCq75iDnWGQTJ9734kZ8Db1derm0icOXdS+sVfnX85W16z6oSKhg== X-GND-Sasl: luca.ceresoli@bootlin.com X-GND-Sasl: luca.ceresoli@bootlin.com X-GND-Sasl: luca.ceresoli@bootlin.com X-GND-Sasl: luca.ceresoli@bootlin.com X-GND-Sasl: luca.ceresoli@bootlin.com X-GND-Sasl: luca.ceresoli@bootlin.com X-GND-Sasl: luca.ceresoli@bootlin.com X-GND-Sasl: luca.ceresoli@bootlin.com X-GND-Sasl: luca.ceresoli@bootlin.com X-GND-Sasl: luca.ceresoli@bootlin.com X-GND-Sasl: luca.ceresoli@bootlin.com X-GND-Sasl: luca.ceresoli@bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPA id C130560008; Mon, 29 May 2023 09:57:29 +0000 (UTC) From: Luca Ceresoli To: devicetree@vger.kernel.org Cc: Luca Ceresoli , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Thomas Petazzoni , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v3] arm64: dts: imx8mp-msc-sm2s: Add sound card Date: Mon, 29 May 2023 11:57:28 +0200 Message-Id: <20230529095728.83993-1-luca.ceresoli@bootlin.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767222508677627888?= X-GMAIL-MSGID: =?utf-8?q?1767222508677627888?= The MSC SM2-MB-EP1 carrier board for the SM2S-IMX8PLUS SMARC module has an NXP SGTL5000 audio codec connected to I2S-0 (sai2). This requires to: * add the power supplies (always on) * enable sai2 with pinmuxes * reparent the CLKOUT1 clock that feeds the codec SYS_MCLK to IMX8MP_CLK_24M in order it to generate an accurate 24 MHz rate Signed-off-by: Luca Ceresoli --- Changed in v3: - renamed codec node name to "audio-codec" Changed in v2: - switch to simple-audio-card - fix typo in commit message - no underscores in node names - rename "sgtl5000-sound" node to "sound" --- .../dts/freescale/imx8mp-msc-sm2s-ep1.dts | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) base-commit: b20b0e97fc472249839abdc4d69cffdc695e97aa diff --git a/arch/arm64/boot/dts/freescale/imx8mp-msc-sm2s-ep1.dts b/arch/arm64/boot/dts/freescale/imx8mp-msc-sm2s-ep1.dts index 470ff8e31e32..64d522c71a44 100644 --- a/arch/arm64/boot/dts/freescale/imx8mp-msc-sm2s-ep1.dts +++ b/arch/arm64/boot/dts/freescale/imx8mp-msc-sm2s-ep1.dts @@ -14,6 +14,67 @@ / { compatible = "avnet,sm2s-imx8mp-14N0600E-ep1", "avnet,sm2s-imx8mp-14N0600E", "avnet,sm2s-imx8mp", "fsl,imx8mp"; + + reg_vcc_3v3_audio: 3v3-audio-regulator { + compatible = "regulator-fixed"; + regulator-name = "VCC_3V3_AUD"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + }; + + reg_vcc_1v8_audio: 1v8-audio-regulator { + compatible = "regulator-fixed"; + regulator-name = "VCC_1V8_AUD"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + }; + + sound { + compatible = "simple-audio-card"; + simple-audio-card,name = "sgtl5000-audio"; + simple-audio-card,format = "i2s"; + simple-audio-card,frame-master = <&codec_dai>; + simple-audio-card,bitclock-master = <&codec_dai>; + + simple-audio-card,cpu { + sound-dai = <&sai2>; + }; + + codec_dai: simple-audio-card,codec { + sound-dai = <&sgtl5000>; + }; + }; +}; + +&i2c1 { + sgtl5000: audio-codec@a { + compatible = "fsl,sgtl5000"; + reg = <0x0a>; + + assigned-clocks = <&clk IMX8MP_CLK_CLKOUT1_SEL>; + assigned-clock-parents = <&clk IMX8MP_CLK_24M>; + assigned-clock-rates = <24000000>; + clocks = <&clk IMX8MP_CLK_CLKOUT1>; + clock-names = "mclk"; + #sound-dai-cells = <0>; + + VDDA-supply = <®_vcc_3v3_audio>; + VDDD-supply = <®_vcc_1v8_audio>; + VDDIO-supply = <®_vcc_1v8_audio>; + }; +}; + +/* I2S-0 = sai2 */ +&sai2 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_sai2>; + + assigned-clocks = <&clk IMX8MP_CLK_SAI2>; + assigned-clock-parents = <&clk IMX8MP_AUDIO_PLL1_OUT>; + assigned-clock-rates = <12288000>; + + fsl,sai-mclk-direction-output; + status = "okay"; }; &flexcan1 { @@ -32,6 +93,15 @@ &iomuxc { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_smarc_gpio>; + pinctrl_sai2: sai2grp { + fsl,pins = < + MX8MP_IOMUXC_SAI2_TXFS__AUDIOMIX_SAI2_TX_SYNC 0xd6 + MX8MP_IOMUXC_SAI2_TXC__AUDIOMIX_SAI2_TX_BCLK 0xd6 + MX8MP_IOMUXC_SAI2_RXD0__AUDIOMIX_SAI2_RX_DATA00 0xd6 + MX8MP_IOMUXC_SAI2_TXD0__AUDIOMIX_SAI2_TX_DATA00 0xd6 + >; + }; + pinctrl_smarc_gpio: smarcgpiosgrp { fsl,pins = , /* GPIO0 */