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