From patchwork Mon Mar 19 20:14:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Porter X-Patchwork-Id: 10294767 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9885C60386 for ; Mon, 19 Mar 2018 20:14:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8475B294BC for ; Mon, 19 Mar 2018 20:14:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7892E294CC; Mon, 19 Mar 2018 20:14:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E30D8294BC for ; Mon, 19 Mar 2018 20:14:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date:Subject:To: From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=2YPvs/WDj3DxzsgSj4jGbhn2pjr279DMaKkNBpAHY4U=; b=efPL/GEzV9Ge6G BzQugETYHNdqCUuFxM99r8kneP+hyM1fu7o9GlN8lz5f8UJouwqKKRGrA/MOfZzaUNFCrr/tHbaZ4 E1I7ASR5a1YpCpH8KB/HFagEu8kCuagC/tuZzXvJk5Q6jxHxjVI5mPuXZ8TfY1phiywxdNnPVC3Q/ CksXwgoHmR6W7+bn6T3skwI5gj6Si18HHwQaqTKK3/Ub+yJfnFpY77oPrTTHtw1DWBu1Q8Q5Slu9A Z71Gz097h20U5qgLeoHHqlimpdRsfGhA85l8LQIVzGv3BiurjjuYVPTh2NXa2MFj1pp9QOVB8TSnu r03oX/A0eywCuRuLNZLA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1ey1Az-0005h4-6s; Mon, 19 Mar 2018 20:14:37 +0000 Received: from mail-io0-x244.google.com ([2607:f8b0:4001:c06::244]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1ey1Au-0005et-Hi for linux-arm-kernel@lists.infradead.org; Mon, 19 Mar 2018 20:14:34 +0000 Received: by mail-io0-x244.google.com with SMTP id y128so4926177iod.4 for ; Mon, 19 Mar 2018 13:14:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=from:to:subject:date:message-id; bh=bzcigOnh0IYpjU384LiNm5VQekZnrUnQKIs44ts+Nx4=; b=BseqOuYp7UsKN2OGNjXNS1CrNhd41ffSIuE0rMYxvAJmJk5jfRpfApmGTNZx2TiKD+ 3wxs8D06BqsGziJoVIMXVgWa9188ZYkDjzmpORCnwzXrVmxGEcAAzFBfc1Xvuo5o4mA4 fR2w6NyN2HjSBvWqP+u2F7nYxDChlV1g6yV7o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=bzcigOnh0IYpjU384LiNm5VQekZnrUnQKIs44ts+Nx4=; b=IxRiBH3kp4n7IelaR9iJSdX3RAWKo14uk9cGf4ZolVWdd4Xgr24w15sgOCPsdR+JdX rG6fBi2kuecpo3l9URdDHFXCqmOZNOmqEAH1etBVvz2tTXWNV9+ZiRj4QS5obR5VCWZA wwTuLAFrYnYByX+PRocxLlejbEl4liXnC/TICtAmLPGCNmcEP+MwFFAeD67f0adxuPjE KUQqlBK07kBssiCks7DOwEmDWtx2T4fhY3SSmvNWkbg8kHoNu4jZgjvwX0GlcvIkQTZw fVcMh+CaMXBQurYCynMtBdnUg/PxIQHPiUVwutCuyMMb/QVLQKn3nNz7b0PQUBbRa0I2 oOmA== X-Gm-Message-State: AElRT7FSSNzBBOSq6LDRxTpuReJdExcbWfaw+kStFB8Bg2PO1Op9XxBx CTSc8XsVj9fpcj45+WPA5MEW4g== X-Google-Smtp-Source: AG47ELtZfKO7nIHLXbVfMMzI5WRP9d+gZgMPSIO6IaW+T7mv8OHONVdDDfhD3I7Zf0nRUe3/PKvb1g== X-Received: by 10.107.2.195 with SMTP id 186mr12983357ioc.162.1521490459043; Mon, 19 Mar 2018 13:14:19 -0700 (PDT) Received: from beef.ohporter.com (cpe-173-90-206-207.neo.res.rr.com. [173.90.206.207]) by smtp.gmail.com with ESMTPSA id w142-v6sm4681itc.31.2018.03.19.13.14.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Mar 2018 13:14:18 -0700 (PDT) From: Matt Porter To: Shawn Guo , Sascha Hauer , Fabio Estevam , Rob Herring , Mark Rutland , Russell King , linux-arm-kernel@lists.infradead.org (moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE), devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS), linux-kernel@vger.kernel.org (open list) Subject: [PATCH v2] arm: dts: hummingboard: convert onboard audio to simple-audio-card Date: Mon, 19 Mar 2018 16:14:13 -0400 Message-Id: <20180319201414.29481-1-mporter@konsulko.com> X-Mailer: git-send-email 2.11.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180319_131432_736128_98036E1B X-CRM114-Status: GOOD ( 15.65 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The HB onboard audio currently makes use of the imx-audio-sgtl5000 binding. This binding does not support auxiliary audio devices such as external amplifiers. The simple-audio-card binding does support this property which allows systems incorporating the HB to add an auxiliary device that's attached to the HB audio jack with an overlay. Convert the HB onboard audio to use simple-audio-card for this additional flexibility. Signed-off-by: Matt Porter Reviewed-by: Fabio Estevam --- v2: - also convert HB1 to simple-audio-card - retain original card name as "On-board Codec" [case change] arch/arm/boot/dts/imx6qdl-hummingboard.dtsi | 52 ++++++++++++++++++++++------ arch/arm/boot/dts/imx6qdl-hummingboard2.dtsi | 48 ++++++++++++++++++++----- 2 files changed, 82 insertions(+), 18 deletions(-) diff --git a/arch/arm/boot/dts/imx6qdl-hummingboard.dtsi b/arch/arm/boot/dts/imx6qdl-hummingboard.dtsi index 92583238ca4a..2f6e51fbd4bc 100644 --- a/arch/arm/boot/dts/imx6qdl-hummingboard.dtsi +++ b/arch/arm/boot/dts/imx6qdl-hummingboard.dtsi @@ -38,6 +38,7 @@ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. */ +#include / { chosen { @@ -105,17 +106,27 @@ vin-supply = <&v_5v0>; }; - sound-sgtl5000 { - audio-codec = <&sgtl5000>; - audio-routing = - "MIC_IN", "Mic Jack", - "Mic Jack", "Mic Bias", + audio: sound-sgtl5000 { + compatible = "simple-audio-card"; + simple-audio-card,name = "On-board Codec"; + simple-audio-card,format = "i2s"; + simple-audio-card,bitclock-master = <&sound_codec>; + simple-audio-card,frame-master = <&sound_codec>; + simple-audio-card,widgets = + "Microphone", "Headphone Jack", + "Headphone", "Headphone Jack"; + simple-audio-card,routing = + "MIC_IN", "Headphone Jack", + "Headphone Jack", "Mic Bias", "Headphone Jack", "HP_OUT"; - compatible = "fsl,imx-audio-sgtl5000"; - model = "On-board Codec"; - mux-ext-port = <5>; - mux-int-port = <1>; - ssi-controller = <&ssi1>; + + sound_cpu: simple-audio-card,cpu { + sound-dai = <&ssi1>; + }; + + sound_codec: simple-audio-card,codec { + sound-dai = <&sgtl5000>; + }; }; sound-spdif { @@ -129,6 +140,26 @@ &audmux { status = "okay"; + + ssi1 { + fsl,audmux-port = <0>; + fsl,port-config = < + (IMX_AUDMUX_V2_PTCR_SYN | + IMX_AUDMUX_V2_PTCR_TFSEL(4) | + IMX_AUDMUX_V2_PTCR_TCSEL(4) | + IMX_AUDMUX_V2_PTCR_TFSDIR | + IMX_AUDMUX_V2_PTCR_TCLKDIR) + IMX_AUDMUX_V2_PDCR_RXDSEL(4) + >; + }; + + pins5 { + fsl,audmux-port = <4>; + fsl,port-config = < + IMX_AUDMUX_V2_PTCR_SYN + IMX_AUDMUX_V2_PDCR_RXDSEL(0) + >; + }; }; &can1 { @@ -161,6 +192,7 @@ compatible = "fsl,sgtl5000"; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_hummingboard_sgtl5000>; + #sound-dai-cells = <0>; reg = <0x0a>; VDDA-supply = <&v_3v2>; VDDIO-supply = <&v_3v2>; diff --git a/arch/arm/boot/dts/imx6qdl-hummingboard2.dtsi b/arch/arm/boot/dts/imx6qdl-hummingboard2.dtsi index dffbc92e0023..47d780fafd87 100644 --- a/arch/arm/boot/dts/imx6qdl-hummingboard2.dtsi +++ b/arch/arm/boot/dts/imx6qdl-hummingboard2.dtsi @@ -38,6 +38,7 @@ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. */ +#include / { chosen { @@ -145,22 +146,52 @@ vin-supply = <&v_5v0>; }; - sound-sgtl5000 { - audio-codec = <&sgtl5000>; - audio-routing = + audio: sound-sgtl5000 { + compatible = "simple-audio-card"; + simple-audio-card,name = "On-board Codec"; + simple-audio-card,format = "i2s"; + simple-audio-card,bitclock-master = <&sound_codec>; + simple-audio-card,frame-master = <&sound_codec>; + simple-audio-card,widgets = + "Microphone", "Mic Jack", + "Headphone", "Headphone Jack"; + simple-audio-card,routing = "MIC_IN", "Mic Jack", "Mic Jack", "Mic Bias", "Headphone Jack", "HP_OUT"; - compatible = "fsl,imx-audio-sgtl5000"; - model = "On-board Codec"; - mux-ext-port = <5>; - mux-int-port = <1>; - ssi-controller = <&ssi1>; + + sound_cpu: simple-audio-card,cpu { + sound-dai = <&ssi1>; + }; + + sound_codec: simple-audio-card,codec { + sound-dai = <&sgtl5000>; + }; }; }; &audmux { status = "okay"; + + ssi1 { + fsl,audmux-port = <0>; + fsl,port-config = < + (IMX_AUDMUX_V2_PTCR_SYN | + IMX_AUDMUX_V2_PTCR_TFSEL(4) | + IMX_AUDMUX_V2_PTCR_TCSEL(4) | + IMX_AUDMUX_V2_PTCR_TFSDIR | + IMX_AUDMUX_V2_PTCR_TCLKDIR) + IMX_AUDMUX_V2_PDCR_RXDSEL(4) + >; + }; + + pins5 { + fsl,audmux-port = <4>; + fsl,port-config = < + IMX_AUDMUX_V2_PTCR_SYN + IMX_AUDMUX_V2_PDCR_RXDSEL(0) + >; + }; }; &ecspi2 { @@ -193,6 +224,7 @@ compatible = "fsl,sgtl5000"; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_hummingboard2_sgtl5000>; + #sound-dai-cells = <0>; reg = <0x0a>; VDDA-supply = <&v_3v2>; VDDD-supply = <&vcc_1p8>;