From patchwork Sun Feb 21 11:07:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Guido_G=C3=BCnther?= X-Patchwork-Id: 385597 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=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable 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 9149FC433E6 for ; Sun, 21 Feb 2021 11:19:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 57A0D64F07 for ; Sun, 21 Feb 2021 11:19:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229863AbhBULS7 (ORCPT ); Sun, 21 Feb 2021 06:18:59 -0500 Received: from honk.sigxcpu.org ([24.134.29.49]:60380 "EHLO honk.sigxcpu.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229867AbhBULS6 (ORCPT ); Sun, 21 Feb 2021 06:18:58 -0500 Received: from localhost (localhost [127.0.0.1]) by honk.sigxcpu.org (Postfix) with ESMTP id 6D18AFB02; Sun, 21 Feb 2021 12:07:16 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at honk.sigxcpu.org Received: from honk.sigxcpu.org ([127.0.0.1]) by localhost (honk.sigxcpu.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pm-qOupt8Lp0; Sun, 21 Feb 2021 12:07:12 +0100 (CET) Received: by bogon.sigxcpu.org (Postfix, from userid 1000) id A94564025A; Sun, 21 Feb 2021 12:07:11 +0100 (CET) From: =?utf-8?q?Guido_G=C3=BCnther?= To: Rob Herring , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Catalin Marinas , Will Deacon , =?utf-8?q?Guido_G=C3=BCnther?= , Martin Kepplinger , "Angus Ainslie (Purism)" , Krzysztof Kozlowski , Bjorn Andersson , Li Yang , Geert Uytterhoeven , Michael Walle , Max Krummenacher , Nishanth Menon , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v1 1/6] arm64: dts: librem5-devkit: Use a less generic codec name Date: Sun, 21 Feb 2021 12:07:06 +0100 Message-Id: <6f977dcdcfecf2fd421aea9b669720581bba41f7.1613905396.git.agx@sigxcpu.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The codec is currently named after the chip but it should be named like the device itself since otherwise it's impossible to distinguish it from other devices using the same codec (e.g. in alsa's UCM). Signed-off-by: Guido Günther --- arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts b/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts index dd217a0760e9..0c0b12c90363 100644 --- a/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts +++ b/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts @@ -165,7 +165,7 @@ wwan_codec: sound-wwan-codec { sound { compatible = "simple-audio-card"; - simple-audio-card,name = "sgtl5000"; + simple-audio-card,name = "Librem 5 Devkit"; simple-audio-card,format = "i2s"; simple-audio-card,widgets = "Microphone", "Microphone Jack", From patchwork Sun Feb 21 11:07:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Guido_G=C3=BCnther?= X-Patchwork-Id: 385600 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=-13.9 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNWANTED_LANGUAGE_BODY, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable 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 A0F50C433DB for ; Sun, 21 Feb 2021 11:18:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6E29264EB3 for ; Sun, 21 Feb 2021 11:18:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229540AbhBULSP (ORCPT ); Sun, 21 Feb 2021 06:18:15 -0500 Received: from honk.sigxcpu.org ([24.134.29.49]:60352 "EHLO honk.sigxcpu.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229634AbhBULSO (ORCPT ); Sun, 21 Feb 2021 06:18:14 -0500 Received: from localhost (localhost [127.0.0.1]) by honk.sigxcpu.org (Postfix) with ESMTP id 0660CFB04; Sun, 21 Feb 2021 12:07:17 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at honk.sigxcpu.org Received: from honk.sigxcpu.org ([127.0.0.1]) by localhost (honk.sigxcpu.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pMBaL3QD9tAE; Sun, 21 Feb 2021 12:07:14 +0100 (CET) Received: by bogon.sigxcpu.org (Postfix, from userid 1000) id B3BA4403D9; Sun, 21 Feb 2021 12:07:11 +0100 (CET) From: =?utf-8?q?Guido_G=C3=BCnther?= To: Rob Herring , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Catalin Marinas , Will Deacon , =?utf-8?q?Guido_G=C3=BCnther?= , Martin Kepplinger , "Angus Ainslie (Purism)" , Krzysztof Kozlowski , Bjorn Andersson , Li Yang , Geert Uytterhoeven , Michael Walle , Max Krummenacher , Nishanth Menon , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v1 2/6] arm64: dts: librem5-devkit: Add speaker amplifier Date: Sun, 21 Feb 2021 12:07:07 +0100 Message-Id: <53e81ef700ebc77acea774e691888ae8a0a8d4cf.1613905397.git.agx@sigxcpu.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Wire up the amplifier that drives the builtin speaker. Signed-off-by: Guido Günther --- .../dts/freescale/imx8mq-librem5-devkit.dts | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts b/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts index 0c0b12c90363..d01bed5eb9e0 100644 --- a/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts +++ b/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts @@ -165,19 +165,21 @@ wwan_codec: sound-wwan-codec { sound { compatible = "simple-audio-card"; + simple-audio-card,aux-devs = <&speaker_amp>; simple-audio-card,name = "Librem 5 Devkit"; simple-audio-card,format = "i2s"; simple-audio-card,widgets = "Microphone", "Microphone Jack", "Headphone", "Headphone Jack", - "Speaker", "Speaker Ext", + "Speaker", "Builtin Speaker", "Line", "Line In Jack"; simple-audio-card,routing = "MIC_IN", "Microphone Jack", "Microphone Jack", "Mic Bias", "LINE_IN", "Line In Jack", "Headphone Jack", "HP_OUT", - "Speaker Ext", "LINE_OUT"; + "Builtin Speaker", "Speaker Amp OUTR", + "Speaker Amp INR", "LINE_OUT"; simple-audio-card,cpu { sound-dai = <&sai2>; @@ -207,6 +209,15 @@ telephony_link_master: simple-audio-card,codec { }; }; + speaker_amp: speaker-amp { + compatible = "simple-audio-amplifier"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_spkamp>; + VCC-supply = <®_3v3_p>; + sound-name-prefix = "Speaker Amp"; + enable-gpios = <&gpio5 3 GPIO_ACTIVE_HIGH>; + }; + vibrator { compatible = "gpio-vibrator"; pinctrl-names = "default"; @@ -641,6 +652,12 @@ MX8MQ_IOMUXC_SAI5_RXFS_GPIO3_IO19 0x8 /* IMU_INT */ >; }; + pinctrl_spkamp: spkamp { + fsl,pins = < + MX8MQ_IOMUXC_SPDIF_TX_GPIO5_IO3 0x81 /* MUTE */ + >; + }; + pinctrl_pmic: pmicgrp { fsl,pins = < MX8MQ_IOMUXC_GPIO1_IO03_GPIO1_IO3 0x80 /* PMIC intr */ From patchwork Sun Feb 21 11:07:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Guido_G=C3=BCnther?= X-Patchwork-Id: 385599 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=-13.9 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNWANTED_LANGUAGE_BODY, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable 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 E5020C43381 for ; Sun, 21 Feb 2021 11:18:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9D8C164F0E for ; Sun, 21 Feb 2021 11:18:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229663AbhBULSR (ORCPT ); Sun, 21 Feb 2021 06:18:17 -0500 Received: from honk.sigxcpu.org ([24.134.29.49]:60356 "EHLO honk.sigxcpu.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229817AbhBULSP (ORCPT ); Sun, 21 Feb 2021 06:18:15 -0500 Received: from localhost (localhost [127.0.0.1]) by honk.sigxcpu.org (Postfix) with ESMTP id 83C6DFB08; Sun, 21 Feb 2021 12:07:23 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at honk.sigxcpu.org Received: from honk.sigxcpu.org ([127.0.0.1]) by localhost (honk.sigxcpu.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xhnrK9k1cf-W; Sun, 21 Feb 2021 12:07:22 +0100 (CET) Received: by bogon.sigxcpu.org (Postfix, from userid 1000) id E2D35403FF; Sun, 21 Feb 2021 12:07:11 +0100 (CET) From: =?utf-8?q?Guido_G=C3=BCnther?= To: Rob Herring , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Catalin Marinas , Will Deacon , =?utf-8?q?Guido_G=C3=BCnther?= , Martin Kepplinger , "Angus Ainslie (Purism)" , Krzysztof Kozlowski , Bjorn Andersson , Li Yang , Geert Uytterhoeven , Michael Walle , Max Krummenacher , Nishanth Menon , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v1 6/6] arm64: dts: librem5-devkit: Move headphone detection to sound card Date: Sun, 21 Feb 2021 12:07:11 +0100 Message-Id: <4c16b2bc0f0d1e3cd2beaf0edb8dd017b8ee62d7.1613905397.git.agx@sigxcpu.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org This allows for automatic output source switching in userspace. Enable the pullup on the GPIO to actually make it trigger and mark it as active-high since detection is reversed otherwise. Signed-off-by: Guido Günther --- .../dts/freescale/imx8mq-librem5-devkit.dts | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts b/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts index f818af592046..e3bfef98090a 100644 --- a/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts +++ b/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts @@ -50,13 +50,6 @@ btn2 { linux,code = ; }; - hp-det { - label = "HP_DET"; - gpios = <&gpio3 20 GPIO_ACTIVE_LOW>; - wakeup-source; - linux,code = ; - }; - wwan-wake { label = "WWAN_WAKE"; gpios = <&gpio3 8 GPIO_ACTIVE_LOW>; @@ -173,22 +166,25 @@ mic_mux: mic-mux { sound { compatible = "simple-audio-card"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_hpdet>; simple-audio-card,aux-devs = <&speaker_amp>, <&mic_mux>; simple-audio-card,name = "Librem 5 Devkit"; simple-audio-card,format = "i2s"; simple-audio-card,widgets = "Microphone", "Builtin Microphone", "Microphone", "Headset Microphone", - "Headphone", "Headphone Jack", + "Headphone", "Headphones", "Speaker", "Builtin Speaker"; simple-audio-card,routing = "MIC_IN", "Mic Mux OUT", "Mic Mux IN1", "Headset Microphone", "Mic Mux IN2", "Builtin Microphone", "Mic Mux OUT", "Mic Bias", - "Headphone Jack", "HP_OUT", + "Headphones", "HP_OUT", "Builtin Speaker", "Speaker Amp OUTR", "Speaker Amp INR", "LINE_OUT"; + simple-audio-card,hp-det-gpio = <&gpio3 20 GPIO_ACTIVE_HIGH>; simple-audio-card,cpu { sound-dai = <&sai2>; @@ -630,7 +626,6 @@ pinctrl_gpio_keys: gpiokeygrp { fsl,pins = < MX8MQ_IOMUXC_SAI2_RXFS_GPIO4_IO21 0x16 MX8MQ_IOMUXC_SAI2_RXC_GPIO4_IO22 0x16 - MX8MQ_IOMUXC_SAI5_RXC_GPIO3_IO20 0x180 /* HP_DET */ MX8MQ_IOMUXC_NAND_DATA02_GPIO3_IO8 0x80 /* nWoWWAN */ >; }; @@ -641,6 +636,12 @@ MX8MQ_IOMUXC_SPDIF_RX_GPIO5_IO4 0xc6 /* nHAPTIC */ >; }; + pinctrl_hpdet: hpdetgrp { + fsl,pins = < + MX8MQ_IOMUXC_SAI5_RXC_GPIO3_IO20 0xC0 /* HP_DET */ + >; + }; + pinctrl_i2c1: i2c1grp { fsl,pins = < MX8MQ_IOMUXC_I2C1_SCL_I2C1_SCL 0x4000001f