From patchwork Sat May 25 13:28:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artur Weber X-Patchwork-Id: 13674017 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 E1BB3C25B78 for ; Sat, 25 May 2024 13:28: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=F18bqAHv/Vt9EVZ39MALe86/RVwWUzf+6Neo8Uz/qcQ=; b=0G8rDSF2Qq30MZ j4M4qNlqtGW09XMPie7dNZ3/4pX8pYooRynm/SkFQh7jo6j4TCamnddsOjhpeCqwQ0KJhCkvttIUH Hrb0+a912iZzCv2qht7zK4pcLCpRYC2seh7rUICO0xuKKgeLKqsau/nDZkfFvdl1J0Qs6djPKEWOV 4bAZ5RVaClN7y28f3JEAQ0UsysG4A374glpZrc5Q+UF7WdplXKWbMvbHwN5slovtQ+06m9en2+FgO 7WxrSqvXUkqyOJtOlYfBrLO+dhwJhzgidbbHeeolAHmiibelZ6o7Ig23BC6z07n3UDXWqMwbDLpoO WIEzI+g9ZPRmXfZdBbJQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sArRh-0000000B4BR-2k5x; Sat, 25 May 2024 13:28:25 +0000 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sArRU-0000000B46E-0cD8 for linux-arm-kernel@lists.infradead.org; Sat, 25 May 2024 13:28:14 +0000 Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-57857e0f465so1689098a12.1 for ; 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=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=GaBTo72FFPQQpv6Vx/c6UOAp3vgYZvaAb8kpzvmiOq4=; b=jFxOo3YOoDzzcqzJWv9FxJEfT2vkp8NMIyyf3j2+VvjD/9HFEK4XroEI8bzWnsGO5l dhFVnPFbCEQ0P8Sf3QJGrtEZonAYylx83IwtUr0lR5oyhYRajKm4h7Qc0Xuv5wsj1XuU WjnZL0h9JOEkwxx75NfeG/vO3kPHVLKEtzyqzUKZNFIVW8ZTw0cZmuK/7RojY01tgP/0 NpitNmfEcBwlpHhz8ZaG5lAbAZU0zNXL42yotqYUJvWNZahFddZ93JKPx0mRfk836fe+ VFvx5KIXdvn1cMT1aDafSubG9Ni4hJv2pllfNtJoyabCJY80J4+F5wrBWGbt8loacSj6 58dg== 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=Ks6h2D5qvpE5kPrMGTsfUXskYQQx5gkDcstijrI7JkrrDt24tGqQFV1BiREqSARbIk zi6rX04LqrjJHawxtTygAtuKkhB2bf78CDT94ysTabrIbhLTDOkuP2UuwiAj74FiBBYw uYFGhOIipGaIZegKRUMX5A6dtsZhYTaE8Ygt2ua2EmwPctIUOWgdfdQtvjecCseJK29z aWDZYNDlSm7I7seVqgdfXDWG65BSFVidOyUMaaf4jcE9nNKvGCu0bHn7bsN60yNJo03m uGkvOuIYVLi2UMalJ+PeA1lT9pB7Trv1HJxDO6TfGpBjlLpNbix7ugVAco+S7oIRCDUO VO1Q== X-Forwarded-Encrypted: i=1; AJvYcCWehwOZhNRgVF15UwLzOPmFVTjoGpAsDJDstnwh+o6VBxSLUHyhTBk3P+oARTsfEX0faS2E4RQGt9n+fSWtRx03SWOye+vfAsT4ubtxxwRwvSUalzU= X-Gm-Message-State: AOJu0YwWRcO2t/3DjokEtBxCl06j63pjyTlAoDix9g6pUSsS/Zb94mMl eGD0gax5JbsWtLdB2s2xTyn9nviEpi0oggwBQ3sZoBY0qz7mZMj4 X-Google-Smtp-Source: AGHT+IF4bGIOqG3W34z32lSukG6Ef5s1FlI9dkGFnxyKECa3N/yURT+cuvpIZ9OZEntCd4Ld2UdhcA== 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 MIME-Version: 1.0 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= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240525_062812_262585_3148A157 X-CRM114-Status: GOOD ( 12.80 ) 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 Reviewed-by: Krzysztof Kozlowski --- 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