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: 13658548 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 7FCA0C25B5F for ; Wed, 8 May 2024 11:01:47 +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=76f67HnUMIYcFttVBgKasmPwyncM6lN93WaEfElvVXM=; b=yUS+MvuHgTM2Dm J8N75qtmbSe3rLOevQzlWvOtCliF+McsfrLulDDd0297jcs9w10dlWUWj4IfXtidOBQQHf7v+S548 B2lIKAl04oir5lJbbJrgbtMSnBYB9Xhkeue0CED5DCQwvKe3KbX9gb9I0tSeQvkSNt3NUBGHveRUY 4HMlgBcKP638vBHlrp5EOYn4VPOLzdcQs2tZaTg1lGlcxdpDkULRehUilmv6UKUGxz+2p6OgjYYf/ GHuiIJf4LNZj3/zy5I3AUGWI+KLUEn1B1cmyC1rV8i6uSTieIP04SkCyQoRu1N0V9wv8UIkXUlM8G iHKG7fMf6Y9oSoNZ2x9Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4f3A-0000000F5z6-1vEO; Wed, 08 May 2024 11:01:28 +0000 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4f34-0000000F5vU-0957 for linux-arm-kernel@lists.infradead.org; Wed, 08 May 2024 11:01:24 +0000 Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-a59cdf7cd78so852571466b.0 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=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=bT4moxnFWMX+ROOOxuh3w595mSjqjEQ1yI4SN/pV6pw=; b=eTElpwxuAvF634RJ5sAoNibQsvA/cx9sRgDkV33iDtA1OE6UgPse1kkN2ohf1/+CV4 qXSx8/ribExq3SusfeELDQO+9dkr4umWGKEGQwJslnOvAF/w4Y93U5X0KLGAZVkrVIFs IC929UEyBa71aiShgfnqtKZvR5OIXbujBezVImHBz65Yl/I9/ZUlkA5SIPHwt0/aDZ1q AewJG6Phn3jGjQJ9CqIIh3eKrKXjl9p1ySTFnUtJvL0w4fY64vzHgOH4zcI4ynoBdCAk OOdwaVUOwOHzwq8BAEtl/35p29rI6d1CITHSM7BbWZviJmlZ+7IPHN75Ssp8goBx8/tN 0ViA== 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=ITr6KfTl8fEg6/GridxzxyRW5ssoxik6iXaZsrLHjkG4ixhjoBgpkz4ilJK1H8CI3D OFco41Y9+qVLCN939+D6hf0cQ37V2eIq56WfwtUcrA+nv4enJbvuv6tZxsN+WoGgaF0r OB7ZMdGuanQQdkhzgC5nA7FWF5KLROs502A8drUR6k4kn5RHd/DBcbdVpDSLmZNQNjt3 c0S4/YkjMRTaLLyYZbcPlVztclygjwbqUNfQPTCEOeLx13ZUAu9vxOxtcaGUpqh2KIHY 6FHLS09ExbteWYzb/h4T7VnUwRBrzysUSb1Z2KE9kErTfpAe7VLQnFZkv2XylRWlxIh/ XgZQ== X-Forwarded-Encrypted: i=1; AJvYcCX3lvueGXhz/rSKvr5ZdInm0EuSyF5su4E1bEulfXn9sfEOiuyk/DpTRmSunXvWu1u4mOEO704pjAYIeYeS6Yn54y5YDqCshKqFPJ/73a085aHG3No= X-Gm-Message-State: AOJu0YzWOqGHTwFkwMHTis2FLO0GmLA6ARnA+VIr0G7MvSnoxzTppZMv i+KVmrlMvbWLtle5Zc2YyHl6AyEL1BgNs8hvgd5j8bMUFobNHHtMDSpaZg== 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240508_040122_154675_518C9862 X-CRM114-Status: GOOD ( 12.53 ) 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 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