Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1071131ybh; Wed, 22 Jul 2020 22:48:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyR6paKMTEuc61KCPNz4tGqZGI1ltREtF+5LPr/H4cd5Xd2lGXoeoMFKdMmU+e+enMhU7RF X-Received: by 2002:a50:d784:: with SMTP id w4mr2756422edi.34.1595483316129; Wed, 22 Jul 2020 22:48:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595483316; cv=none; d=google.com; s=arc-20160816; b=CQtwZptHCm82gVWfwk4hqJFBAcNSLdKyRU7ZFrDrhOSzdBNQwxpv9b5GW7oD3MMR5c 286a9qQZyv6KKvlf0BJoXgER/WM7FGK7CJvmnVBZSQBtXQmxAQtJEqdT7PMq2sfAS8WP zkhI+MUS5UyLWomFQL4QfAh8EZN63Fsnnryc4Vng97nMzHwirUEwwVpE9YsdUbnGXBgU o9j19HXNzlT1YOCpI4rj0J0eCWhABwuauA+8Za0RQN6GlxuR1DcCwVa/uJ8OleY2rTu4 AZmOb17PlY37sy0PfgCdiLszDv9GBHnU6pCN4/JeX+BqSI+qYp1Z6vsC28zMkup9Tfe7 hcAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:to:from; bh=03ctbIWLyawu8io6Yjpyk3J8NOva2ug5UdJe4s69E30=; b=J5oSzKkdGFJF+xGJ4q5fwctwLV9CU+gq6gHoJgcX5f9TDLeqOStIsIBQjyQUeSmY7w KUSDZnpxqJdkjJJwfx5d26Q2oza21Dsf9pXKldA0N4NWp6cUI9v2/cfjQpkwWY1zehNR BesF+ET/YLe4vRlVtrHZ5bptMSu28QaQBCkDFO9VgLDZDOwSDwTwJufs62ToQ8xye10r DACgeJ4yeLJHRp4zlaeptt3+EGADt355VZsS3mFQH0+j/wIUMXORc9furdCsWsKRIoNl Thg7tTJrrtl1v5I5/HHAVTMSZR+CjcTAenLspP6iPPm/pRKysZdtzv9XCcVW8S9681l1 Te8A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l12si1339220edq.180.2020.07.22.22.48.13; Wed, 22 Jul 2020 22:48:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725911AbgGWFrj (ORCPT + 99 others); Thu, 23 Jul 2020 01:47:39 -0400 Received: from inva021.nxp.com ([92.121.34.21]:40380 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725536AbgGWFri (ORCPT ); Thu, 23 Jul 2020 01:47:38 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 2E81D200B72; Thu, 23 Jul 2020 07:47:36 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 2FF69200B70; Thu, 23 Jul 2020 07:47:32 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 2AEC7402F2; Thu, 23 Jul 2020 07:47:27 +0200 (CEST) From: Shengjiu Wang To: robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] ARM: dts: imx7d-sdb: Add notes for audio sound card Date: Thu, 23 Jul 2020 13:43:36 +0800 Message-Id: <1595483016-8822-1-git-send-email-shengjiu.wang@nxp.com> X-Mailer: git-send-email 2.7.4 X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Configure the SAI device node, configure audio clock and pinctrl. Enable the audio sound card, which use the SAI1 and wm8960, and enable headphone detection. Signed-off-by: Shengjiu Wang --- arch/arm/boot/dts/imx7d-sdb.dts | 81 +++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) diff --git a/arch/arm/boot/dts/imx7d-sdb.dts b/arch/arm/boot/dts/imx7d-sdb.dts index 17cca8a9f77b..b50b19f2d0f1 100644 --- a/arch/arm/boot/dts/imx7d-sdb.dts +++ b/arch/arm/boot/dts/imx7d-sdb.dts @@ -146,6 +146,24 @@ panel_in: endpoint { }; }; }; + + sound { + compatible = "fsl,imx7d-evk-wm8960", + "fsl,imx-audio-wm8960"; + model = "wm8960-audio"; + audio-cpu = <&sai1>; + audio-codec = <&codec>; + hp-det-gpio = <&gpio2 28 GPIO_ACTIVE_HIGH>; + 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", "AMIC", + "AMIC", "MICB"; + }; }; &adc1 { @@ -363,6 +381,13 @@ codec: wm8960@1a { clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_CLK>; clock-names = "mclk"; wlf,shared-lrclk; + wlf,hp-cfg = <2 2 3>; + wlf,gpio-cfg = <1 3>; + assigned-clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_SRC>, + <&clks IMX7D_PLL_AUDIO_POST_DIV>, + <&clks IMX7D_AUDIO_MCLK_ROOT_CLK>; + assigned-clock-parents = <&clks IMX7D_PLL_AUDIO_POST_DIV>; + assigned-clock-rates = <0>, <884736000>, <12288000>; }; }; @@ -391,6 +416,28 @@ ®_1p2 { vin-supply = <&sw2_reg>; }; +&sai1 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_sai1>; + assigned-clocks = <&clks IMX7D_SAI1_ROOT_SRC>, + <&clks IMX7D_PLL_AUDIO_POST_DIV>, + <&clks IMX7D_SAI1_ROOT_CLK>; + assigned-clock-parents = <&clks IMX7D_PLL_AUDIO_POST_DIV>; + assigned-clock-rates = <0>, <884736000>, <36864000>; + status = "okay"; +}; + +&sai3 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_sai3 &pinctrl_sai3_mclk>; + assigned-clocks = <&clks IMX7D_SAI3_ROOT_SRC>, + <&clks IMX7D_PLL_AUDIO_POST_DIV>, + <&clks IMX7D_SAI3_ROOT_CLK>; + assigned-clock-parents = <&clks IMX7D_PLL_AUDIO_POST_DIV>; + assigned-clock-rates = <0>, <884736000>, <36864000>; + status = "okay"; +}; + &snvs_pwrkey { status = "okay"; }; @@ -550,6 +597,7 @@ MX7D_PAD_SD2_WP__GPIO5_IO10 0x59 pinctrl_hog: hoggrp { fsl,pins = < MX7D_PAD_ECSPI2_SS0__GPIO4_IO23 0x34 /* bt reg on */ + MX7D_PAD_EPDC_BDR0__GPIO2_IO28 0x59 /* headphone detect */ >; }; @@ -615,6 +663,33 @@ MX7D_PAD_LCD_RESET__LCD_RESET 0x79 >; }; + pinctrl_sai1: sai1grp { + fsl,pins = < + MX7D_PAD_SAI1_MCLK__SAI1_MCLK 0x1f + MX7D_PAD_ENET1_RX_CLK__SAI1_TX_BCLK 0x1f + MX7D_PAD_ENET1_CRS__SAI1_TX_SYNC 0x1f + MX7D_PAD_ENET1_COL__SAI1_TX_DATA0 0x30 + MX7D_PAD_ENET1_TX_CLK__SAI1_RX_DATA0 0x1f + >; + }; + + pinctrl_sai2: sai2grp { + fsl,pins = < + MX7D_PAD_SAI2_TX_BCLK__SAI2_TX_BCLK 0x1f + MX7D_PAD_SAI2_TX_SYNC__SAI2_TX_SYNC 0x1f + MX7D_PAD_SAI2_TX_DATA__SAI2_TX_DATA0 0x30 + MX7D_PAD_SAI2_RX_DATA__SAI2_RX_DATA0 0x1f + >; + }; + + pinctrl_sai3: sai3grp { + fsl,pins = < + MX7D_PAD_UART3_TX_DATA__SAI3_TX_BCLK 0x1f + MX7D_PAD_UART3_CTS_B__SAI3_TX_SYNC 0x1f + MX7D_PAD_UART3_RTS_B__SAI3_TX_DATA0 0x30 + >; + }; + pinctrl_spi4: spi4grp { fsl,pins = < MX7D_PAD_GPIO1_IO09__GPIO1_IO9 0x59 @@ -776,4 +851,10 @@ pinctrl_usb_otg2_vbus_reg: usbotg2vbusreggrp { MX7D_PAD_LPSR_GPIO1_IO07__GPIO1_IO7 0x14 >; }; + + pinctrl_sai3_mclk: sai3grp_mclk { + fsl,pins = < + MX7D_PAD_LPSR_GPIO1_IO03__SAI3_MCLK 0x1f + >; + }; }; -- 2.27.0