From patchwork Wed May 8 10:58:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artur Weber X-Patchwork-Id: 795516 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (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 A95DCC04FFE for ; Wed, 8 May 2024 12:54:12 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id AD26982C; Wed, 8 May 2024 14:54:00 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz AD26982C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1715172850; bh=x4CRj3HPQjjxV02Uhbn39jzTSMCqAM5BsNr5zZc40mM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=rd49nOaFwpeDloS9i6+LbFKRZTWNcxiP37qO0ezBVDISXsXdWvkCt1p9dFpP8vNhb AhAojqNNCt4jDnu3R+KJAngJcu3tXIyP9lbOoy1xJxpajCSLbVddhqBYELGj64c4sJ hdNNh9duGKbLPuyvL7BNY62twO895OiAnm7k7/BU= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 3FEC2F806BC; Wed, 8 May 2024 14:51:54 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 832DFF806D1; Wed, 8 May 2024 14:51:54 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 80F08F80564; Wed, 8 May 2024 13:01:41 +0200 (CEST) Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 4E587F80423 for ; Wed, 8 May 2024 13:01:21 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 4E587F80423 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=HtRCNnOJ Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-a59cc765c29so783224466b.3 for ; Wed, 08 May 2024 04:01:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715166080; x=1715770880; darn=alsa-project.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=bT4moxnFWMX+ROOOxuh3w595mSjqjEQ1yI4SN/pV6pw=; b=HtRCNnOJsWYUHtXXGYmvCNH1vIBIzhpCXmWv2L6J6WdYXsMzXLxVBTesotGhS2X6rd XTZpCdKUngsU5X+xZjGtOi9B3kDKRYP4qB6Zg8FPUSZHeMBw2AdweWJyeLf8dGYFVKjW TXS23aSgOAaLGgh3otWT9aoYdXPG+RZiWtAlOZsmWBk4tZ9NRMk/IE9rp4EhU9vPzgLI sW3XLMrx88UU8VPJNF1PVnVSdB5gLwRK8JeXT33UVwBvv4UVSdw3dE4vLtJ5ZkSZ4ah8 nsHN5v4sL/97ud3y8x8F82Sc8IBWV8HSpHxxL5y8gK6Fp2caJspMtL9vhRTGFw/4u5iZ 3qIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715166080; x=1715770880; 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=bT4moxnFWMX+ROOOxuh3w595mSjqjEQ1yI4SN/pV6pw=; b=Efuvg5vlml2toxGLwS4DJ/8gufH5vIo8/3nV1h6TxmOqhBadExd9bOTGyV2mnO8LlE /cPrtIm+OyVnb6T3cUMOfw+UFJ+ccyMEwczqc5dv0duTQihrZbmZ6IpKegpdKvn+eV1i ilsqbeKNO0Fjx8nHgDFyVyIG8UlkoPbfmQtRKZ96/itYPX86M25OWs4lM6OgnRgqcL+0 LQTxB1jskcXMrOZ/lhWlFidJ+/9jGwD+W/PrGxIymfkmt9HoDTGS4QibrBcrbH2Amewq iVq/RY/pvzMpSCpKGeTLO22LdgzNaLi8Fsp+Twk0EgxBaNhRODABMfHLvHz6CZG1k0ON 3Dtw== X-Forwarded-Encrypted: i=1; AJvYcCWZpEMMUqnZZDghoz88EsjqfTaX9udQ7AlCJFM+RATAt9TGKE7kKYZsnmUjyk0EfxCsVNbHz1Qdizuv989dsmpsEyaJHheBut/naJM= X-Gm-Message-State: AOJu0Yx6o04skquxawWNGmeVLYJWG2ICJr4ImPWegBU7mpQroU5ULtaj 0h+i6XKObNZi2Qm8u/KZsMvCLc16k/EdOoergcfxpoOVAU1fqCs/ X-Google-Smtp-Source: AGHT+IGyZZH2dVq+LOe0zaf4rz7kDLtf4v4iLQC8umEfCOPDmCDuJtUXH0SpHIqe1/sL73DxJ3vqeQ== X-Received: by 2002:a50:ab49:0:b0:570:1ea8:c50a with SMTP id 4fb4d7f45d1cf-5731d9cd410mr1935750a12.6.1715166080555; Wed, 08 May 2024 04:01:20 -0700 (PDT) Received: from hex.my.domain (83.8.126.253.ipv4.supernova.orange.pl. [83.8.126.253]) by smtp.gmail.com with ESMTPSA id m6-20020a056402510600b005726b58a436sm7455793edd.30.2024.05.08.04.01.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 04:01:20 -0700 (PDT) From: Artur Weber Date: Wed, 08 May 2024 12:58:50 +0200 Subject: [PATCH v2 2/7] ASoC: dt-bindings: samsung,midas-audio: Add GPIO-based headset jack detection MIME-Version: 1.0 Message-Id: <20240508-midas-wm1811-gpio-jack-v2-2-b4d36cd02c6e@gmail.com> References: <20240508-midas-wm1811-gpio-jack-v2-0-b4d36cd02c6e@gmail.com> In-Reply-To: <20240508-midas-wm1811-gpio-jack-v2-0-b4d36cd02c6e@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=1715166076; l=2135; i=aweber.kernel@gmail.com; s=20231030; h=from:subject:message-id; bh=x4CRj3HPQjjxV02Uhbn39jzTSMCqAM5BsNr5zZc40mM=; b=zsZQ0yeh7zg0Ep6m1GYQPRjfMq2PTI5dByvyZhsHCpPeLOEvFLhyar0/PfAzi8k6j4w1bXraj /eDPEpjzkwMAq1iMHceo6NnRRQvuVdZXpOxSY/0HEXQIzSIoLMG5QuW X-Developer-Key: i=aweber.kernel@gmail.com; a=ed25519; pk=RhDBfWbJEHqDibXbhNEBAnc9FMkyznGxX/hwfhL8bv8= X-MailFrom: aweber.kernel@gmail.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1 Message-ID-Hash: SYHDIV5N446GUK7NGB3NCL6ULQNIRQ5L X-Message-ID-Hash: SYHDIV5N446GUK7NGB3NCL6ULQNIRQ5L X-Mailman-Approved-At: Wed, 08 May 2024 12:51:30 +0000 X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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 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..6b760a73e8bf 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