Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp1848849lqo; Sun, 19 May 2024 01:18:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXbi/iwdKLUoEsDuXVn5mzVXccBNGKc8Cs1dOn6AdMIds45DrCL+xmEcz5YpI3RwDJIxS+uUDnYtzGlhbzFF5150Sf9BPNplH5Y/0rczg== X-Google-Smtp-Source: AGHT+IHoZ0vd09iCHLnO4kkGRPuE1rcFqTZ+ugSAmx9Xvh4gk8gpxPNvxNcbI2y2OSZxXIexycnA X-Received: by 2002:a05:6a21:3414:b0:1b1:d371:335d with SMTP id adf61e73a8af0-1b1d3713568mr1579840637.19.1716106732994; Sun, 19 May 2024 01:18:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716106732; cv=pass; d=google.com; s=arc-20160816; b=XnFmFl7LCQEhI9N9BZ1aTv59yCiDWNidQefaraeknTiwCK0qgE8qqKKIApwF8fBvMu iQoiAhju5sXbs+UmFWCVwum1e/S4YwUBHJlnKi75SiVQVoH5sFoXo0ZzEoIyKZrtHWkb 4AklpEZuNhrqhVZJGvnZu/e8vMLl77Kt/p84M+bFzmXCU42gAkh3P8sAuaiagjvKoiyb R8O5P39YeyyuThrgHy20MRogxetWf10UMTKs/zdf8dus8AzllzxuXJBdOzYCosuyEX2t gKeyvp8M+9WduypJPyaabm7OwSAkMP4/NLbvqHiAczMVQvn+rO+yVaOo2PhvTNpA0n3P 7z7A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=R9dPohp8pfuUkAslj/44LQMkiwtv+DsL3rPN9tPKGHw=; fh=jcjgFpof6u6wG7EzgVJtyUGew+RtbpHbVEneOgbKD3w=; b=0unfCpIjgFezWkVU6NhvjCK61UsSEkdcQRdUwDF47IFv+ZkrO/ni7MCC7lp8UJwW72 4HNrshqP7ESLt2uAu8+JT6a3Ex3hhdVpf5KsBL7nH8o4CrX39A5II4m2nMK/rd+Xjdfr VCufyQepdlKADf7u27ttJ9/91D2oUXqBrK2nBewjDeaTFFn5yrJM1Vks9h4esapcgIdU dkEjwslS/H4iCf1L88ZE0Fdooj+M7T7suAGozbKAWs4HIX3TvMuKy0uT+rHujPiEYrNn FDkCsDRykzkeiz7DDxEcrodh4IwWK4HQ5mAE4sZNxlA9vdwIhcrvXYLfBgqds6rEoe7o eHIQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=evO6cqRH; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-183054-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183054-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2bd73d5984bsi189289a91.151.2024.05.19.01.18.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 May 2024 01:18:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-183054-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=evO6cqRH; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-183054-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183054-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 8DD44B20C6A for ; Sun, 19 May 2024 08:18:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4377E286AE; Sun, 19 May 2024 08:18:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="evO6cqRH" Received: from mail-ed1-f43.google.com (mail-ed1-f43.google.com [209.85.208.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BF68A18C08; Sun, 19 May 2024 08:18:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716106694; cv=none; b=XH0u65R4GEoS5qq4ZKW7EAi9R94rCYvqWvh1L1pfrzihq1SS1Y4klPev02ow7ceYGMr5J6Ape3sLug1CAPmfAXvbPd42kFs3GMaE3KnFf7FUjuiqf3Mg59fLsDHHmoAxy4mSqtbWgJuR5ZiMYeR0Yhere2fIrWvV3kfxy20M168= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716106694; c=relaxed/simple; bh=EZXePcBvXKiwP3EXDEHqCyB/Gu0AEIhLbrUV4Fe+KI4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qkG2kRTy2kBPVIXSadUIv4abGEayQRMemccCrgXwpijteE+TM8owptJRsmlfDz1OXkAchLABBCbZ3S/minpPmpIlaPxKeFCsyyr2Hph1qLQvzxkJg3vQRZd9Db/qmRItirDQXQ+n7YFKgrCy+DYv7tGvzhMSp71Wb8HZ18auWxw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=evO6cqRH; arc=none smtp.client-ip=209.85.208.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ed1-f43.google.com with SMTP id 4fb4d7f45d1cf-56e1baf0380so6291515a12.3; Sun, 19 May 2024 01:18:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716106691; x=1716711491; darn=vger.kernel.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=evO6cqRHGpItRJvz3XH4lqDh0qa8kN16LXUCHjDbROGxF8X9Wl3XDwtqRHZ6FSt7a9 qoN5cFKynMDDtdwGj6sWb/iOoivXcu1urQhGVsRQUgxCFPDrKCnwTL0gbMcW79o4YJW6 Bxi1NQipKlI+YLN8bLhY7P9KPmJuTzMH05Tn/zbHs3g4X1ST1RQqG8oFDQ4RevTQw9Nh fERDvXtz0k3VqnQ2OW5xbVutORon9FKln2PE+Zck87ooUWfFrwslfs5R2KXgdqFK1jZh 43xx9LB18TYn0pHyb7Kiv62hHQSNY+SIl05v2MnDAhtznDWpUXhrDzinlIJ0l4zSTfV4 iUWA== 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=dimSBAx78YxMw0ogkwTfpihSCyQ7NaLv92nJM6rYpz2rGIJRiHqUemxay6xQwn9x4z //dWnrLrLbj4yoc0JYKET0oTd/w2+MVMPKSd67L5nLaGjwNTc1ojkfPQVEzq2I+ta33Y m3zXkhodHS/S/GnuPor1ysBa6i1ikh2YT07kPYDFdMsgDdMjXWN/WNR4aqGTL7xvjxOU RwhO7vDQjiE1WX9AzYo0Ha36xg6jJY+omIwiOw1TYsXidQ31jO4H6HKh0WaQJH4L2ONA 3DSZKwUBHMiLpUXSBe9HZ2hz5r30I7r7sfKKP/Eb3A5S17lMT0hktp2YKkyHlAcqGJcT +6SA== X-Forwarded-Encrypted: i=1; AJvYcCXYnr731lmJAm6C09q1tbBFXOEoL1LD9u/oFWFcds1mvV2EStVT9qMgHUcfBVPJnpUUcXCyf6aewwc/G35u/JhPyxbcR6IKBlzkStEc3/sJAHSn7fKdJRYI3rd0cBSNWWjkY6Oys3mAvKrLDKthYvwKBUK9wfsLIhb94G1UaBAs+2Yyp/eoroLeCIKitul2BchLkDizSzxEb35qpA1SQIC759bsgQmLddk= X-Gm-Message-State: AOJu0YzOT1NNixAzRgiJ7g/PFa1vdoyP/h49Hmiav+pMDcMyi7BOBvGe gIQlpZKxDG3C36iTrSffcFJb5uUgrPPUl4EKaE+w5hYQ5KyM/E0j 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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= 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 -- 2.45.0