From patchwork Thu Aug 31 11:51:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Ford X-Patchwork-Id: 719213 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B31B4C83F10 for ; Thu, 31 Aug 2023 11:51:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231867AbjHaLvr (ORCPT ); Thu, 31 Aug 2023 07:51:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231241AbjHaLvq (ORCPT ); Thu, 31 Aug 2023 07:51:46 -0400 Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8E53CFF; Thu, 31 Aug 2023 04:51:43 -0700 (PDT) Received: by mail-io1-xd31.google.com with SMTP id ca18e2360f4ac-794c7d95ba5so26844639f.0; Thu, 31 Aug 2023 04:51:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693482703; x=1694087503; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ihsq1G+Hub3rKossUtgp/zZy1yTWO30XUHy6RAXp+uk=; b=nIrjaccbsnE3t/jCjFBWjij+buylw9yDya53fs4k1gEUotlY+HfPp2O8tY5uRqohrR avXtg9E2puV++Q55BpPQEO7/m+9qmtQ+pP8maQ+bTrWbv8+NjKpynV+dnWSB7jLB5/zm qnLxa+3pOBUxzfjVMYY67i1LL7r7jJDFsafElIrqWAEkPeBD3ONkIikZLoDPNT3TCKvg Iv+h5vBMLmMraaT+cbhuQ7HW4Z4hp+zmfefhut4+xZ/PnPho0+3raAAh0gYAzE73Hq9Y o83KiebZfnQcAZtYJcO1l1tXUfqqdSwISbIwOeYaJiXJgEE92eBjuqd26rlG6WnBx1qv jq4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693482703; x=1694087503; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ihsq1G+Hub3rKossUtgp/zZy1yTWO30XUHy6RAXp+uk=; b=S3+yz8+Li6Yo9BXxsEtX3jVw7Pa2w9iXxOXLo5nYuCiZK42xQKZMntXSojTqnbsSXK a4tS2HhfRcCV+8DQdDH7kCXirzidBESDLF9L2WWX+Jd1PXI2g6/0sGY7IEiDjpDuN3AZ jSviZzqXK44qrGQ1UoBRxjWxZYWcn0xOJ1K2tuyfdw8RaH53QJ7uDKLmfjQCCs7dJt56 G8XeXtNd20qgU0lAN4SFIFE1xADYpB9MlRwKTGfPgLMNtq/9G8V+iOcmQuaTu7GIgD2z fbI13WDFI4jBS6DxvQMLYlb7MhavD3z3oMAHd90xr7cGL5cQZ/Pedg5R6bizWqru27eg ln+g== X-Gm-Message-State: AOJu0YxyHlpCZnnB5PuW85DPrkLJu1Z01sOm1QVqITMTZx97QewXIcnt bfXxi2LYPk/ITL3H+/S0pPM= X-Google-Smtp-Source: AGHT+IEnv1P/QYCarKpZ1Xer0P5ZGSgekwP3ctv3JCpSTmZKWn/RaUOys/p1eV8kWbXegyupSqv0Hw== X-Received: by 2002:a6b:fe15:0:b0:787:1a8f:1d08 with SMTP id x21-20020a6bfe15000000b007871a8f1d08mr4906178ioh.15.1693482702990; Thu, 31 Aug 2023 04:51:42 -0700 (PDT) Received: from aford-B741.lan ([2601:447:d001:897f:2a0f:e1d5:3688:f2b8]) by smtp.gmail.com with ESMTPSA id o28-20020a02cc3c000000b0042b1d495aecsm353529jap.123.2023.08.31.04.51.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Aug 2023 04:51:42 -0700 (PDT) From: Adam Ford To: linux-arm-kernel@lists.infradead.org Cc: aford@beaconembedded.com, Adam Ford , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/4] arm64: dts: imx8mm-beacon: Migrate sound card to simple-audio-card Date: Thu, 31 Aug 2023 06:51:25 -0500 Message-Id: <20230831115128.254226-1-aford173@gmail.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Instead of using a custom glue layer connecting the wm8962 CODEC to the SAI3 sound-dai, migrate the sound card to simple-audio-card. This also brings this board in line with the imx8mn-beacon and imx8mp-beacon. Signed-off-by: Adam Ford diff --git a/arch/arm64/boot/dts/freescale/imx8mm-beacon-baseboard.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-beacon-baseboard.dtsi index b10e2a703a44..313e93663d6f 100644 --- a/arch/arm64/boot/dts/freescale/imx8mm-beacon-baseboard.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8mm-beacon-baseboard.dtsi @@ -98,18 +98,30 @@ reg_usdhc2_vmmc: regulator-usdhc2 { enable-active-high; }; - sound { - compatible = "fsl,imx-audio-wm8962"; - model = "wm8962-audio"; - audio-cpu = <&sai3>; - audio-codec = <&wm8962>; - audio-routing = - "Headphone Jack", "HPOUTL", - "Headphone Jack", "HPOUTR", - "Ext Spk", "SPKOUTL", - "Ext Spk", "SPKOUTR", - "AMIC", "MICBIAS", - "IN3R", "AMIC"; + sound-wm8962 { + compatible = "simple-audio-card"; + simple-audio-card,name = "wm8962"; + simple-audio-card,format = "i2s"; + simple-audio-card,widgets = "Headphone", "Headphones", + "Microphone", "Headset Mic", + "Speaker", "Speaker"; + simple-audio-card,routing = "Headphones", "HPOUTL", + "Headphones", "HPOUTR", + "Speaker", "SPKOUTL", + "Speaker", "SPKOUTR", + "Headset Mic", "MICBIAS", + "IN3R", "Headset Mic"; + + simple-audio-card,cpu { + sound-dai = <&sai3>; + }; + + simple-audio-card,codec { + sound-dai = <&wm8962>; + clocks = <&clk IMX8MM_CLK_SAI3_ROOT>; + frame-master; + bitclock-master; + }; }; }; @@ -192,6 +204,7 @@ wm8962: audio-codec@1a { 0x0000 /* 4:FN_DMICCDAT */ 0x0000 /* 5:Default */ >; + #sound-dai-cells = <0>; }; pca6416_0: gpio@20 { From patchwork Thu Aug 31 11:51:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Ford X-Patchwork-Id: 719212 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B5C2C83F34 for ; Thu, 31 Aug 2023 11:51:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237743AbjHaLvu (ORCPT ); Thu, 31 Aug 2023 07:51:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231241AbjHaLvt (ORCPT ); Thu, 31 Aug 2023 07:51:49 -0400 Received: from mail-io1-xd2b.google.com (mail-io1-xd2b.google.com [IPv6:2607:f8b0:4864:20::d2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2B24E40; Thu, 31 Aug 2023 04:51:46 -0700 (PDT) Received: by mail-io1-xd2b.google.com with SMTP id ca18e2360f4ac-7923ae72111so27401239f.0; Thu, 31 Aug 2023 04:51:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693482706; x=1694087506; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=M+kNWrgmNs4s12nz1ZRGpluVgBLXFMVQIrdkMeSABd4=; b=LNtfyBKr9imRQww2QDK40UJ3gLi1vdsxrTJTyC9JVwLkuhqb70+rZNdwHb+YF3BRUG kVJhidwm6Lh1tJ3l98WbE07ADgr0G/WRPg5rYzHqx+oZnoMt99hKDti5+yUvBFl/gYOU 0mdhiUCVX2KFybgkv+j/95lqKU+k1zirJLVKCAgdWC3GneNZP5CNpkohiuy2Yeig/C0I wtTx32sCgAvNVxBxN2ZGx5rgtib9neVOD8F0sXsQ4D4q/kcCnncpeiqpcM2nfS9vE/8d XJtuhIry7VlCjG3Iqum+JVvmaroihU0hXLdpKZPOD/gZVgVS2+XBtlLbQxG+RusV3QRT bfjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693482706; x=1694087506; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=M+kNWrgmNs4s12nz1ZRGpluVgBLXFMVQIrdkMeSABd4=; b=NDJqbGZL46AM0cFMdzKeP5/oyHdGMqWRn3RXVfCAFwhjAKjVkAAVzP0l6EFJUOqr08 F6QGJa/wRaLoIRJPEwQ/FWL9UMTjOVx24VGozyUwJdfNPhJ8fZcS6h2u/2HMgjceVT62 VBPvEU/pHDt5hVNtaJNGqLk7ip0KyjKIrbDHPXRgxm9d2sBIN6xlie/CEhEb8ifFnXX/ TBLWAMgk9DzFc7QI+W7oii+py8V4PDK1AtxGImHhBTPF8OPAAOm0HE/OSYr7wmh8xbAH M6NMllKmP9/OGBM8W2s6uh9VGO5eDnoM3+GpZNd/A1W3dy6RJ2XAZtZfhngrm+/twcjT hTiA== X-Gm-Message-State: AOJu0YyAoOvSYE6f439twyir31T9LP0HDf/vaTeNDfUmFqUJyleDsSa7 kPNBP0NdCe6g0DQHRhrEiaM= X-Google-Smtp-Source: AGHT+IFqcrNSlFBq1FDUlcMdCiwIg1ohn3weVauam3YbXpkxgZTUk93HsxScIFm8E5LyyojQ0lUOBA== X-Received: by 2002:a6b:d902:0:b0:790:fab3:2052 with SMTP id r2-20020a6bd902000000b00790fab32052mr5174751ioc.5.1693482706145; Thu, 31 Aug 2023 04:51:46 -0700 (PDT) Received: from aford-B741.lan ([2601:447:d001:897f:2a0f:e1d5:3688:f2b8]) by smtp.gmail.com with ESMTPSA id o28-20020a02cc3c000000b0042b1d495aecsm353529jap.123.2023.08.31.04.51.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Aug 2023 04:51:45 -0700 (PDT) From: Adam Ford To: linux-arm-kernel@lists.infradead.org Cc: aford@beaconembedded.com, Adam Ford , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/4] arm64: dts: imx8mn-beacon: Add DMIC support Date: Thu, 31 Aug 2023 06:51:27 -0500 Message-Id: <20230831115128.254226-3-aford173@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230831115128.254226-1-aford173@gmail.com> References: <20230831115128.254226-1-aford173@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The baseboard has a connector for a pulse density microphone. This is connected via the micfil interface and uses the DMIC audio codec with the simple-audio-card. Signed-off-by: Adam Ford diff --git a/arch/arm64/boot/dts/freescale/imx8mn-beacon-baseboard.dtsi b/arch/arm64/boot/dts/freescale/imx8mn-beacon-baseboard.dtsi index 16761975f56e..0b51c0c71423 100644 --- a/arch/arm64/boot/dts/freescale/imx8mn-beacon-baseboard.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8mn-beacon-baseboard.dtsi @@ -4,6 +4,12 @@ */ / { + dmic_codec: dmic-codec { + compatible = "dmic-codec"; + num-channels = <1>; + #sound-dai-cells = <0>; + }; + leds { compatible = "gpio-leds"; @@ -74,6 +80,22 @@ reg_usb_otg_vbus: regulator-usb { enable-active-high; }; + sound-dmic { + compatible = "simple-audio-card"; + simple-audio-card,name = "dmic"; + simple-audio-card,format = "pdm"; + simple-audio-card,bitclock-master = <&dailink_master>; + simple-audio-card,frame-master = <&dailink_master>; + + dailink_master: simple-audio-card,cpu { + sound-dai = <&micfil>; + }; + + simple-audio-card,codec { + sound-dai = <&dmic_codec>; + }; + }; + sound-wm8962 { compatible = "simple-audio-card"; simple-audio-card,name = "wm8962"; @@ -221,6 +243,16 @@ mipi_csi_in: endpoint { }; }; +&micfil { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_pdm>; + assigned-clocks = <&clk IMX8MN_CLK_PDM>; + assigned-clock-parents = <&clk IMX8MN_AUDIO_PLL1_OUT>; + assigned-clock-rates = <49152000>; + status = "okay"; + #sound-dai-cells = <0>; +}; + &sai3 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_sai3>; @@ -311,6 +343,13 @@ MX8MN_IOMUXC_SAI2_MCLK_GPIO4_IO27 0x19 >; }; + pinctrl_pdm: pdmgrp { + fsl,pins = < + MX8MN_IOMUXC_SAI5_RXC_PDM_CLK 0xd6 + MX8MN_IOMUXC_SAI5_RXD0_PDM_BIT_STREAM0 0xd6 + >; + }; + pinctrl_reg_usb_otg: reg-otggrp { fsl,pins = < MX8MN_IOMUXC_SAI3_RXC_GPIO4_IO29 0x19