From patchwork Thu Aug 12 19:47:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas Stach X-Patchwork-Id: 12434111 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72B73C4338F for ; Thu, 12 Aug 2021 19:59:51 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 2A7B060F57 for ; Thu, 12 Aug 2021 19:59:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2A7B060F57 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lynxeye.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=fBLAQS+JJ8qcst3/L7C98nVn+SmeFEiA0uqeR30+re8=; b=W+AywTDGdR7TUL Sju/tvEsMS8v9dFQ6ow0gCfvMIs96g+pQAVXIez3K2x5P6+vb8PY3Bx3JL0+izkNBxcNaFPCmr+yJ UInozvpuVGG8ClxJHooJj1stNEQvhJZaCK64QZqc1PWuKz9HUd7+yBTI0DBH+9tErU8x73iUZ/PAS BlcZX89dB0VTlmlWL0z2DK6/p2ZSxq1rs2N7+9XYcq+vWAqBsIXkCSBljxjQAhBUgAHKC+y/lmHJT 1FGHrbhrDW75gYfKWUqRDH/8601/byV6Miraqrt2rnT+dwn3mN6CkK0B3TURzm1bQx5PNgpT+vU1Q agBBY9YwLsSxup1vFjAA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mEGpb-00B5yR-5b; Thu, 12 Aug 2021 19:57:35 +0000 Received: from ns.lynxeye.de ([87.118.118.114] helo=lynxeye.de) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mEGoy-00B5hG-1m for linux-arm-kernel@lists.infradead.org; Thu, 12 Aug 2021 19:56:57 +0000 Received: by lynxeye.de (Postfix, from userid 501) id E9997E74217; Thu, 12 Aug 2021 21:47:21 +0200 (CEST) Received: from astat.fritz.box (a89-183-72-190.net-htp.de [89.183.72.190]) by lynxeye.de (Postfix) with ESMTPA id 6A2E4E74211; Thu, 12 Aug 2021 21:47:15 +0200 (CEST) From: Lucas Stach To: Shawn Guo Cc: Fabio Estevam , kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, "Lukas F . Hartmann" Subject: [PATCH] arm64: dts: imx8mq-reform2: add sound support Date: Thu, 12 Aug 2021 21:47:12 +0200 Message-Id: <20210812194712.300116-1-dev@lynxeye.de> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210812_125656_285707_6C120F45 X-CRM114-Status: GOOD ( 13.87 ) 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 This adds sound support to the Reform2. It differs from the downstream implementation in that the codec is used as the BCLK and FSYNC master and the i.MX8MQ only supplies a fixed 25MHz MCLK from the oscillator. This allows to support a wider range of audio rates by using the codec PLL and to shut down the audio PLLs on the i.MX8MQ SoC side. Signed-off-by: Lucas Stach Reviewed-by: Fabio Estevam --- .../boot/dts/freescale/imx8mq-mnt-reform2.dts | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/arch/arm64/boot/dts/freescale/imx8mq-mnt-reform2.dts b/arch/arm64/boot/dts/freescale/imx8mq-mnt-reform2.dts index 099b0472db5d..2535268f0984 100644 --- a/arch/arm64/boot/dts/freescale/imx8mq-mnt-reform2.dts +++ b/arch/arm64/boot/dts/freescale/imx8mq-mnt-reform2.dts @@ -40,6 +40,24 @@ reg_main_usb: regulator-main-usb { regulator-max-microvolt = <5000000>; vin-supply = <®_main_5v>; }; + + sound { + compatible = "fsl,imx-audio-wm8960"; + audio-cpu = <&sai2>; + audio-codec = <&wm8960>; + audio-routing = + "Headphone Jack", "HP_L", + "Headphone Jack", "HP_R", + "Ext Spk", "SPK_LP", + "Ext Spk", "SPK_LN", + "Ext Spk", "SPK_RP", + "Ext Spk", "SPK_RN", + "LINPUT1", "Mic Jack", + "Mic Jack", "MICB", + "LINPUT2", "Line In Jack", + "RINPUT2", "Line In Jack"; + model = "wm8960-audio"; + }; }; &fec1 { @@ -51,6 +69,14 @@ &i2c3 { pinctrl-0 = <&pinctrl_i2c3>; status = "okay"; + wm8960: codec@1a { + compatible = "wlf,wm8960"; + reg = <0x1a>; + clocks = <&clk IMX8MQ_CLK_SAI2_ROOT>; + clock-names = "mclk"; + #sound-dai-cells = <0>; + }; + rtc@68 { compatible = "nxp,pcf8523"; reg = <0x68>; @@ -89,6 +115,17 @@ ®_soc_gpu_vpu { vin-supply = <®_main_5v>; }; +&sai2 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_sai2>; + assigned-clocks = <&clk IMX8MQ_CLK_SAI2>; + assigned-clock-parents = <&clk IMX8MQ_CLK_25M>; + assigned-clock-rates = <25000000>; + fsl,sai-mclk-direction-output; + fsl,sai-asynchronous; + status = "okay"; +}; + &snvs_rtc { status = "disabled"; }; @@ -144,6 +181,18 @@ MX8MQ_IOMUXC_SAI5_RXD2_GPIO3_IO23 0x16 >; }; + pinctrl_sai2: sai2grp { + fsl,pins = < + MX8MQ_IOMUXC_SAI2_RXD0_SAI2_RX_DATA0 0xd6 + MX8MQ_IOMUXC_SAI2_RXFS_SAI2_RX_SYNC 0xd6 + MX8MQ_IOMUXC_SAI2_TXC_SAI2_TX_BCLK 0xd6 + MX8MQ_IOMUXC_SAI2_TXFS_SAI2_TX_SYNC 0xd6 + MX8MQ_IOMUXC_SAI2_RXC_SAI2_RX_BCLK 0xd6 + MX8MQ_IOMUXC_SAI2_MCLK_SAI2_MCLK 0xd6 + MX8MQ_IOMUXC_SAI2_TXD0_SAI2_TX_DATA0 0xd6 + >; + }; + pinctrl_uart2: uart2grp { fsl,pins = < MX8MQ_IOMUXC_UART2_RXD_UART2_DCE_RX 0x45