From patchwork Wed Feb 22 17:25:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 60623 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp704923wrd; Wed, 22 Feb 2023 09:29:06 -0800 (PST) X-Google-Smtp-Source: AK7set/TTV6MSRw7sVYlFCmqcEnLtKMci5TM2ScnyX+0Muxyz5eujflCc/wXeaaSvE/qhDQqLuUm X-Received: by 2002:a17:906:aac6:b0:8b2:fa6d:45d5 with SMTP id kt6-20020a170906aac600b008b2fa6d45d5mr19539076ejb.71.1677086945913; Wed, 22 Feb 2023 09:29:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677086945; cv=none; d=google.com; s=arc-20160816; b=rdcgw4gu2ZRjOgYT1jGxzZVidWAFMP/AQJhiHxwZY8h8emg1jNHJiMzRjsBapOvSi5 TirzxVqUEoItJDgJO+Ih4Oz/dZx2A/VzDMcf+NtIRy0FvRkfDCUCcEjecACB2rxAw8V0 ZHvz1r4ZMwj35SqFcLol1iaXBc0f1gpL6cuPcrTVlinSQkDqXlon78jOShDZCcmGeAXx dtJKCDst0PNB+q9zoq0dnyjHqTm4296NG0xc7D23WxcpM3QcdaiKBkleb42uSwHJU4LO zmyg4KAYF7OZYG1UsTMfyiT8t0UI4E2etT9oLjV9x5up14x7Tho8F5xdW78pV78+p8D6 b+SQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=liyc04uOfojNPzcXlOkF1rgtORQMcNRHYaWkiDbA6a0=; b=H5j/AAoMhW9ML5AqCWkY30tNTdiunM0HueRSI/SXIyA61WLdxakzdsDkUKv+BnKkvK D3yWDYOFSpEmY1OeD5m1koWPP2llZas0i+Ah5ITkhXGt672+nxwdPUjvSxHXKgNc1Y4W +BkKasRhpULdtBrmGunKuq/wUaIToD3v4+J0SSRlna4nTCoRb96NPU/CGrPa8TggqxEf /yLPvOi0xQiA2vhgMl/atVeCEHqe7x5nnR/Wb5M/0fg306V3QM6dNhZRDb/xBQ5AK66I R4YUfSO1I6nxsL4MTf8//VnnwUgJQ2Nq/BUj4Pp9RY9Nrm9VO3tl3mJfQ91mn1CUvcUu 2nWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=mvjWs1Z5; 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 iy17-20020a170907819100b008ce1317f9a3si10255430ejc.280.2023.02.22.09.28.42; Wed, 22 Feb 2023 09:29:05 -0800 (PST) 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=mvjWs1Z5; 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 S231910AbjBVR0l (ORCPT + 99 others); Wed, 22 Feb 2023 12:26:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229515AbjBVR0i (ORCPT ); Wed, 22 Feb 2023 12:26:38 -0500 Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::222]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33BF541B56; Wed, 22 Feb 2023 09:26:02 -0800 (PST) Received: from booty.fritz.box (unknown [77.244.183.192]) (Authenticated sender: luca.ceresoli@bootlin.com) by mail.gandi.net (Postfix) with ESMTPA id 9323A4000B; Wed, 22 Feb 2023 17:25:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1677086759; 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: in-reply-to:in-reply-to:references:references; bh=liyc04uOfojNPzcXlOkF1rgtORQMcNRHYaWkiDbA6a0=; b=mvjWs1Z5miVuBFhQ2lrmffWQEUftHKgpfdmtOtiNOKutAM7No18k/KwnwSTsSxOXe2aUms XNs3u/bdFz07d8XJFz4Mf1mNL8e+7xXuH+D7aWyN/p4UdW9i9FIEB+Fe34Zd9g1y3d5ES7 0tyava2uy+oe6FI+3Id5/4DEcCgSvbj8R4DnJQjD1Ur6KNaVw0kbNZ6xiG+eoHhg9Xz0ap JE18X0lYrp9C5qHwspz3T3h1JfBl8A9pM1tDRiP6MIr2/qVdKh3TTeQhtozxzs1SidYIAJ J2PVlp6SBl7i8ex/TODZ2wV1tzELjcC/S+f/Ha/y+g6UMaDKy42WH8csXWp65A== From: Luca Ceresoli To: Rob Herring , Krzysztof Kozlowski , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Luca Ceresoli , Martyn Welch Cc: Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Marek Vasut , Abel Vesa , Jacky Bai , Laurent Pinchart , Lucas Stach , Michael Turquette , Stephen Boyd , Thomas Petazzoni Subject: [PATCH] arm64: dts: imx8mp-msc-sm2s: Add sound card Date: Wed, 22 Feb 2023 18:25:52 +0100 Message-Id: <20230222172552.1545519-1-luca.ceresoli@bootlin.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230222182252.2ad6d82b@booty> References: <20230222182252.2ad6d82b@booty> 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,SPF_HELO_NONE, SPF_PASS 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?1758553121711785466?= X-GMAIL-MSGID: =?utf-8?q?1758553121711785466?= The MSC SM2-MB-EP1 carrier board for the SM2S-IMX8PLUS SMARC module has an NXPP 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 --- .../dts/freescale/imx8mp-msc-sm2s-ep1.dts | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) 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..894d9809f76d 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,57 @@ / { 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>; + }; + + sgtl5000-sound { + compatible = "fsl,imx-audio-sgtl5000"; + model = "imx-sgtl5000"; + audio-cpu = <&sai2>; + audio-codec = <&sgtl5000_codec>; + }; +}; + +&i2c1 { + sgtl5000_codec: sgtl5000@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"; + + 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 { @@ -49,4 +100,13 @@ pinctrl_smarc_gpio: smarcgpiosgrp { , /* GPIO12 */ ; /* GPIO13 */ }; + + 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 + >; + }; };