From patchwork Sun May 19 08:17:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artur Weber X-Patchwork-Id: 13667815 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9039BC25B75 for ; Sun, 19 May 2024 08:18:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=mmrJjPkS1gzMKv7vR80xCDnsxO/oqoLNZB73+mOsK3k=; b=pULBqdM8lp7mX5 IySWZ8JQuLMT2XoSTMqvAqmpwmtS2TFsWkbQqQLgFDPxKyfEcP/GXJdVW9VHpuo9LZCxxtM+m6Dcr +3ewU/l+WcPbqOV1tBvnH08EFOfe0OJ4HZX06FzvkFPK5DKyV0w5GM+v8DpEIvWlE8s9KVQT2aCcO qjoK6hnniItatu05ohrmzATs25agpoPT0YYcA0dNRZYdFe8kRx9koaLJUx9y4VfewhJxlE/z/988Z D7sYozIXgwiNbrA3Z3TEYNN6hYGBcQ+lO8LOk79tyuGxN16tS4M/NTdSLhKUXW+k5LPykQt6/4AwB sssYzIu4a0sUDukcIKUQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s8bkW-0000000Bd03-08ca; Sun, 19 May 2024 08:18:32 +0000 Received: from mail-lf1-x12c.google.com ([2a00:1450:4864:20::12c]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s8bkI-0000000BcrZ-1pWz for linux-arm-kernel@lists.infradead.org; Sun, 19 May 2024 08:18:20 +0000 Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-51f12ccff5eso4104577e87.1 for ; Sun, 19 May 2024 01:18:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716106690; x=1716711490; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=GBQXsZU35VYhqiFUuzQSMRWlgIZsYX5osBGZyaRNZAc=; b=VSjuGGSu3fzsSZaelECwPVA7nY0L6FfgELImRBOvVn8JO5wvQzHQnb6lN6+5e+H7Gr XQcV5fBO/exMVdbHMkrSlDKUUpvTt467TcT7v8aMtc7GL6qpMQfCIXA1BVE/vxnXKiNI b9RjcSBmHwuOMASosPfRDsYhmMzkxd8xEeh68L8fQehSLAcjPKuGDmaUXoVfQoSgNxnr GL4eKEY8Oi/AWNIM8nrgymuOVKCEsYZc1A4ia+lU+DmrXQy/j8koL3mu/gyk3Wr+JkrG S5BRfGAvg/n+NWQ+z7NrRJPu4sK2qEur1cvwFzFTX7VG7ZJZKXbrRpXwcmUHJ3VQZQ8P 7bAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716106690; x=1716711490; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GBQXsZU35VYhqiFUuzQSMRWlgIZsYX5osBGZyaRNZAc=; b=JAVcZy1GWDE8+X3pUysynNVzEecS1zFeas8TC2UC+fnBUS1/WL/jj5OkOEXWGzuQPo YL5QgbZb1OqihUFYf630IZiiLPpPQ4iStxaV6O2Z5jk1/DcfMfllZhti3HslGXP85jRm NEJXekOJ62zlXH4XDq+nDpjnd3owATAK1nUEdAxLd9h6iT5Xu10Z+dkjL0QeJxCET82J RxROuLyCLnoRw9TDQtlJg4J5b2wTdG+Pi6VWSOQf6fc888XCZHu7uNcw0Ltg+fqWMSYk 2bnfhCF1NpBpYaUFtX3DSOTbBoUrxYBlI9y8LqfGChYSQwFIDHGJCxkm/qtRYZ46BKCA Wivg== X-Forwarded-Encrypted: i=1; AJvYcCXg9w2KMAC9IwUrFKeHqwY43qJ5x4gcM/s4CgqyKCczLvS+rGmrHjd2rzkVgk8fvzBWuQXjngkv/5nmY5sauHNs98cEsIwEFoRBypo89ussOXtw0Rs= X-Gm-Message-State: AOJu0YxfQSy0zxFQ9+hoLkfAAZ693hy3XMadDRnGuEmyh7QjfLvM20m7 6uvwjaTqIZd6fjDZxKsFHTGbuNFk1GkVTG8MmflkKZL92Ui3NJx7 X-Google-Smtp-Source: AGHT+IEilfnVxtejbu/ht9RsEU/PAmph0nDxRzwauS2k1nuOc2xrr0wwjEZekDl9AfdgWnlGYcB5Eg== X-Received: by 2002:a05:6512:b15:b0:51a:ca75:9ffe with SMTP id 2adb3069b0e04-5221057b50bmr23433137e87.42.1716106689783; Sun, 19 May 2024 01:18:09 -0700 (PDT) Received: from hex.my.domain (83.8.125.62.ipv4.supernova.orange.pl. [83.8.125.62]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5733c34e5ccsm13698518a12.95.2024.05.19.01.18.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 May 2024 01:18:09 -0700 (PDT) From: Artur Weber Date: Sun, 19 May 2024 10:17:47 +0200 Subject: [PATCH v3 1/8] ASoC: dt-bindings: samsung,midas-audio: Add headset mic bias supply MIME-Version: 1.0 Message-Id: <20240519-midas-wm1811-gpio-jack-v3-1-0c1736144c0e@gmail.com> References: <20240519-midas-wm1811-gpio-jack-v3-0-0c1736144c0e@gmail.com> In-Reply-To: <20240519-midas-wm1811-gpio-jack-v3-0-0c1736144c0e@gmail.com> To: Sylwester Nawrocki , Krzysztof Kozlowski Cc: Liam Girdwood , Mark Brown , Rob Herring , Conor Dooley , Jaroslav Kysela , Takashi Iwai , Alim Akhtar , alsa-devel@alsa-project.org, linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Artur Weber X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1716106686; l=1024; i=aweber.kernel@gmail.com; s=20231030; h=from:subject:message-id; bh=oxZAMqMqlKlTjZ/d/nZ7mM8CRcGM1aALJhSvZTlSCIE=; b=BhIKKL+8RIOGcP4bUlY911QYk1W9Fy3JXaNFWUp3TXITqmXYjEBxWsyPihAzfzCdyP0qEcTeV ow6N+zBCrMNAp4ThqQJrxiywHiLgDSQJXmY+JaRKZwzCc+BvJiEYIum X-Developer-Key: i=aweber.kernel@gmail.com; a=ed25519; pk=RhDBfWbJEHqDibXbhNEBAnc9FMkyznGxX/hwfhL8bv8= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240519_011818_554455_5BAF27EB X-CRM114-Status: GOOD ( 10.91 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Some devices use a separate mic bias supply (also referred to as "ear mic bias") to enable/disable the headset mic. Add the DT property headset-mic-bias-supply to allow for specifying this supply. Signed-off-by: Artur Weber --- Documentation/devicetree/bindings/sound/samsung,midas-audio.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/samsung,midas-audio.yaml b/Documentation/devicetree/bindings/sound/samsung,midas-audio.yaml index 6ec80f529d84..6ed53dd0bb53 100644 --- a/Documentation/devicetree/bindings/sound/samsung,midas-audio.yaml +++ b/Documentation/devicetree/bindings/sound/samsung,midas-audio.yaml @@ -53,6 +53,9 @@ properties: submic-bias-supply: description: Supply for the micbias on the Sub microphone + headset-mic-bias-supply: + description: Supply for the micbias on the Headset microphone + fm-sel-gpios: maxItems: 1 description: GPIO pin for FM selection From patchwork Sun May 19 08:17:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artur Weber X-Patchwork-Id: 13667814 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C0990C25B77 for ; Sun, 19 May 2024 08:18:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=eFa5Ost1LEphrwu/NBjEjqz4x6PcAN455bR91sn3xFI=; b=Mczh8IS/RX7Qbd Tzn2Bqke37XHlTxq//++eZ+m1BCdDy09mWxVaCkq5nQvUvd0r/0MXjsuLh3NEYRYTMNCEIxm2JlEn 088RJH+A7lqJCvwRJxfI2/v6lEqn0er6fDp3j6LTMa+fizYmyumqhc1y2MzDtNkoX0ML3e/laqLSo w04/Yak+yQByGpsaHxELGMkdmT4kWWDz2enLZP+vMyQDOdOmu7JI1uSGviTlBPDLD2a8rA5wuQyA8 vOSoj1xQVjnxIRNcRVV2YAYNjC1V6CkXpWtIluKsTd/AOHymIOmavDsb6sGJBEKd2LY+X5ecBcbnZ t1igd9+QJCUQMu5dmQlw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s8bkM-0000000BcvP-0wGW; Sun, 19 May 2024 08:18:22 +0000 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s8bkI-0000000Bcrg-1pGv for linux-arm-kernel@lists.infradead.org; Sun, 19 May 2024 08:18:19 +0000 Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-56e1baf0380so6291514a12.3 for ; Sun, 19 May 2024 01:18:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716106691; x=1716711491; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=R9dPohp8pfuUkAslj/44LQMkiwtv+DsL3rPN9tPKGHw=; b=WPn0NYXdsbQgCowq3w6nQV+SgAHT8lnYjKSOnyhwX9TK72Is/KqqWm3kj0N/CsKLo7 EWX7DzASGFQ16J+pLCX7MOvN9SB6ZD4GQIALU1sZGU8BwVs2HU4RpXYCDG9qlSWEOioU 6mctES09BS38CfZ13QFLoZfpjshClxKGQLMGqXG0fXKN547l3ST3YUKvMQ7UHnaIt8lU Vs3lkUi0/XPmQeHs+FAzSY1oCtBdTEBA7pw+fup8ZbRrvolbuukETCR8sYwiXrkYmhNl IMVDFnLHEGAVFRJJyrRmA7fYljbrCN02XsxwpLZZe7LcZV7Vz1feLbIR8yUGyEI0Z/8u 7/GA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716106691; x=1716711491; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=R9dPohp8pfuUkAslj/44LQMkiwtv+DsL3rPN9tPKGHw=; b=odpigpsCBJP/tftstF+h6JwUsLrE180RHD9LBYmWLgRxPbrYkbngmx5ua7Gc8Edlgs CXdIHXvohY1vVJceLeOX9Hbzcsu+EKrxy/HhWO30s+cIxMQ/QTu2PGs8q/3GZ0QBgjfM pabHyMM11FID2HjHV38+M64fCjaBV4TFy/EJzlC8nSIGXmwxZ3EI+1aiaoG1oOVo+CMI QjMZBW69zxI/NkW8U2SfZRaOmW59czLVJy9z2IGVlTtnh9ccvlVWX0//bs+uIoUAjxhc Cjak964Ixmx7zR56R/sx/tU+Gdyvsq0rBXBA3zvmAKPhOk5vim9BwJT3uoXivabm0ThT 6w3g== X-Forwarded-Encrypted: i=1; AJvYcCUfDZmJAOoMuoe65crcDAtvo7qusUdanUcIBU7r0ofchyc6TxUkGsx+YO67ZdeXb3zuVI792vyGtb4o8DtCJInNsh4Ea2hfKumn04oTuR+jUhh498Y= X-Gm-Message-State: AOJu0YxKSaS6g3M04jSMUOdZ0oN4TwlNO/ge5wYQHF3iGmetr8CM9rMF lbTLaxeTSOzS37ycPtsnjaU4Z/qI+9ik3IykYXrDwwnxEB2Z/jBT X-Google-Smtp-Source: AGHT+IFSJPpCsXD8nlzNZtTtwVuOywlJ3kEeHAEQNsTVgsVqCTp5lAG6+vAvM/y1zxZstH6QWCi7tQ== X-Received: by 2002:a50:9519:0:b0:575:d74:338c with SMTP id 4fb4d7f45d1cf-5750d7433dbmr5644244a12.10.1716106691185; Sun, 19 May 2024 01:18:11 -0700 (PDT) Received: from hex.my.domain (83.8.125.62.ipv4.supernova.orange.pl. [83.8.125.62]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5733c34e5ccsm13698518a12.95.2024.05.19.01.18.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 May 2024 01:18:10 -0700 (PDT) From: Artur Weber Date: Sun, 19 May 2024 10:17:48 +0200 Subject: [PATCH v3 2/8] ASoC: dt-bindings: samsung,midas-audio: Add GPIO-based headset jack detection MIME-Version: 1.0 Message-Id: <20240519-midas-wm1811-gpio-jack-v3-2-0c1736144c0e@gmail.com> References: <20240519-midas-wm1811-gpio-jack-v3-0-0c1736144c0e@gmail.com> In-Reply-To: <20240519-midas-wm1811-gpio-jack-v3-0-0c1736144c0e@gmail.com> To: Sylwester Nawrocki , Krzysztof Kozlowski Cc: Liam Girdwood , Mark Brown , Rob Herring , Conor Dooley , Jaroslav Kysela , Takashi Iwai , Alim Akhtar , alsa-devel@alsa-project.org, linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Artur Weber X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1716106686; l=2328; i=aweber.kernel@gmail.com; s=20231030; h=from:subject:message-id; bh=EZXePcBvXKiwP3EXDEHqCyB/Gu0AEIhLbrUV4Fe+KI4=; b=y0s6y128OFbER9wO691Pl1y+dbxejiJKN2KyMeWLB/2Zj0rDj0uqrU/vqrYEf3sfku35wMvuJ 4n07G9uGfoZC4uco+vrUBL0eL2AF5KeXYuDpzrN+9MsyZOiAHxEX8eh X-Developer-Key: i=aweber.kernel@gmail.com; a=ed25519; pk=RhDBfWbJEHqDibXbhNEBAnc9FMkyznGxX/hwfhL8bv8= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240519_011818_535857_19FD88FC X-CRM114-Status: GOOD ( 13.09 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Some Samsung devices that share the midas-audio driver use a GPIO-based approach to headset jack detection, as opposed to using the built-in jack detection provided by the wm8994 driver. This setup uses two GPIOs (one for jack detection and another for key detection) and an ADC channel for determining the jack type or button pressed. Add DT configuration values that allow for describing these setups. Signed-off-by: Artur Weber --- Changes in v3: - Re-added pipe (|) to description of samsung,headset-button-threshold- microvolt to prevent syntax error (otherwise the "in order: ..." part is interpreted as a list) Changes in v2: - Added vendor prefix to threshold properties - Dropped pipe (|) character from description: field --- .../bindings/sound/samsung,midas-audio.yaml | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/samsung,midas-audio.yaml b/Documentation/devicetree/bindings/sound/samsung,midas-audio.yaml index 6ed53dd0bb53..69ddfd4afdcd 100644 --- a/Documentation/devicetree/bindings/sound/samsung,midas-audio.yaml +++ b/Documentation/devicetree/bindings/sound/samsung,midas-audio.yaml @@ -64,6 +64,36 @@ properties: maxItems: 1 description: GPIO pin for line out selection + headset-detect-gpios: + maxItems: 1 + description: GPIO for detection of headset insertion + + headset-key-gpios: + maxItems: 1 + description: GPIO for detection of headset key press + + io-channels: + maxItems: 1 + description: IO channel to read micbias voltage for headset detection + + io-channel-names: + const: headset-detect + + samsung,headset-4pole-threshold-microvolt: + minItems: 2 + maxItems: 2 + description: + Array containing minimum and maximum IO channel value for 4-pole + (with microphone/button) headsets. If the IO channel value is + outside of this range, a 3-pole headset is assumed. + + samsung,headset-button-threshold-microvolt: + minItems: 3 + maxItems: 3 + description: | + Array of minimum (inclusive) IO channel values for headset button + detection, in order: "Media", "Volume Up" and "Volume Down". + required: - compatible - cpu From patchwork Sun May 19 08:17:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artur Weber X-Patchwork-Id: 13667818 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F1622C41513 for ; Sun, 19 May 2024 08:18:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=B0lMdIH2xu2dxxf7VBpS1/0SzHDX78A+d901ecGOnrc=; b=qw2sVMHl8dXDrU 730dfbqvfZFW3OoIvImLt4GrRy0Mg7tSaKywZAple33m/wctcTfdLiBKf5YpEJJ1fdqp1bDj5Z3A6 eo1K22Pd83MLI+YL3X9/q3G11uPKcg+Rf4yx4GjUfaTFeSuvsP7Xig9QRfb3LFgxhUD+MBZGFJpaK rlJU8ec03cUbNClD8HFA/0NHQQzl3EdoEa/DHaEenAZWCeM7WDYjVkzr0u/5VSIl4rKOXmkdyzsoe 9wLKwSKOJfO5Phoa2ROiLEPjZ3ROSIxFFbsPS7az1v1YLBL7izCAtVXbn2gtX60FX82os1r9qiBz7 mebFLNx2/j96B1Sjt0gw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s8bkX-0000000Bd0s-1GXK; Sun, 19 May 2024 08:18:33 +0000 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s8bkI-0000000Bcru-1pLc for linux-arm-kernel@lists.infradead.org; Sun, 19 May 2024 08:18:20 +0000 Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-573061776e8so6419891a12.1 for ; Sun, 19 May 2024 01:18:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716106692; x=1716711492; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=EUmoS//RS/NzAGvmwPir69ysTLwZDq4qcPlEK/AGs3g=; b=aKoDIlyLAbkQpIyoH5Kys/bnucdfG0o16bykPJqfdaGP+gUoD+E1Cge549OB0Dz31f U6M4k78sYIB5mhapmwmJ9oOtabOef0d6u4otRWroB0czOBLlwilXx3spOQMNujeECV7f Tq3nSyeqlBe7WwAdxTljSwnelNHPErwU2aOJarqFPLDx4HQQMVfJ+VMVT7u6t4ImyB6C I59Hhq50RETx6GxL0QLp3QWfl4pZpWNruTmf4y4XR7r6f23Z9r7yTEkqw0SDA1bILoRJ l3xkJI3RtT+hThWynUrk7hpEQ90rh9fM/G8X4SBVz2cd0q37EiTr2I5FPZ5Rf3z5QP2r dpJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716106692; x=1716711492; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EUmoS//RS/NzAGvmwPir69ysTLwZDq4qcPlEK/AGs3g=; b=ANM8S64Z7DkvKXZqz4Lf+GNmCNQjTK2MOt2K18G22JFnLk0aE1YVwwcgfkex3R/p+g RX93ZM5fQftCQgS0Eejtxw1YvrhlvvYZequH3KaKRmwiq7PeZyvm03VP9BDqAS+ewJTh a5f71/Gdm82yuTqEISxrgOuL57CKk2H6OJYyvP3kA3/dGO0EMr/9+OcbzPFvmALSI3zQ vEh/QQS36KJgTOOgjN3tNlLoDBKW6wQ++VAXLmMlruyVagRXT7P2q7+2Ik+pWOsvwBTI 2QFiALxttOR4/nysRxrsTI+rOvUyW8VXaN5/8NmYvRUjgfBrSAcRyLdR0cB1KC/igPEZ PNeA== X-Forwarded-Encrypted: i=1; AJvYcCVPZ8moKXPGDq7w7EkZTVibg+5GNn+et4+fKeIRmbpUjxJbe46ity2OKNrjfSy4gezeHE00Sl3S2ujvGTY7wwLEPXI8yIVSi2XFLfeYNKZB9pLar9U= X-Gm-Message-State: AOJu0YynnWzOusH45XgF3eJ2cXgaobWSfK5ltDmoh2qezo7owZyjjpu9 SsdMVMU63qDf8MVO3nqgum1Sn+rq0608fs576n1/e8u4XIPPrjDi X-Google-Smtp-Source: AGHT+IFtA0Va8QiICPbaNatA5PVquOStRUtv//wy7zLyNNpUAzWXvwJve0s999PpRDl1QmQ8sDDadQ== X-Received: by 2002:a50:8a84:0:b0:572:7280:89d6 with SMTP id 4fb4d7f45d1cf-5734d597a25mr18601319a12.7.1716106692558; Sun, 19 May 2024 01:18:12 -0700 (PDT) Received: from hex.my.domain (83.8.125.62.ipv4.supernova.orange.pl. [83.8.125.62]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5733c34e5ccsm13698518a12.95.2024.05.19.01.18.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 May 2024 01:18:12 -0700 (PDT) From: Artur Weber Date: Sun, 19 May 2024 10:17:49 +0200 Subject: [PATCH v3 3/8] ASoC: samsung: midas_wm1811: Add headset mic bias supply support MIME-Version: 1.0 Message-Id: <20240519-midas-wm1811-gpio-jack-v3-3-0c1736144c0e@gmail.com> References: <20240519-midas-wm1811-gpio-jack-v3-0-0c1736144c0e@gmail.com> In-Reply-To: <20240519-midas-wm1811-gpio-jack-v3-0-0c1736144c0e@gmail.com> To: Sylwester Nawrocki , Krzysztof Kozlowski Cc: Liam Girdwood , Mark Brown , Rob Herring , Conor Dooley , Jaroslav Kysela , Takashi Iwai , Alim Akhtar , alsa-devel@alsa-project.org, linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Artur Weber X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1716106686; l=2705; i=aweber.kernel@gmail.com; s=20231030; h=from:subject:message-id; bh=vuYNtCSoGcmTk8GfhvJhaoNcv6Dz56BFdGIefFxXzuk=; b=Oph8hMfgjPv7+ASAJ6X81w2AItr7S+gGYQiA9lMJgDun4mT3Z8oy8+F7ihMMEw8x/x9MM0sTS JswKrd6RYJNAbRYAXVEkhrsO34yH4MtOXVYi+wgzHZq41rRJmRkYJWp X-Developer-Key: i=aweber.kernel@gmail.com; a=ed25519; pk=RhDBfWbJEHqDibXbhNEBAnc9FMkyznGxX/hwfhL8bv8= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240519_011818_557517_FD65CC33 X-CRM114-Status: GOOD ( 18.25 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Some devices use a headset mic bias supply (sometimes referred to as "ear mic bias") to enable/disable the headset mic. Add support for getting the supply from DT and setting it up accordingly to the value of the Headset Mic switch. Signed-off-by: Artur Weber --- Changes in v2: - Added this commit --- sound/soc/samsung/midas_wm1811.c | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/sound/soc/samsung/midas_wm1811.c b/sound/soc/samsung/midas_wm1811.c index f31244156ff6..ab0a4804b45e 100644 --- a/sound/soc/samsung/midas_wm1811.c +++ b/sound/soc/samsung/midas_wm1811.c @@ -29,6 +29,7 @@ struct midas_priv { struct regulator *reg_mic_bias; struct regulator *reg_submic_bias; + struct regulator *reg_headset_mic_bias; struct gpio_desc *gpio_fm_sel; struct gpio_desc *gpio_lineout_sel; unsigned int fll1_rate; @@ -201,6 +202,25 @@ static int midas_submic_bias(struct snd_soc_dapm_widget *w, return 0; } +static int midas_headset_mic_bias(struct snd_soc_dapm_widget *w, + struct snd_kcontrol *kcontrol, int event) +{ + struct snd_soc_card *card = w->dapm->card; + struct midas_priv *priv = snd_soc_card_get_drvdata(card); + + if (!priv->reg_headset_mic_bias) + return 0; + + switch (event) { + case SND_SOC_DAPM_PRE_PMU: + return regulator_enable(priv->reg_headset_mic_bias); + case SND_SOC_DAPM_POST_PMD: + return regulator_disable(priv->reg_headset_mic_bias); + } + + return 0; +} + static int midas_fm_set(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event) { @@ -271,7 +291,7 @@ static const struct snd_soc_dapm_widget midas_dapm_widgets[] = { SND_SOC_DAPM_LINE("FM In", midas_fm_set), SND_SOC_DAPM_HP("Headphone", NULL), - SND_SOC_DAPM_MIC("Headset Mic", NULL), + SND_SOC_DAPM_MIC("Headset Mic", midas_headset_mic_bias), SND_SOC_DAPM_MIC("Main Mic", midas_mic_bias), SND_SOC_DAPM_MIC("Sub Mic", midas_submic_bias), }; @@ -455,6 +475,17 @@ static int midas_probe(struct platform_device *pdev) return PTR_ERR(priv->reg_submic_bias); } + priv->reg_headset_mic_bias = devm_regulator_get_optional(dev, + "headset-mic-bias"); + if (IS_ERR(priv->reg_headset_mic_bias)) { + ret = PTR_ERR(priv->reg_headset_mic_bias); + if (ret == -ENODEV) + priv->reg_headset_mic_bias = NULL; + else + return dev_err_probe(dev, ret, + "Failed to get headset mic bias regulator\n"); + } + priv->gpio_fm_sel = devm_gpiod_get_optional(dev, "fm-sel", GPIOD_OUT_HIGH); if (IS_ERR(priv->gpio_fm_sel)) { dev_err(dev, "Failed to get FM selection GPIO\n"); From patchwork Sun May 19 08:17:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Artur Weber X-Patchwork-Id: 13667816 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 859BEC25B75 for ; Sun, 19 May 2024 08:18:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=XiYmFZnIp8fbOo29fT1YzgCO8Hw3aWLe18c80Uj0JeY=; b=TuwBw6RdGtg+z4 kYuDo2AoBN5Bna5+gS2qJhOztrQuNV16O3bXme19YNHp4AhvVR4b9Csnc/VUZIJSAfH4HXsUHmaqg F5vCuvBhKxk4ATN5Tl0PUREbx6fIkGiyK6PoWjEIX4DDT526/fCbjrS+0be9nqp2fFC2no+ITffTK xLOZsT+WORuLIHom7JK1oSntmo2z6C1OCBQ9Jiur4CtZ1k7L/W94NbibWvXOx8u8gDtXRqEVZsLi0 FeVBjcdcmYiNDxfuRMMAGe4tLoZCeNTIeuna6ZkPi19rYr9OtDF7hmHVz47mjwreHzndSmpvVyzj6 sPLq/EHFXFMKfMwOodAg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s8bkY-0000000Bd1W-0xwL; Sun, 19 May 2024 08:18:34 +0000 Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s8bkI-0000000Bcrw-1plr for linux-arm-kernel@lists.infradead.org; Sun, 19 May 2024 08:18:20 +0000 Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-572f6ee87c1so5997471a12.2 for ; Sun, 19 May 2024 01:18:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716106694; x=1716711494; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=poVyIDrS2b/ZXWDdTK9RH0R8g9cefahYbIBUWzC1UWE=; b=DFLEJ7F8YAVK0KR/fW63y64sJT455qIPuvh6PS524cdu0asqdmA3kv1lUp1TW7ttpc 0ynqdgmWJKDRqU98n9Uhmsul23/acgxLsiJEFC3jVMDpC00LexjRD1VJOpxgbQN7SEiW HkLc8P/wGNRn2iyfiXic9LyM07VE9BX/8Y+b20k/eKbmqqs8d+HtfqeVPkp9P40N4zPa DvzJ66buTur/OJZC3VeUiAHMfkpjCGR4ZxatuEmTChLV929LjsbL6em6TKfE/PB8EI5B VRRfi1xiMtianwE+QEB0RIX5YjyLlMPU+mOr1N0WlcT5OuS4T5JXATlX3+zZmfgqXLUe BAeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716106694; x=1716711494; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=poVyIDrS2b/ZXWDdTK9RH0R8g9cefahYbIBUWzC1UWE=; b=TOxOjWn/pQ0tDuj7spNLHAtuecuWiPsuRUvjATI3dFJrOxYlH9KQ7q4Ufoy28D8pIO KhVXZ15CEsxS83aJDWLItjyA0NHLG1JTxffkg5pd52E5pSIJRNMzrHBtJTd099u7gxvv ImICh6qLKeM51bXRN6oiJhg5ea3fOZn+ts7b9iP1wUJpt70UtMMrtHqffzBQmeRweLoh c7iRy8cIxucYNLiNzbVAdRILbStVCK9lxuxt6//zDHYkxdapfFZkiqNbWhJwq7K5vgbo 5jHbHbTz8S1EClHGrbOkygq96J8FuEcaSO/rM6DGRaENnNBdn4e37lNVAuqJEiUZrqtE 2QXQ== X-Forwarded-Encrypted: i=1; AJvYcCVjPyqPQTZo5ZoDANeduudMWKG88GpKjza6HViYEmH2M5n/0OFHT8DDp5kB1rHyYeLE7PtTX0G6KCIGCn3V+PVh3TGrsChGvdAIGga2ZQOEwsTOMlw= X-Gm-Message-State: AOJu0YyEqi3Xl+HQx/SBFm5gP5vVq928N1t7Dn0Mpr2HKSrA6pHevHFB 81hHSZmVMEqszV9EObDIuFM6BQiY6FdyOlBu61aijxXPZyl3XxLt X-Google-Smtp-Source: AGHT+IGQa8zVgMIpXHn5fL36pQriqk81CxAIOwu4Q/GOcm6if0MbIKvWzuXoQIkeTLfj7lgw3wlfQA== X-Received: by 2002:a50:d7cf:0:b0:572:4041:5637 with SMTP id 4fb4d7f45d1cf-5764d216677mr1442834a12.19.1716106694018; Sun, 19 May 2024 01:18:14 -0700 (PDT) Received: from hex.my.domain (83.8.125.62.ipv4.supernova.orange.pl. [83.8.125.62]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5733c34e5ccsm13698518a12.95.2024.05.19.01.18.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 May 2024 01:18:13 -0700 (PDT) From: Artur Weber Date: Sun, 19 May 2024 10:17:50 +0200 Subject: [PATCH v3 4/8] ASoC: samsung: midas_wm1811: Add GPIO-based headset jack detection MIME-Version: 1.0 Message-Id: <20240519-midas-wm1811-gpio-jack-v3-4-0c1736144c0e@gmail.com> References: <20240519-midas-wm1811-gpio-jack-v3-0-0c1736144c0e@gmail.com> In-Reply-To: <20240519-midas-wm1811-gpio-jack-v3-0-0c1736144c0e@gmail.com> To: Sylwester Nawrocki , Krzysztof Kozlowski Cc: Liam Girdwood , Mark Brown , Rob Herring , Conor Dooley , Jaroslav Kysela , Takashi Iwai , Alim Akhtar , alsa-devel@alsa-project.org, linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Artur Weber X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1716106686; l=12054; i=aweber.kernel@gmail.com; s=20231030; h=from:subject:message-id; bh=tvVeHRzJ1CkifWQbFGlvF0EVZIoz7vxKkkPUGFuk7jM=; b=8flwnlB7SYsRO5RtN1w9LStOJfL32UqWv3Gbo2yMVLTM8PnfFqsqFsLlT6as/IJSTfZb5qvVT 7NTh9Ah/erDBordCCHtqCMN3CuXMByB6mTOmnVRZfrumGR3kcDwZSvL X-Developer-Key: i=aweber.kernel@gmail.com; a=ed25519; pk=RhDBfWbJEHqDibXbhNEBAnc9FMkyznGxX/hwfhL8bv8= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240519_011818_526212_A54B415A X-CRM114-Status: GOOD ( 34.95 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Some Samsung devices that use the midas_wm1811 driver use a GPIO-based method for detecting whether the headset jack is plugged in, as well as detecting which headset buttons are pressed. There are two GPIOs: a "headset detect" GPIO responsible for detecting jack insertion, and a "headset key" GPIO which triggers when a button on the headset is pressed. The plug type and the button pressed are determined based on information from an ADC channel. The headset mic is enabled by a headset mic bias regulator. Add support for the GPIO-based headset jack detection mechanism, and make it configurable from the device tree. This implementation borrows somewhat from the aries_wm8994.c driver, though there are a few changes to make the code cleaner, and to add support for DT-based configuration. Notably, a dependency on IIO is introduced, to accommodate the ADC reading requirement. Signed-off-by: Artur Weber --- Changes in v2: - Added separate headset mic bias regulator - Added samsung preset to threshold properties - Replaced dev_err+return with return dev_err_probe where needed --- sound/soc/samsung/Kconfig | 2 +- sound/soc/samsung/midas_wm1811.c | 286 +++++++++++++++++++++++++++++++++++++-- 2 files changed, 277 insertions(+), 11 deletions(-) diff --git a/sound/soc/samsung/Kconfig b/sound/soc/samsung/Kconfig index 93c2b1b08d0a..4b1ea7b2c796 100644 --- a/sound/soc/samsung/Kconfig +++ b/sound/soc/samsung/Kconfig @@ -140,7 +140,7 @@ config SND_SOC_SAMSUNG_ARIES_WM8994 config SND_SOC_SAMSUNG_MIDAS_WM1811 tristate "SoC I2S Audio support for Midas boards" - depends on SND_SOC_SAMSUNG + depends on SND_SOC_SAMSUNG && IIO select SND_SAMSUNG_I2S select SND_SOC_WM8994 help diff --git a/sound/soc/samsung/midas_wm1811.c b/sound/soc/samsung/midas_wm1811.c index ab0a4804b45e..ce94550ee32e 100644 --- a/sound/soc/samsung/midas_wm1811.c +++ b/sound/soc/samsung/midas_wm1811.c @@ -7,7 +7,9 @@ #include #include +#include #include +#include #include #include #include @@ -32,6 +34,9 @@ struct midas_priv { struct regulator *reg_headset_mic_bias; struct gpio_desc *gpio_fm_sel; struct gpio_desc *gpio_lineout_sel; + struct gpio_desc *gpio_headset_detect; + struct gpio_desc *gpio_headset_key; + struct iio_channel *adc_headset_detect; unsigned int fll1_rate; struct snd_soc_jack headset_jack; @@ -48,6 +53,131 @@ static struct snd_soc_jack_pin headset_jack_pins[] = { }, }; +/* + * min_mv/max_mv values in this struct are set up based on DT values. + */ +static struct snd_soc_jack_zone headset_jack_zones[] = { + { .jack_type = SND_JACK_HEADPHONE, }, + { .jack_type = SND_JACK_HEADSET, }, + { .jack_type = SND_JACK_HEADPHONE, }, +}; + +/* + * This is used for manual detection in headset_key_check, we reuse the + * structure since it's convenient. + * + * min_mv/max_mv values in this struct are set up based on DT values. + */ +static struct snd_soc_jack_zone headset_key_zones[] = { + { .jack_type = SND_JACK_BTN_0, }, /* Media */ + { .jack_type = SND_JACK_BTN_1, }, /* Volume Up */ + { .jack_type = SND_JACK_BTN_2, }, /* Volume Down */ +}; + +static int headset_jack_check(void *data) +{ + struct midas_priv *priv = (struct midas_priv *) data; + int adc, jack_type, ret; + int bias_already_on = 0; + + if (!gpiod_get_value_cansleep(priv->gpio_headset_detect)) + return 0; + + if (priv->reg_headset_mic_bias) { + /* + * Get state of Headset Mic switch by checking the headset mic + * bias regulator + */ + bias_already_on = \ + regulator_is_enabled(priv->reg_headset_mic_bias); + + /* + * If it's not enabled yet, temporarily enable headset mic bias + * for ADC measurement + */ + if (bias_already_on < 0) + pr_err("%s: Failed to get headset mic bias state: %d", + __func__, ret); + else if (!bias_already_on) { + ret = regulator_enable(priv->reg_headset_mic_bias); + if (ret) + pr_err("%s: Failed to enable micbias: %d\n", + __func__, ret); + } + } + + /* Sleep for a small amount of time to get the value to stabilize */ + msleep(20); + + ret = iio_read_channel_processed(priv->adc_headset_detect, &adc); + if (ret) { + pr_err("%s: Failed to read ADC (%d), assuming headphones\n", + __func__, ret); + return SND_JACK_HEADPHONE; + } + pr_debug("%s: ADC value is %d\n", __func__, adc); + + jack_type = snd_soc_jack_get_type(&priv->headset_jack, adc); + + /* + * Revert the headset mic bias supply to its previous state + * (i.e. if it was disabled before the check, disable it again) + */ + if (priv->reg_headset_mic_bias && bias_already_on == 0) { + ret = regulator_disable(priv->reg_headset_mic_bias); + if (ret) + pr_err("%s: Failed to disable micbias: %d\n", + __func__, ret); + } + + return jack_type; +} + +static int headset_key_check(void *data) +{ + struct midas_priv *priv = (struct midas_priv *) data; + int adc, i, ret; + + if (!gpiod_get_value_cansleep(priv->gpio_headset_key)) + return 0; + + /* Filter out keypresses when 4 pole jack not detected */ + if (!(priv->headset_jack.status & SND_JACK_MICROPHONE)) + return 0; + + ret = iio_read_channel_processed(priv->adc_headset_detect, &adc); + if (ret) { + pr_err("%s: Failed to read ADC (%d), can't detect key type\n", + __func__, ret); + return 0; + } + pr_debug("%s: ADC value is %d\n", __func__, adc); + + for (i = 0; i < ARRAY_SIZE(headset_key_zones); i++) { + if (adc >= headset_key_zones[i].min_mv && + adc <= headset_key_zones[i].max_mv) { + return headset_key_zones[i].jack_type; + } + } + + return 0; +} + +static struct snd_soc_jack_gpio headset_gpio[] = { + { + .name = "Headset Jack", + .report = SND_JACK_HEADSET, + .debounce_time = 150, + .jack_status_check = headset_jack_check, + }, + { + .name = "Headset Key", + .report = SND_JACK_BTN_0 | SND_JACK_BTN_1 | SND_JACK_BTN_2, + .debounce_time = 30, + .jack_status_check = headset_key_check, + }, +}; + static int midas_start_fll1(struct snd_soc_pcm_runtime *rtd, unsigned int rate) { struct snd_soc_card *card = rtd->card; @@ -335,18 +465,67 @@ static int midas_late_probe(struct snd_soc_card *card) return ret; } - ret = snd_soc_card_jack_new_pins(card, "Headset", - SND_JACK_HEADSET | SND_JACK_MECHANICAL | - SND_JACK_BTN_0 | SND_JACK_BTN_1 | SND_JACK_BTN_2 | - SND_JACK_BTN_3 | SND_JACK_BTN_4 | SND_JACK_BTN_5, - &priv->headset_jack, - headset_jack_pins, - ARRAY_SIZE(headset_jack_pins)); - if (ret) + if (!priv->gpio_headset_detect) { + ret = snd_soc_card_jack_new_pins(card, "Headset", + SND_JACK_HEADSET | SND_JACK_MECHANICAL | + SND_JACK_BTN_0 | SND_JACK_BTN_1 | + SND_JACK_BTN_2 | SND_JACK_BTN_3 | + SND_JACK_BTN_4 | SND_JACK_BTN_5, + &priv->headset_jack, + headset_jack_pins, + ARRAY_SIZE(headset_jack_pins)); + if (ret) + return ret; + + wm8958_mic_detect(aif1_dai->component, &priv->headset_jack, + NULL, NULL, NULL, NULL); + } else { + /* Some devices (n8000, t310) use a GPIO to detect the jack. */ + ret = snd_soc_card_jack_new_pins(card, "Headset", + SND_JACK_HEADSET | SND_JACK_BTN_0 | + SND_JACK_BTN_1 | SND_JACK_BTN_2, + &priv->headset_jack, + headset_jack_pins, + ARRAY_SIZE(headset_jack_pins)); + if (ret) { + dev_err(card->dev, + "Failed to set up headset pins: %d\n", ret); + return ret; + } + + ret = snd_soc_jack_add_zones(&priv->headset_jack, + ARRAY_SIZE(headset_jack_zones), + headset_jack_zones); + if (ret) { + dev_err(card->dev, + "Failed to set up headset zones: %d\n", ret); + return ret; + } + + headset_gpio[0].data = priv; + headset_gpio[0].desc = priv->gpio_headset_detect; + + headset_gpio[1].data = priv; + headset_gpio[1].desc = priv->gpio_headset_key; + + snd_jack_set_key(priv->headset_jack.jack, + SND_JACK_BTN_0, KEY_MEDIA); + snd_jack_set_key(priv->headset_jack.jack, + SND_JACK_BTN_1, KEY_VOLUMEUP); + snd_jack_set_key(priv->headset_jack.jack, + SND_JACK_BTN_2, KEY_VOLUMEDOWN); + + ret = snd_soc_jack_add_gpios(&priv->headset_jack, + ARRAY_SIZE(headset_gpio), + headset_gpio); + if (ret) + dev_err(card->dev, + "Failed to set up headset jack GPIOs: %d\n", + ret); + return ret; + } - wm8958_mic_detect(aif1_dai->component, &priv->headset_jack, - NULL, NULL, NULL, NULL); return 0; } @@ -453,6 +632,9 @@ static int midas_probe(struct platform_device *pdev) struct snd_soc_card *card = &midas_card; struct device *dev = &pdev->dev; static struct snd_soc_dai_link *dai_link; + enum iio_chan_type channel_type; + u32 fourpole_threshold[2]; + u32 button_threshold[3]; struct midas_priv *priv; int ret, i; @@ -499,6 +681,90 @@ static int midas_probe(struct platform_device *pdev) return PTR_ERR(priv->gpio_lineout_sel); } + priv->gpio_headset_detect = devm_gpiod_get_optional(dev, + "headset-detect", GPIOD_IN); + if (IS_ERR(priv->gpio_headset_detect)) + return dev_err_probe(dev, PTR_ERR(priv->gpio_headset_detect), + "Failed to get headset jack detect GPIO\n"); + + if (priv->gpio_headset_detect) { + priv->adc_headset_detect = devm_iio_channel_get(dev, + "headset-detect"); + if (IS_ERR(priv->adc_headset_detect)) + return dev_err_probe(dev, + PTR_ERR(priv->adc_headset_detect), + "Failed to get ADC channel\n"); + + ret = iio_get_channel_type(priv->adc_headset_detect, + &channel_type); + if (ret) { + dev_err(dev, "Failed to get ADC channel type\n"); + return ret; + } + + if (channel_type != IIO_VOLTAGE) { + dev_err(dev, "ADC channel is not voltage\n"); + return ret; + } + + priv->gpio_headset_key = devm_gpiod_get(dev, "headset-key", + GPIOD_IN); + if (IS_ERR(priv->gpio_headset_key)) + return dev_err_probe(dev, + PTR_ERR(priv->gpio_headset_key), + "Failed to get headset key GPIO\n"); + + ret = of_property_read_u32_array(dev->of_node, + "samsung,headset-4pole-threshold-microvolt", + fourpole_threshold, + ARRAY_SIZE(fourpole_threshold)); + if (ret) { + dev_err(dev, "Failed to get 4-pole jack detection threshold\n"); + return ret; + } + + if (fourpole_threshold[0] > fourpole_threshold[1]) { + dev_err(dev, "Invalid 4-pole jack detection threshold value\n"); + return -EINVAL; + } + + headset_jack_zones[0].max_mv = (fourpole_threshold[0]); + headset_jack_zones[1].min_mv = (fourpole_threshold[0] + 1); + + headset_jack_zones[1].max_mv = (fourpole_threshold[1]); + headset_jack_zones[2].min_mv = (fourpole_threshold[1] + 1); + + ret = of_property_read_u32_array(dev->of_node, + "samsung,headset-button-threshold-microvolt", + button_threshold, + ARRAY_SIZE(button_threshold)); + if (ret) { + dev_err(dev, "Failed to get headset button detection threshold\n"); + return ret; + } + + if (button_threshold[0] > button_threshold[1] || + button_threshold[1] > button_threshold[2]) { + dev_err(dev, "Invalid headset button detection threshold value\n"); + return -EINVAL; + } + + for (i = 0; i < 3; i++) { + if (i != 0 && button_threshold[i] <= 0) { + dev_err(dev, "Invalid headset button detection threshold value\n"); + return -EINVAL; + } + + headset_key_zones[i].min_mv = button_threshold[i]; + + if (i == 2) + headset_key_zones[i].max_mv = UINT_MAX; + else + headset_key_zones[i].max_mv = \ + (button_threshold[i+1] - 1); + } + } + ret = snd_soc_of_parse_card_name(card, "model"); if (ret < 0) { dev_err(dev, "Card name is not specified\n"); From patchwork Sun May 19 08:17:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artur Weber X-Patchwork-Id: 13667817 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DA9E4C25B79 for ; Sun, 19 May 2024 08:18:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=r0Vy7rj+TEgTBsLt8Nrgmv+Mj3phSpBTtIhIQd6ejTs=; b=0YpaaI5AAiv7ar XX8UFdIRiu2i91IRMfUaOp7s4sEFWpN7cvMvVIHDX2VsYDYxgqRDecphmU/WQFftSX/4ialLyr2Hl eVKKMi095fHiCuafbgoaK8tQ7bB6BsYXrirU76KpWtsjJmGzRzM7Yw43dYxX/SNA8kZbN5f2+xklq p8tyYmTuVNkPoyhcjJcGM+wxWCxSwI0JsCFUqNHhxdStyYnbc3pA9BcwWRHmhn/HX+wp/XYBKt3/L sPDpETTHIHZGWwa7wR/aek5h0i6GXPwzSZE4QbtB5CKmBb3FiNdwDG5+BpqMG1B5YNXHHwiZbvd5l GvMzlMH0eMlyrZgYjV9A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s8bka-0000000Bd3F-1OHX; Sun, 19 May 2024 08:18:36 +0000 Received: from mail-lj1-x22b.google.com ([2a00:1450:4864:20::22b]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s8bkJ-0000000Bcs0-0rqG for linux-arm-kernel@lists.infradead.org; Sun, 19 May 2024 08:18:21 +0000 Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2e52181c228so29545831fa.0 for ; Sun, 19 May 2024 01:18:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716106695; x=1716711495; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=eh0hh6ynZxtBGDzmGDI5+hS0xKp2HfOEvcy4GZsRfWo=; b=XcDiKApgpjpiSVPM5MnGS86Sj0Jxg9VslHBXymj4FIlJ6jpdHpMUf2rZQVLIR7MiXa bfwh6c7rGn5dVfQ2QTqb/JMP75l3nDXZVfBoWG1EjqVUtm0FibzHuZF6z2R7wArAfFj3 dx6JoFMTc8/RLrSvB5Vh6lVkJxqd0sFtqoRHrKSeKSJZ+FSISs4N9gi2EK62HCj/qAcn BWh6MCz8c36vIMZ3tz9ABV4c5KcEJJu2X2rexVb5FvU4iUnvVUYqH22dP9AQK7CC8Wom WcOLFM29igEUTvobP5P0d5wGy3XFqoi6qiwRitgcl8z4Yf9RxCWNgLEpVMkmj5hpTtia SmVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716106695; x=1716711495; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eh0hh6ynZxtBGDzmGDI5+hS0xKp2HfOEvcy4GZsRfWo=; b=GQHYl0DrhmSfYrBRjdzslCtGwG7uYe/qcECR8vAveZ4mc76ZBCY04OohIH2WDzVjN4 pN/SpN1w4qMyRlBxPt0B7cOxQ3w4amur9uE+LSsRKMYEnbjjeqtnoPmvGqZHyKoyKDUb 6jKKs3mQEw4WLEdpgYGupLgVcSpTbJmPuNNXmCUXs8zTidVHBH140lzI1geb8mrHYz9b CB7LpWNL9GiAsBBm7dtHqnxRHFfYkQwZGlV/8mVvXv4tUOMIlc5bFfo9iOCMtGNIzL2N kpboDu5lGpc4z0LwfuVl6BvD01tvzH4bOPoUPhD0CKYbixarHpElZtbLdXXALbQZBOON lF5w== X-Forwarded-Encrypted: i=1; AJvYcCVdsRC96aSC33A/5+OuO2JJ9Hq9VgewrlUMeJL+HKdyP/ml0WUGWlJEesp/QV8x+LhKIaP4fR5D8V1tVxuSoLg4mkQpuKTat/4IY7omoQAzT1dbohw= X-Gm-Message-State: AOJu0YzC4Zbuu0r4eh6fxMKdUz89xoBFSLUMieV3i43lotLJvm0Zb0t6 vWUK37nrgvRUIEPociu1ZyzrQTTVOpAwJwvoj7zKfQYDLIKjvaxp X-Google-Smtp-Source: AGHT+IH1S6MZdqZnOCp1XHy0DROY6BRx/iUuxG5zGDEFD1Db54zL75jJp9OmheUmNZVBtKA5DxdCVw== X-Received: by 2002:ac2:4c4e:0:b0:523:6a08:1c91 with SMTP id 2adb3069b0e04-5236a081d53mr12374237e87.26.1716106695408; Sun, 19 May 2024 01:18:15 -0700 (PDT) Received: from hex.my.domain (83.8.125.62.ipv4.supernova.orange.pl. [83.8.125.62]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5733c34e5ccsm13698518a12.95.2024.05.19.01.18.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 May 2024 01:18:15 -0700 (PDT) From: Artur Weber Date: Sun, 19 May 2024 10:17:51 +0200 Subject: [PATCH v3 5/8] ASoC: samsung: midas_wm1811: Use dev_err_probe where appropriate MIME-Version: 1.0 Message-Id: <20240519-midas-wm1811-gpio-jack-v3-5-0c1736144c0e@gmail.com> References: <20240519-midas-wm1811-gpio-jack-v3-0-0c1736144c0e@gmail.com> In-Reply-To: <20240519-midas-wm1811-gpio-jack-v3-0-0c1736144c0e@gmail.com> To: Sylwester Nawrocki , Krzysztof Kozlowski Cc: Liam Girdwood , Mark Brown , Rob Herring , Conor Dooley , Jaroslav Kysela , Takashi Iwai , Alim Akhtar , alsa-devel@alsa-project.org, linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Artur Weber X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1716106686; l=2433; i=aweber.kernel@gmail.com; s=20231030; h=from:subject:message-id; bh=zl7AH36vmygEV4JVzP5ZRpRVT0yrltHsi0L0sBPvpeI=; b=jKKalLVKlQAPEmhIQI2igaYxc0WtyONvcwLUzap5etYn+mJu5GSY7yIvEUJ6368P+Mmy+lX56 VqeGNgA6LPfDMjvQfhUv+tlIihN+MvC3f/eFreYYxCb0L35bl6GBcXg X-Developer-Key: i=aweber.kernel@gmail.com; a=ed25519; pk=RhDBfWbJEHqDibXbhNEBAnc9FMkyznGxX/hwfhL8bv8= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240519_011819_366164_85BF99E2 X-CRM114-Status: GOOD ( 13.60 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Since we're already using it in the newly-added GPIO requests for jack detection, extend it to the previous checks as well. Signed-off-by: Artur Weber --- Changes in v2: - Added this commit --- sound/soc/samsung/midas_wm1811.c | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/sound/soc/samsung/midas_wm1811.c b/sound/soc/samsung/midas_wm1811.c index ce94550ee32e..91f4be98723c 100644 --- a/sound/soc/samsung/midas_wm1811.c +++ b/sound/soc/samsung/midas_wm1811.c @@ -646,16 +646,14 @@ static int midas_probe(struct platform_device *pdev) card->dev = dev; priv->reg_mic_bias = devm_regulator_get(dev, "mic-bias"); - if (IS_ERR(priv->reg_mic_bias)) { - dev_err(dev, "Failed to get mic bias regulator\n"); - return PTR_ERR(priv->reg_mic_bias); - } + if (IS_ERR(priv->reg_mic_bias)) + return dev_err_probe(dev, PTR_ERR(priv->reg_mic_bias), + "Failed to get mic bias regulator\n"); priv->reg_submic_bias = devm_regulator_get(dev, "submic-bias"); - if (IS_ERR(priv->reg_submic_bias)) { - dev_err(dev, "Failed to get submic bias regulator\n"); - return PTR_ERR(priv->reg_submic_bias); - } + if (IS_ERR(priv->reg_submic_bias)) + return dev_err_probe(dev, PTR_ERR(priv->reg_submic_bias), + "Failed to get submic bias regulator\n"); priv->reg_headset_mic_bias = devm_regulator_get_optional(dev, "headset-mic-bias"); @@ -669,17 +667,15 @@ static int midas_probe(struct platform_device *pdev) } priv->gpio_fm_sel = devm_gpiod_get_optional(dev, "fm-sel", GPIOD_OUT_HIGH); - if (IS_ERR(priv->gpio_fm_sel)) { - dev_err(dev, "Failed to get FM selection GPIO\n"); - return PTR_ERR(priv->gpio_fm_sel); - } + if (IS_ERR(priv->gpio_fm_sel)) + return dev_err_probe(dev, PTR_ERR(priv->gpio_fm_sel), + "Failed to get FM selection GPIO\n"); priv->gpio_lineout_sel = devm_gpiod_get_optional(dev, "lineout-sel", GPIOD_OUT_HIGH); - if (IS_ERR(priv->gpio_lineout_sel)) { - dev_err(dev, "Failed to get line out selection GPIO\n"); - return PTR_ERR(priv->gpio_lineout_sel); - } + if (IS_ERR(priv->gpio_lineout_sel)) + return dev_err_probe(dev, PTR_ERR(priv->gpio_lineout_sel), + "Failed to get line out selection GPIO\n"); priv->gpio_headset_detect = devm_gpiod_get_optional(dev, "headset-detect", GPIOD_IN); From patchwork Sun May 19 08:17:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artur Weber X-Patchwork-Id: 13667819 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1F38AC25B75 for ; Sun, 19 May 2024 08:18:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=SWY06hrm5bjbKCr6hQAB0nhBd8shTfSndJlLbFUA+sg=; b=NJ864vCT0Nj1Ib VHS9ynnTmXiOQwT7Rpr6k9h66GQ6+mqocLZrryv6QYUU0q7Sp+5RryNGR2QuqqBqN207hNE8wDL+I 9cEoGAr1OJdNG19sG8/LbrGJyZ2oUJgCzl1z7HK4bj4TTlKeybYJimdjmKij8URaNOTveClcI+DIW YzqEItSOzrLe4thxL39zp4QZdQysEpU3lOD9UyyfFb8dpP/b4t5UFW9WY5jOnyg++HiyY4nDZhUTh 8pC9lxC2B3J4bw/VhbMb6gj+RVpX9fok1kn0HNEiLaNjwQ6HqRMUd0iwlR/gj7Y4TmctKDdo8RnvO GR/2PFdSNQ2UG92pkwbA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s8bkZ-0000000Bd2M-10WF; Sun, 19 May 2024 08:18:35 +0000 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s8bkJ-0000000BcsJ-0sWx for linux-arm-kernel@lists.infradead.org; Sun, 19 May 2024 08:18:21 +0000 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-a5a2c05006aso333256566b.0 for ; Sun, 19 May 2024 01:18:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716106697; x=1716711497; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=JckYzcWe8w+0grZPS9NysF8GgHh7PfoFNUhYz6cHvfw=; b=fzfREvy3qekVus7Uh6Gq8RC7qpXPxDY22FSHz3bSl8XLa0Oc3930bjLoewwdWU5u9q aqJmVkvfQ+izOpeFkvDkoMaPwsnt9KnH0fD7I/lFUWNYHqeGLtOiq2WI8r38fc+cQP49 zatwfR8FrPeD0rpEnI1OBVrWtVs96CUszAaDTrqeqUeeHZY4/fZALVedtIkZViyMZvHW nK3KbrBtycJw+nPu7WYF0VQa1Uxjebw4CUCJHJY/MvnbKlOTnaFJQSy2yk7GZ5kohuiP +afpfLZpBU3M2u1lWfHOqEXrezeyTTflICoumwMH9siv++SKpGD0G/e0RrN+V2qqz2/a +VhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716106697; x=1716711497; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JckYzcWe8w+0grZPS9NysF8GgHh7PfoFNUhYz6cHvfw=; b=lGksRU68A0oqN+SGlwQKY9bLUIVGUa9HNttSl1AJkiqxMGee9CJHtHNO2EwMxJTBSu AG33UBKBMyinEAm7QRvBZaQ7Ex2opnjU6U2q6pGMZeQnE9EJT9FAnPHOva9slhAsNcJy +Z6hx3DGmVZoWwM/F8Qa2s+RP2vRqr4x6ov7UAsNQBI6mwlZPck9EldZEKHnyMfZROyz Sjpc7yG7JdJgxbu+WqkilKpNP3uJUe3zn3E6FOdoq3h3VxUgjpS9fmqMcrtKAQEjoEfO MQ3Rm2RcJYAPwM879RC3pjdRV8NlnaDD8tup5LFEMUCDE+L7oxvozXvTaND+HeNnSro0 u8Lg== X-Forwarded-Encrypted: i=1; AJvYcCUZkJ6uoUx+AvimOPo8jnYJd3qleSGkNOs8pAQEmGD08vof91mHyb/YIRmn2c5bR4qMiK4ffEliDzd0C2fPmaqWgDDvEHhjFjd8mC2jSlIYBl9ehHQ= X-Gm-Message-State: AOJu0YyC5grGe6lfKhGJ9PYdM1wYiUi2IlE5CRzlylb+N2BG4QIUSyIk aT7WzbLHJJO+YMkihYYZGGgn9fDGcq8Fgf+uOHfJrdRlp3jlt+6g X-Google-Smtp-Source: AGHT+IG3SMaDBws1fzIkcPLAJz7n7Ag6C6la0lbxW02ImT03Ca69NZo4TJd0EVoTiNb4ZOsqOYvl9w== X-Received: by 2002:a50:d6c3:0:b0:575:a0c:4b8c with SMTP id 4fb4d7f45d1cf-5750a0c4c71mr7898781a12.38.1716106696840; Sun, 19 May 2024 01:18:16 -0700 (PDT) Received: from hex.my.domain (83.8.125.62.ipv4.supernova.orange.pl. [83.8.125.62]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5733c34e5ccsm13698518a12.95.2024.05.19.01.18.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 May 2024 01:18:16 -0700 (PDT) From: Artur Weber Date: Sun, 19 May 2024 10:17:52 +0200 Subject: [PATCH v3 6/8] ARM: dts: samsung: exynos4212-tab3: Fix headset mic, add jack detection MIME-Version: 1.0 Message-Id: <20240519-midas-wm1811-gpio-jack-v3-6-0c1736144c0e@gmail.com> References: <20240519-midas-wm1811-gpio-jack-v3-0-0c1736144c0e@gmail.com> In-Reply-To: <20240519-midas-wm1811-gpio-jack-v3-0-0c1736144c0e@gmail.com> To: Sylwester Nawrocki , Krzysztof Kozlowski Cc: Liam Girdwood , Mark Brown , Rob Herring , Conor Dooley , Jaroslav Kysela , Takashi Iwai , Alim Akhtar , alsa-devel@alsa-project.org, linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Artur Weber X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1716106686; l=1934; i=aweber.kernel@gmail.com; s=20231030; h=from:subject:message-id; bh=7ghoUuP1F66lo5lQILjtg4IgiT6Z0TAcd0jCIemjWlQ=; b=7uG1N3oCFSVcHBgOu630Zb3pi3zaKhxy6TMe+0DPNU1zBvvLFKsgdfN4Ck4LNGhnW0CpYcgRE mdzyO/Ha9ITAAd84jXijoFHaM9QleQPYATtna13/I/VA3AuPupxCnTk X-Developer-Key: i=aweber.kernel@gmail.com; a=ed25519; pk=RhDBfWbJEHqDibXbhNEBAnc9FMkyznGxX/hwfhL8bv8= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240519_011819_350068_B3F86966 X-CRM114-Status: GOOD ( 11.30 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Set up headset mic bias regulator and add the necessary properties to the samsung,midas-audio node to allow for headset jack detection. Signed-off-by: Artur Weber --- Changes in v2: - Added headset mic bias regulator - Added samsung prefix to threshold properties - Dropped wm1811 config changes --- arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi b/arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi index e5254e32aa8f..8dc81112172c 100644 --- a/arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi +++ b/arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi @@ -294,11 +294,30 @@ submic_bias_reg: voltage-regulator-5 { regulator-max-microvolt = <2800000>; }; + earmic_bias_reg: voltage-regulator-6 { + compatible = "regulator-fixed"; + regulator-name = "EAR_MICBIAS_LDO_2.8V"; + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + gpio = <&gpm0 0 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; + sound: sound { compatible = "samsung,midas-audio"; model = "TAB3"; mic-bias-supply = <&mic_bias_reg>; submic-bias-supply = <&submic_bias_reg>; + headset-mic-bias-supply = <&earmic_bias_reg>; + + lineout-sel-gpios = <&gpj1 2 GPIO_ACTIVE_HIGH>; + + headset-detect-gpios = <&gpx0 4 GPIO_ACTIVE_LOW>; + headset-key-gpios = <&gpx3 6 GPIO_ACTIVE_LOW>; + samsung,headset-4pole-threshold-microvolt = <710 2000>; + samsung,headset-button-threshold-microvolt = <0 130 260>; + io-channel-names = "headset-detect"; + io-channels = <&adc 0>; audio-routing = "HP", "HPOUT1L", "HP", "HPOUT1R", @@ -345,6 +364,11 @@ wlan_pwrseq: sdhci3-pwrseq { }; }; +&adc { + vdd-supply = <&ldo3_reg>; + status = "okay"; +}; + &bus_acp { devfreq = <&bus_dmc>; status = "okay"; From patchwork Sun May 19 08:17:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artur Weber X-Patchwork-Id: 13667821 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 82FE4C25B75 for ; Sun, 19 May 2024 08:18:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=JOM5AiOoEA6iOwPOefw3q28FOH9cCOw7F1SbaRPzDks=; b=VZkLnQkzPnFiZA DCbf9f9MaUWd5fKZWRB3EAzKQbmi80KHqaASRKCdmL/zjlvFbDrGBFWDf/EWAGH5RlSfR/9XK2hS/ 2fAX5G9JHR+uk1Y17+nQiALCXIeKMJF8TVs4Ew2ppCDo/AiV0VWfi2AFzWRc1aoIuvZCY782YVCWt wcxbYAONa1ES5HGrOZJZYkQTScgmHqXqNmfoeoCZUr4tXWcNvdjCLxALryKfWquBhJG8z4Gb5ifWn 5xagSVyuyavNpm+oeCGDNho4NiTTjg1bQKseWFSx8joa9MGTpZS3iBC9JzCrjgdpXhWbks0wwkRHs r764OcjYEmWXTlgBlTdA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s8bkc-0000000Bd4t-0U4D; Sun, 19 May 2024 08:18:38 +0000 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s8bkK-0000000BctJ-0hCb for linux-arm-kernel@lists.infradead.org; Sun, 19 May 2024 08:18:22 +0000 Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-5766cd9ca1bso699192a12.0 for ; Sun, 19 May 2024 01:18:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716106698; x=1716711498; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=aoYlKJuAVKS/043JOXevm+O+WyF+DYPGbRh4c0zs6G4=; b=Njdld4vdsZsoWSrjith61n7dEM8DHnETnAxjAlhGg9uIJYwBE/6pLpKvC9EWj/YG1q A5jhGjdsB1bgzlHO0l2OJLprKnPsfF+SEh7x/A1y2W+hmCXzYXTJuuw47UULwUvr8E8n KriikaoyMxlxpVgrFYJIPAjgN0H83LDHlyGNv+qbLiJ5vQvQncUkMywd5aqigEMughU5 SixM1TBTOnKgeV02SSdYnipwNwxMXV3REe1i6gNysCKT6UmMp2GchU4bWcfCjID2xv2J Y1BaYMuoqadGH1UwrDoy61nsznnu2Gku9V51Q/hPWp+n2vanhOeV+G6zBqhOnROA0P9C MiTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716106698; x=1716711498; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aoYlKJuAVKS/043JOXevm+O+WyF+DYPGbRh4c0zs6G4=; b=iB/6x1YV8N02dTxh1wiR1roVi98WNQ5/9N/hoT01wSyAPhi/sOHtTZIUwXJQfsgRm4 fXip3rEnHA6KMI9RLb4QV2DGRmI1KdUSnbjWVfmbYyfKifd7EoTJ1+vcQ8/0uLjwzlx/ v6/lTBAXHYd39WQ8hqtWvcJ7i6vA9miHqLUyIajtijkRe4DqtwVXyiuFglZbbQDStCih r9AbjzDhmqPQ6rfzw8wicSw6r6CraNBbTXTQHsaiRUGhm8qMDqbMUd8BF2oW/S5PkZiJ MefmKLgATdPuJRCb83JxKf7x426aF1J6Ni+6LhuZylaPH8TD61/RZqDALR68RWZmyrTJ M7lw== X-Forwarded-Encrypted: i=1; AJvYcCXyRnMVqN8kaI1tMUI212RwaxzhHFHwn5zOFwG3AcFS79PFvp5gofFSgoZMLWj7ajWi2oE9BIiePjDnfDYu0DSOGGftJxCB7I5Z3eAxpeFGS4MFHC0= X-Gm-Message-State: AOJu0YwYcHkWKAvVTz7Cz1L+wy2lq1FV87PtfohNMahEOmH+I00RWgH1 p6KSnuXpZIjCQAW9EY0TkPXdaA9svFgsOxEVU+76AZqI9F9nO38I X-Google-Smtp-Source: AGHT+IF4aVK2RHhsoD2L1FcF//bl60wrCCva82WMUuzqnmun+LZB4T1hbo8EUe/nwWs1BL/H6eqGiA== X-Received: by 2002:aa7:d1d3:0:b0:574:eb26:74a with SMTP id 4fb4d7f45d1cf-574eb260839mr10123048a12.21.1716106698259; Sun, 19 May 2024 01:18:18 -0700 (PDT) Received: from hex.my.domain (83.8.125.62.ipv4.supernova.orange.pl. [83.8.125.62]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5733c34e5ccsm13698518a12.95.2024.05.19.01.18.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 May 2024 01:18:17 -0700 (PDT) From: Artur Weber Date: Sun, 19 May 2024 10:17:53 +0200 Subject: [PATCH v3 7/8] ARM: dts: samsung: exynos4212-tab3: Add MCLK2 clock to WM1811 codec config MIME-Version: 1.0 Message-Id: <20240519-midas-wm1811-gpio-jack-v3-7-0c1736144c0e@gmail.com> References: <20240519-midas-wm1811-gpio-jack-v3-0-0c1736144c0e@gmail.com> In-Reply-To: <20240519-midas-wm1811-gpio-jack-v3-0-0c1736144c0e@gmail.com> To: Sylwester Nawrocki , Krzysztof Kozlowski Cc: Liam Girdwood , Mark Brown , Rob Herring , Conor Dooley , Jaroslav Kysela , Takashi Iwai , Alim Akhtar , alsa-devel@alsa-project.org, linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Artur Weber X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1716106686; l=1280; i=aweber.kernel@gmail.com; s=20231030; h=from:subject:message-id; bh=/QyKeHFcTD2xub55oeUkv2MeNFIR4VYheZEY658FtbY=; b=uIhQX5gQujMd8bBF2k9b1KLhHd9WhMaSqaCMxb8Np8cIQECgR/UjvobYYub101csayG1sTsUl wFY8L+MWe0dA9Ypafuhq1UhoaBTHpdAku9evW3iE3kLkozY5QxnDDuZ X-Developer-Key: i=aweber.kernel@gmail.com; a=ed25519; pk=RhDBfWbJEHqDibXbhNEBAnc9FMkyznGxX/hwfhL8bv8= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240519_011820_265741_A5A864F6 X-CRM114-Status: GOOD ( 13.50 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org In the schematics, the MCLK2 pin is shown as connected to CODEC_CLK32K, which is derived from the same 32KHZ_PMIC clock as Bluetooth/WiFi and GPS clocks. 32KHZ_PMIC is connected to the BTCLK pin, represented in mainline as S2MPS11_CLK_BT. Add the MCLK2 clock to the WM1811 codec clock property to properly describe the hardware. Signed-off-by: Artur Weber --- Changes in v3: - Split out from "[PATCH v2 7/7] ARM: dts: samsung: exynos4212-tab3: Fix up wm1811 codec config" --- arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi b/arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi index 8dc81112172c..47e9a230f2e8 100644 --- a/arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi +++ b/arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi @@ -529,8 +529,9 @@ &i2c_4 { wm1811: audio-codec@1a { compatible = "wlf,wm1811"; reg = <0x1a>; - clocks = <&pmu_system_controller 0>; - clock-names = "MCLK1"; + clocks = <&pmu_system_controller 0>, + <&s5m8767_osc S2MPS11_CLK_BT>; + clock-names = "MCLK1", "MCLK2"; interrupt-controller; #interrupt-cells = <2>; interrupt-parent = <&gpx3>; From patchwork Sun May 19 08:17:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artur Weber X-Patchwork-Id: 13667820 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C8DEBC25B77 for ; Sun, 19 May 2024 08:18:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=j5UjxdXeC3dT65oofE75fdNr0nmB3Fgx1UYh+roYsXQ=; b=aNNohku+4XfpPJ zN43vXLc9x/xQjAWIVQ2vgJdZb7jvkYDc+6gZGXdRxTCED2/u9XEJznB2t7McKSHEyFzumwcGiirR pN2QTemTboIctwSvmDxkigh5CXWIPHfgApj1GrgeVxUIxSY92P89JDc2+yaBwtckeX6uYEM2NpzfV rm0eBMWdz55SkL+eSMh9KokipfPvykUmz4Sp3eBc3GEc3UCpENKmH1A4ZIrOmdWdghSY/dB6oNrbT 4AdeBpMYetVUaB4ZnkADe72rN1AqMNgX4E7Hho5DRBHSbeoLSe30IQEH5EFhLvbrLGyU8zWvyYzTN mC2GjhEMBf/hcnqG5sPw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s8bke-0000000Bd6f-1mor; Sun, 19 May 2024 08:18:40 +0000 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s8bkL-0000000BcuM-3Iyx for linux-arm-kernel@lists.infradead.org; Sun, 19 May 2024 08:18:23 +0000 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-a5a2c05006aso333258466b.0 for ; Sun, 19 May 2024 01:18:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716106700; x=1716711500; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=WZHcFtW9++T8RHFOp1RN6v1q8xOqk7qAzG9FoGfpxU8=; b=TqleXtxjVNcb6uufnPM/eaJYrgaxGVXxDuMZKb1ldDyu+vOgFuSQPSuf30IScYmdSV U7woYeRPUY2GFa7/72mosnZv6iFWQdNtJFElVbu2f3p5HPMPdebAns7einI0r8bMN7Hb 5+t5v5ObG14wNTM1cNlOmBLQK7t1RArDZNM98g3ioDsmCcFVH1P+d+atGyQQkTJPc3t5 HO5MTiAu9wj8IiDZgvl6EQ39Bp/nC9V6Cz1V4cIBr/zbCWnzI3/JFzr5ZQGh0ftIeoNT Ba8kG1oSndN/cY1yr57iCwsBKIC8MCPZzB3T445VXXgYJFiJe8g/rnGzEXBVXo+q0G2r hj3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716106700; x=1716711500; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WZHcFtW9++T8RHFOp1RN6v1q8xOqk7qAzG9FoGfpxU8=; b=bMba1uVF21rt5zoMZWpt07J9vsrbMkYsnXe71CkzTx7fQMLtrqIlrG/YTSlG9+wZdt jAHwQdvMm5VPAat60Z1M+EPytOuh94SJF778pE4EPWXV0B+hL2u8Dvg5wtVlUwN11wzJ 4JtcxB7vfq75sOx7wtS/b5+wLtGEArbtMPOvk9g6PUjDYF+r3P0doJ1ZHcP1PG2htkfs 3mtAgN1BsJBefsr3X48hJMSB68fcohkglFrSzU23zwCUdyj45Tg+XpDCUt/tObRdo9a/ lUghRt9+/m6X3tX/sreUgK5SL7sa9dZFAmTXqgLwvjYvlo/Fkf8/chvB+KZUn92jULFO P8YA== X-Forwarded-Encrypted: i=1; AJvYcCUnvpMhRm0lKslrVo8HAUK3z5xeZgsV2Uz6Y/SAHQ40GRJjWyYv7DM/W03YTM8HVNVi9rqSeNGd0AhdLrw7hPvCNGz4psq2aa0GXAVgaWJaG1w9G7Y= X-Gm-Message-State: AOJu0Yyy15zbENh2Qa8LYY3wd3Cng5LuqPMGXiWw9WneW4WSHM+31awc Sa/W9Vh+1oJerX84kMuk90pXtKYe1YCpgZyOR6+Mp5ebDoKmvEJP X-Google-Smtp-Source: AGHT+IHzAvK+rhsJq8Fp46ZI7QRqXTxhpYy+yG/cCF9GqQapzPdzcVtci17vQVRRgkNlN/TxSgrMKA== X-Received: by 2002:a50:d518:0:b0:575:2ccc:13c1 with SMTP id 4fb4d7f45d1cf-5752ccc14damr2537043a12.9.1716106699861; Sun, 19 May 2024 01:18:19 -0700 (PDT) Received: from hex.my.domain (83.8.125.62.ipv4.supernova.orange.pl. [83.8.125.62]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5733c34e5ccsm13698518a12.95.2024.05.19.01.18.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 May 2024 01:18:19 -0700 (PDT) From: Artur Weber Date: Sun, 19 May 2024 10:17:54 +0200 Subject: [PATCH v3 8/8] ARM: dts: samsung: exynos4212-tab3: Drop interrupt from WM1811 codec MIME-Version: 1.0 Message-Id: <20240519-midas-wm1811-gpio-jack-v3-8-0c1736144c0e@gmail.com> References: <20240519-midas-wm1811-gpio-jack-v3-0-0c1736144c0e@gmail.com> In-Reply-To: <20240519-midas-wm1811-gpio-jack-v3-0-0c1736144c0e@gmail.com> To: Sylwester Nawrocki , Krzysztof Kozlowski Cc: Liam Girdwood , Mark Brown , Rob Herring , Conor Dooley , Jaroslav Kysela , Takashi Iwai , Alim Akhtar , alsa-devel@alsa-project.org, linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Artur Weber X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1716106686; l=1130; i=aweber.kernel@gmail.com; s=20231030; h=from:subject:message-id; bh=EKY+Hy6LBgA2NYrAxNKes2DxchRh15GEYQsulR1Ud3E=; b=Nu8HOGw+ABK8etkGN/FIHwRrDIIaop4fIm35cS8IufNRyVktSGw+ltxRgukhX9pKr+Bmh5B/R wxogZ+n7q5vB3cE8+MeF9gE6ftpRyW72QbVAuVZlr+VUAeM/A16FXYw X-Developer-Key: i=aweber.kernel@gmail.com; a=ed25519; pk=RhDBfWbJEHqDibXbhNEBAnc9FMkyznGxX/hwfhL8bv8= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240519_011822_000242_692E894C X-CRM114-Status: GOOD ( 13.71 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This was initially copied from the Midas DTSI, but there is no proof that the same interrupt is also used on the Tab 3. The pin listed as the interrupt here is GPIO_HDMI_CEC on the Midas, but for the Tab 3 it is the headset button GPIO - GPIO_EAR_SEND_END. Drop the interrupt, since there is no proof that it is used. Signed-off-by: Artur Weber --- Changes in v3: - Split out from "[PATCH v2 7/7] ARM: dts: samsung: exynos4212-tab3: Fix up wm1811 codec config" --- arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi b/arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi index 47e9a230f2e8..20e5e7ba6b92 100644 --- a/arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi +++ b/arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi @@ -534,8 +534,6 @@ wm1811: audio-codec@1a { clock-names = "MCLK1", "MCLK2"; interrupt-controller; #interrupt-cells = <2>; - interrupt-parent = <&gpx3>; - interrupts = <6 IRQ_TYPE_LEVEL_HIGH>; gpio-controller; #gpio-cells = <2>;