Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp868780pxb; Sun, 21 Feb 2021 03:11:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJy0Q+JsO2oMFDa2qKnzuQRF0OErm7d9erQJq5KZnFE+PDy794E+JnysZSsDGr2wH6oQStCq X-Received: by 2002:a17:906:f113:: with SMTP id gv19mr3370805ejb.379.1613905896277; Sun, 21 Feb 2021 03:11:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613905896; cv=none; d=google.com; s=arc-20160816; b=u7R8NDg5C5sMIIYBBwfOfvYQd2W3UYYq7dmMzT+XftWX7aZPjts/N60YWe+Qunk/JD Zm3fCZn6W6VpUSqtKBJd86Ln01GaKYCJn2OAPl4HwKEzwrbeOpdd2IYDo9Jp8N/9DblY OmqtvdDg1KqdJzCf+8Tor2C+5j1Uwsu7fPgJ2ir3qYbewut8uobg/P4Wc6Ml+39cTYwB kXwfDMBJmUaMVm+hScWSbPIKVRjwlHN+EzhKnStxDE7rbLm8h0G4G+Whs+lovNO997sx XN5gFGhCMxnOfdSxWBOgUxM9CJ9UhdEzseQ8j9ojMT46SJ6Ht2lycgZwCxn/mD9hN3gd XyAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from; bh=2MbtWGk7t8iJNereLv9D5ApiJpVBU+f2rCd0HmLGK+w=; b=V3XW8RD5OdLbR2HxDhzQjqneKZx8zGHXpGKXn+2TlqZMiFa6SjgSTi0vmVDYmJPiN4 5eFDZ43H9AB7CmMyggksesr5YMHBIxjwi9t5OPvyfyT1q8yLvu3qRzCY1tnt/WkHsWk7 2fiZ3oIgxlXFbDfPs3DHfsvCIBNvNo7V6BHINy0vwgyr6dbYEUKpm794VkyN6Dzs1b8T apf5aEW1A6k14srho78uB8apm4TKD9WBAm/fzGZfy1RwUx+b9nZrxVjVIqvsBASmzKD2 4IoqhR+CvY+zQONXCoSP67J3HCPUtFldo5LTpiBuUGPTIP0hmfo7aEZppJji+LLfCcFh JsJA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q15si6356692edd.127.2021.02.21.03.11.13; Sun, 21 Feb 2021 03:11:36 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230009AbhBULIo (ORCPT + 99 others); Sun, 21 Feb 2021 06:08:44 -0500 Received: from honk.sigxcpu.org ([24.134.29.49]:59994 "EHLO honk.sigxcpu.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229925AbhBULIl (ORCPT ); Sun, 21 Feb 2021 06:08:41 -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=20G=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=20G=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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 -- 2.30.0