Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp1112032lqb; Sat, 25 May 2024 06:28:45 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWGYMJzmXzyMw4OT91dW7Mi5/WD23zce67jEeL+UXRDrCqZCRs1PFycTCmrOFgE+Dc3qysR4rK6aPQti3bMiPpsOxaBPUV8BiTcbw6dsQ== X-Google-Smtp-Source: AGHT+IE25b80t5ROhpeIQ4VF52atY3/hkrLtoqq9u4yQu/aZVllmlnYYo0ELUQieUgFTKgYvBFsq X-Received: by 2002:a17:90a:55c6:b0:2bd:ef6f:5c91 with SMTP id 98e67ed59e1d1-2bf5f407cb4mr3832744a91.45.1716643724753; Sat, 25 May 2024 06:28:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716643724; cv=pass; d=google.com; s=arc-20160816; b=K48bw8RvnyYXFcbCg5qlS4Q+tUZuNE5jX0zU5gxogtu0dEHXPJvIRhbgh/oUp7NlLG wWE06/dW8bJPMIDitRT4OrCFoyUYc1Mkg5+3aT2lFOH7U3ZINfNepNqmI/D4PBgrReT7 HqQh5NklkZC30LvjQhd+M2j7hzsjp6ExQz6cbGcFAogRY7PuNlxYJWv1oRLh2sK4eTUv tm99x1DxWrC+9j8BvEamIWtUOZ1gb6PY9PH7ecLc8Dxyp5hlQ+qZpYmDczY6rvM81lLq Qoa7xFQ49/tWfWsE8LVY6qJf+dHW3ttoTBqeH+Lh0ydOSQoGTOJpk8WUmGCTQf3heIuB wN5g== 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=GaBTo72FFPQQpv6Vx/c6UOAp3vgYZvaAb8kpzvmiOq4=; fh=wByZ/9fTylQKCXifT8fx/8ZuEVVBqDI812J8YVVmbTk=; b=ZPWsodeW51OgJb0DhMLrdrRLDgQGwcpEyz6MGF/EkUmqO5lf/+aLRkZ5bdhdCpi9tY eYI5C7rkH8RIuD3ANsAoItXbn9sHuBUp6V45iabpR8X9t81gOBkzdoVDXdCiJ7cg37+d pGUXl0pIuYKCv0WcqiQBpBT7t/qpKcLi6OccwVacFnMHfBN5HwfRP/uLRakqBv7CegP3 o8PWGeHv+fE9vz6B+PolCh69cOuaJki203TEet6sXebHkd3+4HkfC44FlHllFV5IHewD +L9dplBlJOsnZ0BoUPUadp5VDI2gHzSuIaXabGNzqIGEsmklzGP11D3OF/j3YH9kC1IH YSXQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=b5NEcIbP; 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-189357-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-189357-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2bf5fe863d0si2953887a91.172.2024.05.25.06.28.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 May 2024 06:28:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-189357-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=b5NEcIbP; 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-189357-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-189357-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 578A52819C4 for ; Sat, 25 May 2024 13:28:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B313958ABC; Sat, 25 May 2024 13:28:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="b5NEcIbP" Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) (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 2DEF24BAA6; Sat, 25 May 2024 13:28:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716643692; cv=none; b=XevwapaEi5UMzEp1TrOQoC4TSb6kYQnWhgybayOzwmk1JcIMD82yhjMncPWZG7zstMKNqKeGxj8TAjrspX+jwBNW6f/lPlrogbYEAnwuny8CTKiwX9yMbSap522tFyMmCOCQ5G/tj0jXqaOOhAuoiTEotrPWRaoyA81nStI3qjw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716643692; c=relaxed/simple; bh=Rsl4K9dB39cIJFWh12QWC6byH17AfCNyG1AGcEHy56E=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=XhrIXtMtPKlWd9n0X/NujQRtZvmvUs9jRGAn85FT3FICubTc/1LTAvb8RqoWF6rkTKKi3SxuE30Z2ZHVze7dDMD2X73o9fSYnADKyuJ/KSh9JfV6POQFDsHI/c3k6ShprHmSAIsnl6vad48p0dWWDJ4/XsiEPEas+v8DaGAki9c= 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=b5NEcIbP; arc=none smtp.client-ip=209.85.218.47 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-ej1-f47.google.com with SMTP id a640c23a62f3a-a626ac4d299so179788666b.3; Sat, 25 May 2024 06:28:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716643689; x=1717248489; 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=GaBTo72FFPQQpv6Vx/c6UOAp3vgYZvaAb8kpzvmiOq4=; b=b5NEcIbPAfGUb7WNNEVekhn0Um20jspQh7g+49S964xhNI/2fcEgv95l6uXhbxbWkB Bnlt8nN0sj0WfsJIv6Y+u08PR884GFCBVdwgxeJ75bGHahfDGSPMR3Ic/B/aueFiTkQd aWNFOhb1jWqW55uGOc0DEYxHMJbKE/y8XPbmP0IQ+xJXdiJk8skNqoBoVhiZSOEIMsmX ggErQ13BAanr25VJe0FZPl+htiOxa2yNMEHyQgbvGFAVoJwdmhRiH1KdSuQvHLKAgv3v 7PcLnArkyhnnCLpP5EghZ04K3WDDY88dED/yUYXV5rn6meKmVQN67x62KOfGzF40Ttup qnsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716643689; x=1717248489; 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=GaBTo72FFPQQpv6Vx/c6UOAp3vgYZvaAb8kpzvmiOq4=; b=j7zHNet9nK5ZHp1piC0/4mFXqTcl54RQgyfdeVXQZFfjU1pL71LWK4Ola0MhaNqXOb khMik8C3MTOpyZ1fjxF2FETfGe5XzZUtN1Xoosi/RuKm8D8qsqk6h7WXiIeL6eLakIBk uTxL8zPjE0LAdanaXy9evfO8ZE4NM8V7TOm31huqhk7LXNqYg7Y3ZWHv1DLiDBf+iYH3 HzXCPAsq5/8s0PZP8Jr4AVL1UURScT4vekqLOS10FMH8oGDL0gutviZp+37nR9MvY6K3 v9H9UpntZGxhbQ9Hmc/8rQtUUZ30tpSuFUxd7T8K5/aB/01Wm9+VVS25RinoVBlcB6k9 4y2A== X-Forwarded-Encrypted: i=1; AJvYcCUjBrRHXBQ7IIY/S64vsEGah89YwAbdyxybOAdhyZCFa4gWUdu7yRdQzszHqGFfatd71qWS2/K0pi2cPvjkpqxk5vy6pyDpxzTd99Ao61jGwWmj4PPym8TpFiUF094ELBwCgxcCt0sazy4jyWHAIUm539iVB1tm3VbRWPcDXQX7SzxkNoYNBv02za3jqkzamixdXuEfjwM3Jl3fQPyN7luV/lDpzOaClsU= X-Gm-Message-State: AOJu0Yyum6BMe8HmR5kLf6xKcyDdh3+bKGhE8vMLGJxyxA22lYOIVIai SCPzKq/CE8tA3JpuYr9/y6jD2smcA9uLEhzMWuFW8HvilXXPyTWI X-Received: by 2002:a17:906:a0a:b0:a5a:4683:e961 with SMTP id a640c23a62f3a-a6264f0eeaemr311160366b.52.1716643689383; Sat, 25 May 2024 06:28:09 -0700 (PDT) Received: from hex.my.domain (83.8.128.191.ipv4.supernova.orange.pl. [83.8.128.191]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a626cda46e1sm251842566b.196.2024.05.25.06.28.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 May 2024 06:28:08 -0700 (PDT) From: Artur Weber Date: Sat, 25 May 2024 15:28:06 +0200 Subject: [PATCH v4 2/9] 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: <20240525-midas-wm1811-gpio-jack-v4-2-f488e03bd8c7@gmail.com> References: <20240525-midas-wm1811-gpio-jack-v4-0-f488e03bd8c7@gmail.com> In-Reply-To: <20240525-midas-wm1811-gpio-jack-v4-0-f488e03bd8c7@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=1716643685; l=2328; i=aweber.kernel@gmail.com; s=20231030; h=from:subject:message-id; bh=Rsl4K9dB39cIJFWh12QWC6byH17AfCNyG1AGcEHy56E=; b=VNuxPjI5euL5nPUvXQhYTV/hpQPtChvapioTHtcSQs/+z/mENYr3KDtB+9gBSeEivCEerZK5p 9DGuSbFHIJZAbOQ2gV7eXkUb/2PKxPzwrTr3VdIZIAQlJ3PaqU92shJ 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.1