From patchwork Sat May 25 13:28:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artur Weber X-Patchwork-Id: 13674015 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 BB676C25B7C for ; Sat, 25 May 2024 13:28:30 +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=1RO3TqXBhK28XdKCkKPBqIQRdf8JNVUCshGnOBmW2Vw=; b=SmIz6tGPgtkpYL 9tpd4xdXGaZ5Pv5NRmMrkZJiKqp7WlsbYpTq/NBSx4izL2/LqeztaGjqMfRgL/Xe/2bPGL62QuGaX GOn+m2TJUCcjR5TZEHmoBY5GNZs3L7XRW16he962vDLjrImQ0xzRyv1qiSXTYCtcZmAdq8uGZ5fHg VHpFuDQLRGHqcT3CAQYvaQPN2BQEsJH/S2gGn544TH6CDBduIPDFK9ebBVXEKWtj8jyBoOmZzCULx HzDAuPfUy92aJE/4V6+SgeU7tP3dA3UrLXIgUYbnDgj+pMzfdMc3VHq6ka67MKQFXgbrNZywiV8Ka zVgr34t5+YHGknpa2qKw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sArRW-0000000B47p-3WP4; Sat, 25 May 2024 13:28:14 +0000 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sArRT-0000000B467-3seV for linux-arm-kernel@lists.infradead.org; Sat, 25 May 2024 13:28:13 +0000 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-a5a5c930cf6so1377438566b.0 for ; Sat, 25 May 2024 06:28:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716643688; x=1717248488; 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=aMTEq8/81TXzUfHAT3yRUVR+6g/j7Gm/Znm9RLjIAhg=; b=hPA7rOCAEHlG5dwDYEBBCG3LblVV2m4TJxf5zDE33wDd+jPrY1YHSVzRnq/vyZAA4I WjP0+f4D9vPYj9tc3ElsMc83KHl2qNBCKMvA0jFynDrkOZxMU1kdO0I8WOAbq2Su1wNc UfhUIeTlsSaZi6srqwAcpb5y8fVQw3L/DHWbQyER3GnMm+DMH+6yd5fpoo34Opgk8c4m wJAyxdsL9nfJJPMObp7APdMR5rGQ8lti/yXkirAoxPOMAN/QkA/66U98iKL3wkhKo0MD 1CCaV0enhUwh9NxzCBp3cP5w5CgH0lXaYyG10w7xVtfAbDXAKYMDLvxwUqNsVqBkKloG d2Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716643688; x=1717248488; 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=aMTEq8/81TXzUfHAT3yRUVR+6g/j7Gm/Znm9RLjIAhg=; b=kzsQNdtvMJX216UWMKH704D7WSpX4x6OEOwYHF2vctxmOH/q/kDSJ0+cGAm20F4gF5 dNmxWVUK70gVjEFbjpfN4VhFZg587/9YkjLQKFPEANv030P8tYYmvVDnPzTGOUZ5TSL8 zuqF3aItBw0xV9hpFwbgC/jOaiuVr1DXSYNrdLjmu1jcLyrdJbQ02kWEBFCQszBsu4XJ SN2y1OEldExqkCaGMiwz2VD/pJGiaUk8ay39/RhmMmuVYCl+ySOE5NPjWcwmg/VNYjQ+ q/cOgt7/NLk92XDFULLBY/laitN2DxdviLLeOeP3/20dHzVcTv1mGNn98kwUciHpomsg rshA== X-Forwarded-Encrypted: i=1; AJvYcCW3d+idTaLfQgFSp9OYjVTzeBrZMwHRWvXboxUX9REcVswprcq61UQipL+/AS+cihnKsil/hzHkW6bKjhDivPYq5GW8ax6KA9qrwNdIPsnLOk1lkDM= X-Gm-Message-State: AOJu0Yzn3P5RZ36D5S4ggxnCGOeaxlG4VymqqKkZszMrXexotn629mKz SGxIoXOGlTJYxw0Imo2soid2XeQcIK5g/kKOhF7LVjLvQCU9a1b5 X-Google-Smtp-Source: AGHT+IFnN0alOg81y3ApkSMx/NppMuYvffZFNlVbN94bNUUJGBOlukHxGi7dQOIDZEZnNR+iOrPy4g== X-Received: by 2002:a17:906:e2d9:b0:a5a:c194:b53d with SMTP id a640c23a62f3a-a62645d6c0dmr338273766b.20.1716643687998; Sat, 25 May 2024 06:28:07 -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.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 May 2024 06:28:07 -0700 (PDT) From: Artur Weber Date: Sat, 25 May 2024 15:28:05 +0200 Subject: [PATCH v4 1/9] ASoC: dt-bindings: samsung,midas-audio: Add headset mic bias supply MIME-Version: 1.0 Message-Id: <20240525-midas-wm1811-gpio-jack-v4-1-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=1024; i=aweber.kernel@gmail.com; s=20231030; h=from:subject:message-id; bh=KcCxSAxMvDkXt904XYa6/SbZmduZSxVRxErNI/Om7zM=; b=a8ffLr0BQKc3Mzr1ZH8qlfYzy+cz2DGscrTaCLSE6p59apseaVUutkgI3r1MbdZ60rLEp+h4Q zzO93Snks1kAD9Ic+jkeVqx657Cohmx+VeeSF36c4iKWSsDOm9PaIBY 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_029188_C05791A6 X-CRM114-Status: GOOD ( 10.72 ) 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 devices use a separate mic bias supply (also referred to as "ear mic bias") to enable/disable the headset mic. Add the DT property headset-mic-bias-supply to allow for specifying this supply. Signed-off-by: Artur Weber Reviewed-by: Krzysztof Kozlowski --- Documentation/devicetree/bindings/sound/samsung,midas-audio.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/samsung,midas-audio.yaml b/Documentation/devicetree/bindings/sound/samsung,midas-audio.yaml index 6ec80f529d84..6ed53dd0bb53 100644 --- a/Documentation/devicetree/bindings/sound/samsung,midas-audio.yaml +++ b/Documentation/devicetree/bindings/sound/samsung,midas-audio.yaml @@ -53,6 +53,9 @@ properties: submic-bias-supply: description: Supply for the micbias on the Sub microphone + headset-mic-bias-supply: + description: Supply for the micbias on the Headset microphone + fm-sel-gpios: maxItems: 1 description: GPIO pin for FM selection 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 From patchwork Sat May 25 13:28:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artur Weber X-Patchwork-Id: 13674019 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 DFA9AC25B78 for ; Sat, 25 May 2024 13:28:38 +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=yh/Tr+OnOylBfVsMUqOI7jclNK+eTA9GQZkutnfvsgk=; b=Sc20eVf95psrg1 UH7DiqVY+R+z2gRTahC9tm0NHP3CfXSSKyPA06QmFy2uF6cZiiuHb+V2j5OZZa77f3J0VmAU6jmyS opmqCq/qMfOicOoSFWRX7zvRY941tcYZIUqWTI+bi9iqa/xCx8YRIuk7Ih9hfykgAXdmqaL532xGt yitSTRP/9KYr9CIwkgDH/6RIzdNiphIK5UlwiWBbbH/JAHtGr/baxX1SMVgOTcv9djNv0R6o8pcPU U7EmiGFKolwUODrmFa7JndI2OQelMUWMJ98hgkzdDw4rBq4mLVrN4dA6JuSXhNYdrpy2VPPcf13/Z d/49tyAeEIwfSRqEfXmg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sArRi-0000000B4Bn-1K7d; Sat, 25 May 2024 13:28:26 +0000 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sArRU-0000000B46H-3GDn for linux-arm-kernel@lists.infradead.org; Sat, 25 May 2024 13:28:14 +0000 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-a59a609dd3fso726166566b.0 for ; Sat, 25 May 2024 06:28:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716643691; x=1717248491; 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=cyhcJDHjI0opVSCgJiHt0Zs5JH59m1ORkw4OcBCxAuU=; b=ONYTh1mA+ilO1ZLnPorktUHq+/dAlKJO/2m1+2eO80RYYEVvys9MdQTQaPVU8bEnVa bx7Zp4RBZjiC2R0helhZRgmSBsLdU5qNpUJZPoJ9R4Yp3pcoDqpSa6ouIbD6/lh9wkth c8GvhbkeUFHvbjuIB/fPt3h6OHLlMuLWsBMuLkZmPsLdEBOiPyn8XQVQKmoMLnqfIlyO TWA/aEFm4Wj/irPEAnTLm5NBDCg0DpFgXiRr42YbAJIg7/I+Mqe13nvityJkIc4fjj+H QlmHUdOnZTg7OEz23j9s2DhgzOoMSRk/zSJhi0bEzWSrorX9tXoefw3ZL5c+hmr9VIy6 rvTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716643691; x=1717248491; 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=cyhcJDHjI0opVSCgJiHt0Zs5JH59m1ORkw4OcBCxAuU=; b=BMx7CVq9mIF67eKnq0UDkBsHVd5C94JsE6E/xfsJDLAZkATRs8HHs0vsYrRe5Bt5iH lNy5PnG5X7NsINnlAhDN0qJOcFr9ACLoSly9cX5XeAcZk/M4QvzjyWHy4QiclgaBm6Yv jBTbHvKnC/2sUbYKu83oOzi6eBnbthWpEjFE4j6JV+3R4Rnb0XRxUtu9JBI9vZM/zu2f w5xY3HgKM6BGX8LbCSa4MQ09kVh/UJ9bGWmAZJttuwLlydqAukPnJAlR/LhTDzdvQoEn /Rq60bv8wA8BBYWb3a9qM/b8fn83uCU9Xv7WNV60dBbZDphZhabUg9VofrVL9GwiayJB Wisw== X-Forwarded-Encrypted: i=1; AJvYcCWs/tdCGOJ/9B9z4eKm0jHBFeV/ZOjwiSa0p2GqJsXT11w5flRRDVse726+IVWtz6NJ17flSNqUA5bKrfOnJARV66Yx8RK24QBM+A9tKj0RSWSKOVo= X-Gm-Message-State: AOJu0YyqZ9ZFFn1pXvdLdbu2Ux32XSUHeYcZ+2ZxcBgKC1h4L2P/bnbH tx685auROHnNAa2k9loMpFx+o+H+r29YxJ0qbnIC147sm32Tvvj5bU/AMw== X-Google-Smtp-Source: AGHT+IEPpi36yJB2n9ipEwdR4D1zjMs1IzS01+2Vzze66vzbl5+wC4+jiyDQmWyXGxZdTp2Ak5ZhWA== X-Received: by 2002:a17:906:8443:b0:a61:7f85:e31c with SMTP id a640c23a62f3a-a6261f91a42mr367814466b.12.1716643690633; Sat, 25 May 2024 06:28:10 -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.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 May 2024 06:28:10 -0700 (PDT) From: Artur Weber Date: Sat, 25 May 2024 15:28:07 +0200 Subject: [PATCH v4 3/9] ASoC: samsung: midas_wm1811: Use SND_SOC_DAPM_REGULATOR_SUPPLY for bias regulators MIME-Version: 1.0 Message-Id: <20240525-midas-wm1811-gpio-jack-v4-3-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=4146; i=aweber.kernel@gmail.com; s=20231030; h=from:subject:message-id; bh=2vAqa2DIEcQwtApC4VQYYpht9ERjbrcStYfppA44U0Y=; b=aPD49g9qEDnvFgYpa5MvgqUaV0Ias6Acg1pgU8JR9ggAbockzhyIz4uoEhAXWApuS8Qs+03bm 7D7hw3nfGozDATDmsFZ8F3NJgXmuf/Xt38YOWi7jNvh2bMfPkTYpKDb 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_853684_1D3A0D8C X-CRM114-Status: GOOD ( 15.62 ) 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 Instead of using a custom function with the SND_SOC_DAPM_MIC widget, split out the main mic/sub mic bias regulators into a separate widget using SND_SOC_DAPM_REGULATOR_SUPPLY, and connect them via a routing. Signed-off-by: Artur Weber --- Changes in v4: - Added this commit --- sound/soc/samsung/midas_wm1811.c | 62 +++++++++------------------------------- 1 file changed, 13 insertions(+), 49 deletions(-) diff --git a/sound/soc/samsung/midas_wm1811.c b/sound/soc/samsung/midas_wm1811.c index f31244156ff6..20b274734487 100644 --- a/sound/soc/samsung/midas_wm1811.c +++ b/sound/soc/samsung/midas_wm1811.c @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include @@ -27,8 +26,6 @@ #define DEFAULT_FLL1_RATE 11289600U struct midas_priv { - struct regulator *reg_mic_bias; - struct regulator *reg_submic_bias; struct gpio_desc *gpio_fm_sel; struct gpio_desc *gpio_lineout_sel; unsigned int fll1_rate; @@ -169,38 +166,6 @@ static int midas_ext_spkmode(struct snd_soc_dapm_widget *w, return ret; } -static int midas_mic_bias(struct snd_soc_dapm_widget *w, - struct snd_kcontrol *kcontrol, int event) -{ - struct snd_soc_card *card = w->dapm->card; - struct midas_priv *priv = snd_soc_card_get_drvdata(card); - - switch (event) { - case SND_SOC_DAPM_PRE_PMU: - return regulator_enable(priv->reg_mic_bias); - case SND_SOC_DAPM_POST_PMD: - return regulator_disable(priv->reg_mic_bias); - } - - return 0; -} - -static int midas_submic_bias(struct snd_soc_dapm_widget *w, - struct snd_kcontrol *kcontrol, int event) -{ - struct snd_soc_card *card = w->dapm->card; - struct midas_priv *priv = snd_soc_card_get_drvdata(card); - - switch (event) { - case SND_SOC_DAPM_PRE_PMU: - return regulator_enable(priv->reg_submic_bias); - case SND_SOC_DAPM_POST_PMD: - return regulator_disable(priv->reg_submic_bias); - } - - return 0; -} - static int midas_fm_set(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event) { @@ -272,8 +237,17 @@ static const struct snd_soc_dapm_widget midas_dapm_widgets[] = { SND_SOC_DAPM_HP("Headphone", NULL), SND_SOC_DAPM_MIC("Headset Mic", NULL), - SND_SOC_DAPM_MIC("Main Mic", midas_mic_bias), - SND_SOC_DAPM_MIC("Sub Mic", midas_submic_bias), + SND_SOC_DAPM_MIC("Main Mic", NULL), + SND_SOC_DAPM_REGULATOR_SUPPLY("mic-bias", 0, 0), + SND_SOC_DAPM_MIC("Sub Mic", NULL), + SND_SOC_DAPM_REGULATOR_SUPPLY("submic-bias", 0, 0), +}; + +/* Default routing; supplemented by audio-routing DT property */ +static const struct snd_soc_dapm_route midas_dapm_routes[] = { + /* Bind microphones with their respective regulator supplies */ + {"Main Mic", NULL, "mic-bias"}, + {"Sub Mic", NULL, "submic-bias"}, }; static int midas_set_bias_level(struct snd_soc_card *card, @@ -421,6 +395,8 @@ static struct snd_soc_card midas_card = { .num_controls = ARRAY_SIZE(midas_controls), .dapm_widgets = midas_dapm_widgets, .num_dapm_widgets = ARRAY_SIZE(midas_dapm_widgets), + .dapm_routes = midas_dapm_routes, + .num_dapm_routes = ARRAY_SIZE(midas_dapm_routes), .set_bias_level = midas_set_bias_level, .late_probe = midas_late_probe, @@ -443,18 +419,6 @@ static int midas_probe(struct platform_device *pdev) snd_soc_card_set_drvdata(card, priv); card->dev = dev; - priv->reg_mic_bias = devm_regulator_get(dev, "mic-bias"); - if (IS_ERR(priv->reg_mic_bias)) { - dev_err(dev, "Failed to get mic bias regulator\n"); - return PTR_ERR(priv->reg_mic_bias); - } - - priv->reg_submic_bias = devm_regulator_get(dev, "submic-bias"); - if (IS_ERR(priv->reg_submic_bias)) { - dev_err(dev, "Failed to get submic bias regulator\n"); - return PTR_ERR(priv->reg_submic_bias); - } - priv->gpio_fm_sel = devm_gpiod_get_optional(dev, "fm-sel", GPIOD_OUT_HIGH); if (IS_ERR(priv->gpio_fm_sel)) { dev_err(dev, "Failed to get FM selection GPIO\n"); From patchwork Sat May 25 13:28:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artur Weber X-Patchwork-Id: 13674018 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 DA3E5C25B7C for ; Sat, 25 May 2024 13:28:37 +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=k534yk/+Ywbdfl0k6AWv1hY+ADg/0sBlaxdUv2GLu6I=; b=ea04rkVhzdU/yt tipdYpaBrw14zdzNgm341dM0BZ8cGISFUPE/3maCshBaIAn1tC6i6G8u8aiQyMgpAJxyq7dpx/8bN sX7wlMvMa+Ebj2jnEhbSp8XbNWqanm/2XevrO6x3E11PY4aS92rlc3GZemR2Y7Br4PQRMeA+259Ln g7ws9C5HMfvZN/g8QU5GqMWvjw7r6zEAi1aN1MK0/1nXe6KFaQHzDpzbb+eqBioes+LrveSB3bH69 pMqwzsL/xUB8S5vruKMYum27P2cRRWAR/+ohdoO5n6+fbDEioI9dXj70m/U/VcohFAnsSBWljD9G3 8OFU5xfK299wormaPO/g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sArRj-0000000B4Cn-2hq8; Sat, 25 May 2024 13:28:27 +0000 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sArRV-0000000B473-3Lq0 for linux-arm-kernel@lists.infradead.org; Sat, 25 May 2024 13:28:15 +0000 Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-5785f7347cdso1608597a12.0 for ; Sat, 25 May 2024 06:28:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716643692; x=1717248492; 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=BndYTHAhfTKZPUuhsQObxrH+e5h7zSrDvT6UBM9kSxU=; b=EQultOcyk1+zhyPa/LfGIhDos01OQTJdd89XVvfFpggBWQdVAbV6ubRPRLlVz5qoER PPVkwcaJXTkn6kMUTA+CeWotsT7wJdgQXZbAYxBsl9HT+3V5L5uDAKFd7ERKu4T4nT7M 2bT7lSXjiRm78atRDoBepzUFhEFY29Cci6wzQDCNgG7QreDHMVEhIsQldTNlrpmKBcfx yP3XExxqn0BjRRlwAOVNcBy59fxBEpXtlcXEMX0ZXTmj9JccdvnzI042cZS/EG/i1/ng ruKnvL+YycjIQFr1qewM5Jh9scHk1h18QIVP9R5QT/kg6fLJ9/S4nZRw0pKfbPEZOC4b k1bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716643692; x=1717248492; 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=BndYTHAhfTKZPUuhsQObxrH+e5h7zSrDvT6UBM9kSxU=; b=GfBr74Klaq5LiVX/tpsIj64Qp9lu987ro2LS4YNawXBwbsD2wlUK1T4YUQS3pDa/a+ 49NQ2w1HBWaG9r0l9upKcZF9HYtCKImtYPTWRmIHehWLQh4EQgAXFylRy/okUFU3qtOc qzplRC7iTOH8Tt/lH+hwRSsIuX1FeNON+sZlYXKVzur3uy8stG7i3MCZTRV9TeO4pseZ /rA1K0RIxKjVdf/Y/Ld/tE4LQAg1xw9KmLgYphN7BECQoeUHH4qS7F3bo4P17YlQ/qee SOGAiBZchSJ0BsMdcODVUFE08Ak6YDxPYzVZr1h3MA/FUh2GbaZGCrHTR7IVWbh6FwwL 2mDg== X-Forwarded-Encrypted: i=1; AJvYcCUnSKTjN3tjv56QBJiaokmy1yUVRNVdt8+pvb/nRTf7CMF5bzwwMGVdyM+AYHX5/yl5z16hBiv6AN6g3WL9svRpYX2HSkRwnCQlwwY2YqY/zVdIJ2k= X-Gm-Message-State: AOJu0Yx7FlJamdlMcIbI1KYChJR2K5nD2dHJ9AwRw2fZkiDDSiJGLXls 1b/Tgx95ZzKNUCrfD/1FnQwere7uOTfiLDTqZql0AxUvqGN1v0zW X-Google-Smtp-Source: AGHT+IGnZd7WsivKWQF4T7VRJoyzWWWhjF8m2C3S/hvrEcSGj7gVML/vaSsvg/m9ubAfv5dSHplv5A== X-Received: by 2002:a17:906:34c4:b0:a5d:1079:ae43 with SMTP id a640c23a62f3a-a62646cff2bmr303714966b.46.1716643691879; Sat, 25 May 2024 06:28:11 -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.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 May 2024 06:28:11 -0700 (PDT) From: Artur Weber Date: Sat, 25 May 2024 15:28:08 +0200 Subject: [PATCH v4 4/9] ASoC: samsung: midas_wm1811: Add headset mic bias supply support MIME-Version: 1.0 Message-Id: <20240525-midas-wm1811-gpio-jack-v4-4-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=1496; i=aweber.kernel@gmail.com; s=20231030; h=from:subject:message-id; bh=SrwrcA8EO/kpCKyL39XjnsPTrNdBE58a73YIeAazdTE=; b=aOb+rU2suanKpvf9j7yJWCC8tRfhD79vM2VGE9vwAf3aAdab1HBw88AGPfMZzkzES4TSFtHuM 6DZtzJEPYveCOX4cpcoNbmRXsBVqaoVegYq+563CTSs9fB2kR85Cl6t 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_062813_935535_1C9732B0 X-CRM114-Status: GOOD ( 12.09 ) 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 devices use a headset mic bias supply (sometimes referred to as "ear mic bias") to enable/disable the headset mic. Add a REGULATOR_SUPPLY widget for this supply which gets the headset- mic-bias supply and is routed to the Headset Mic switch similar to how it's done for the other mic bias regulators. Signed-off-by: Artur Weber --- Changes in v4: - Completely changed to adapt to SND_SOC_DAPM_REGULATOR_SUPPLY switch Changes in v2: - Added this commit --- sound/soc/samsung/midas_wm1811.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/soc/samsung/midas_wm1811.c b/sound/soc/samsung/midas_wm1811.c index 20b274734487..96cec8e9de98 100644 --- a/sound/soc/samsung/midas_wm1811.c +++ b/sound/soc/samsung/midas_wm1811.c @@ -237,6 +237,7 @@ static const struct snd_soc_dapm_widget midas_dapm_widgets[] = { SND_SOC_DAPM_HP("Headphone", NULL), SND_SOC_DAPM_MIC("Headset Mic", NULL), + SND_SOC_DAPM_REGULATOR_SUPPLY("headset-mic-bias", 0, 0), SND_SOC_DAPM_MIC("Main Mic", NULL), SND_SOC_DAPM_REGULATOR_SUPPLY("mic-bias", 0, 0), SND_SOC_DAPM_MIC("Sub Mic", NULL), @@ -248,6 +249,7 @@ static const struct snd_soc_dapm_route midas_dapm_routes[] = { /* Bind microphones with their respective regulator supplies */ {"Main Mic", NULL, "mic-bias"}, {"Sub Mic", NULL, "submic-bias"}, + {"Headset Mic", NULL, "headset-mic-bias"}, }; static int midas_set_bias_level(struct snd_soc_card *card, From patchwork Sat May 25 13:28:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Artur Weber X-Patchwork-Id: 13674021 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 E21D5C25B78 for ; Sat, 25 May 2024 13:28:41 +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=daJjq8By7NGWblEs9irfCCDtVOMxphfDiAGBYP6FUlE=; b=l6cb0g5SY3+71+ H/x00lWhlzsx1OrYmqY6xSEyjD59YXCmsSn/6EYYM/+HjS7Cgu+R8tgQZEAWS1GBDeWmqmv5XMmm8 IEHKs55ktlR3KU80gbjwl1r7luYZzVjAGlSTy2nnT+6Z+H11mDXVYhSwtkiQnIjVuDRsQFObi+hzE 4xKwRYQYF5s2SoI+4J8+L5Dt8UqmAN1Ui7pMQi9OZuBFXFlAuXV1Qs/iSPBzoD+kcFaEMV0AzCaRE 09iCb6sYNjHyVnd75I6p4Tuu9UlvOAdrcVLHIMRJyIY+vL2oVRDWyOptxI1JuEdOdFvQKcqMV8VCK tpfcaUxWU+IxohZ/oGow==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sArRk-0000000B4Dm-3i6U; Sat, 25 May 2024 13:28:28 +0000 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sArRW-0000000B47a-2Fun for linux-arm-kernel@lists.infradead.org; Sat, 25 May 2024 13:28:16 +0000 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-a621cb07d8fso529086666b.2 for ; Sat, 25 May 2024 06:28:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716643693; x=1717248493; 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=TfSzPmCK68b0JNLz1J5pRMBlqdzsamJqc1HopdzeGIc=; b=EDN9BFfp2quK5w+du3VPiI720GaVNmrvaJhSjtkS+lqQ9PKL7aLh8VZ5kw/FcSdu4g EqUKqsbR52YKhfnrWvx/36n2vwWIMjLVi1ZFkhB3nUpOBmtZWo2RJ5oPnUtu3oQj8hcx 1nRZj+4Xv2jR1NDvickG8DT7JrzAjEHpIDeZENdekT11G2XxBisq+jKwdoCSF9dsG34Z rtlN1BHrvSXSlXDP30oy+6IDPxPVlqj87ztJbx59LXKH4zjUeUeSnEIkMEu/moyiRdAm oC9BxTsLX1WIn99oJS/OjLZcBQBq+luV5DV9LRaY1N6as4RkEAtZA4Ot8xzU7o7tOLQ2 isbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716643693; x=1717248493; 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=TfSzPmCK68b0JNLz1J5pRMBlqdzsamJqc1HopdzeGIc=; b=ulascwPcak9K5MAHGdnl2ir8+bbhnVBgeAq4oq8JddrrTQnCBBDYDYiylLZG16SfaU dRmNX3QCizAT5qD4faKC1C+uaDueDIOALrdlUCKBDjQlanvI9gnIxDrXUcrmENwgPRmd Qfq1M3CJ4djL8a4U6245ZYVIufazNU4B7fkmXj2NkqJljXSpzFhi0Gb+Qg5Sn8srymWM GkahId0o38uFA+GLogUsEclBdmj1kOcEQFkF06XZz0SDFe7oYsczsfcK9sVfY84haZic cxi3u+LktLmWbmldqIqx8pB/EpZgpzEzj/NT331wxM3Vr9153SVtLy6bIekY3F2icqY1 9BWA== X-Forwarded-Encrypted: i=1; AJvYcCWtsCaud4wC1vaLheaCx4W7P7+rF8MFOwJC9lOnZpVSw1M8CEu5Fssw2u8g98kbv7MIMcGjkfFZpyvpL/3kQ5hKlCVgR9cJRkdPgPQI2wPouuiAr1A= X-Gm-Message-State: AOJu0YwzvNBGcc+YH6VTYMwHXPXMabnFPjKO6eZ4hQCBHLiJhtkGI47K pR8cWUQHb0Bz07LhKk/BvsI+r+dUgoHEFhLAejuH/hj0d1FTg2u+ X-Google-Smtp-Source: AGHT+IFTulOMAAWAFYVawyA9CX1rwCDs913hmmjoXg2cqQVwzwHIm+Ktr45CM5qcWPO00OeYHrq0RQ== X-Received: by 2002:a17:907:170c:b0:a59:efd3:9d with SMTP id a640c23a62f3a-a628cd3826amr199259066b.58.1716643693213; Sat, 25 May 2024 06:28:13 -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.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 May 2024 06:28:12 -0700 (PDT) From: Artur Weber Date: Sat, 25 May 2024 15:28:09 +0200 Subject: [PATCH v4 5/9] ASoC: samsung: midas_wm1811: Add GPIO-based headset jack detection MIME-Version: 1.0 Message-Id: <20240525-midas-wm1811-gpio-jack-v4-5-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=11849; i=aweber.kernel@gmail.com; s=20231030; h=from:subject:message-id; bh=s6HoX2bIiyeFHVO8H4gwhbEs3zH4TzKxdBruCqDrxxM=; b=zR0eYWuT/ZjNmLwhSpdGpDL+Qf5ZIm9sfaJ+OWv+1VFmeFS6SxTlvW8SFabYIV3KHjdVH9jF+ pUJzZzuHu9oDpBEsXjSXMllbtpEGW7gnFGwPb3pD8yDxxTFScTCH0Sr 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_062814_773722_7750B4E7 X-CRM114-Status: GOOD ( 34.56 ) 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 use the midas_wm1811 driver use a GPIO-based method for detecting whether the headset jack is plugged in, as well as detecting which headset buttons are pressed. There are two GPIOs: a "headset detect" GPIO responsible for detecting jack insertion, and a "headset key" GPIO which triggers when a button on the headset is pressed. The plug type and the button pressed are determined based on information from an ADC channel. The headset mic is enabled by a headset mic bias regulator. Add support for the GPIO-based headset jack detection mechanism, and make it configurable from the device tree. This implementation borrows somewhat from the aries_wm8994.c driver, though there are a few changes to make the code cleaner, and to add support for DT-based configuration. Notably, a dependency on IIO is introduced, to accommodate the ADC reading requirement. Signed-off-by: Artur Weber --- Changes in v4: - Adapted to regulators being changed to use SND_SOC_DAPM_REGULATOR_SUPPLY Changes in v2: - Added separate headset mic bias regulator - Added samsung preset to threshold properties - Replaced dev_err+return with return dev_err_probe where needed --- sound/soc/samsung/Kconfig | 2 +- sound/soc/samsung/midas_wm1811.c | 272 +++++++++++++++++++++++++++++++++++++-- 2 files changed, 263 insertions(+), 11 deletions(-) diff --git a/sound/soc/samsung/Kconfig b/sound/soc/samsung/Kconfig index 93c2b1b08d0a..4b1ea7b2c796 100644 --- a/sound/soc/samsung/Kconfig +++ b/sound/soc/samsung/Kconfig @@ -140,7 +140,7 @@ config SND_SOC_SAMSUNG_ARIES_WM8994 config SND_SOC_SAMSUNG_MIDAS_WM1811 tristate "SoC I2S Audio support for Midas boards" - depends on SND_SOC_SAMSUNG + depends on SND_SOC_SAMSUNG && IIO select SND_SAMSUNG_I2S select SND_SOC_WM8994 help diff --git a/sound/soc/samsung/midas_wm1811.c b/sound/soc/samsung/midas_wm1811.c index 96cec8e9de98..88fa9e5bc093 100644 --- a/sound/soc/samsung/midas_wm1811.c +++ b/sound/soc/samsung/midas_wm1811.c @@ -7,7 +7,9 @@ #include #include +#include #include +#include #include #include #include @@ -28,6 +30,9 @@ struct midas_priv { struct gpio_desc *gpio_fm_sel; struct gpio_desc *gpio_lineout_sel; + struct gpio_desc *gpio_headset_detect; + struct gpio_desc *gpio_headset_key; + struct iio_channel *adc_headset_detect; unsigned int fll1_rate; struct snd_soc_jack headset_jack; @@ -44,6 +49,117 @@ static struct snd_soc_jack_pin headset_jack_pins[] = { }, }; +/* + * min_mv/max_mv values in this struct are set up based on DT values. + */ +static struct snd_soc_jack_zone headset_jack_zones[] = { + { .jack_type = SND_JACK_HEADPHONE, }, + { .jack_type = SND_JACK_HEADSET, }, + { .jack_type = SND_JACK_HEADPHONE, }, +}; + +/* + * This is used for manual detection in headset_key_check, we reuse the + * structure since it's convenient. + * + * min_mv/max_mv values in this struct are set up based on DT values. + */ +static struct snd_soc_jack_zone headset_key_zones[] = { + { .jack_type = SND_JACK_BTN_0, }, /* Media */ + { .jack_type = SND_JACK_BTN_1, }, /* Volume Up */ + { .jack_type = SND_JACK_BTN_2, }, /* Volume Down */ +}; + +static int headset_jack_check(void *data) +{ + struct snd_soc_component *codec = data; + struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(codec); + struct midas_priv *priv = snd_soc_card_get_drvdata(codec->card); + int adc, ret; + int jack_type = 0; + + if (!gpiod_get_value_cansleep(priv->gpio_headset_detect)) + return 0; + + /* Enable headset mic bias regulator so that the ADC reading works */ + ret = snd_soc_dapm_force_enable_pin(dapm, "headset-mic-bias"); + if (ret < 0) { + pr_err("%s: Failed to enable headset mic bias regulator (%d), assuming headphones\n", + __func__, ret); + return SND_JACK_HEADPHONE; + } + snd_soc_dapm_sync(dapm); + + /* Sleep for a small amount of time to get the value to stabilize */ + msleep(20); + + ret = iio_read_channel_processed(priv->adc_headset_detect, &adc); + if (ret) { + pr_err("%s: Failed to read ADC (%d), assuming headphones\n", + __func__, ret); + jack_type = SND_JACK_HEADPHONE; + goto out; + } + pr_debug("%s: ADC value is %d\n", __func__, adc); + + jack_type = snd_soc_jack_get_type(&priv->headset_jack, adc); + +out: + ret = snd_soc_dapm_disable_pin(dapm, "headset-mic-bias"); + if (ret < 0) + pr_err("%s: Failed to disable headset mic bias regulator (%d)\n", + __func__, ret); + snd_soc_dapm_sync(dapm); + + return jack_type; +} + +static int headset_key_check(void *data) +{ + struct snd_soc_component *codec = data; + struct midas_priv *priv = snd_soc_card_get_drvdata(codec->card); + int adc, i, ret; + + if (!gpiod_get_value_cansleep(priv->gpio_headset_key)) + return 0; + + /* Filter out keypresses when 4 pole jack not detected */ + if (!(priv->headset_jack.status & SND_JACK_MICROPHONE)) + return 0; + + ret = iio_read_channel_processed(priv->adc_headset_detect, &adc); + if (ret) { + pr_err("%s: Failed to read ADC (%d), can't detect key type\n", + __func__, ret); + return 0; + } + pr_debug("%s: ADC value is %d\n", __func__, adc); + + for (i = 0; i < ARRAY_SIZE(headset_key_zones); i++) { + if (adc >= headset_key_zones[i].min_mv && + adc <= headset_key_zones[i].max_mv) { + return headset_key_zones[i].jack_type; + } + } + + return 0; +} + +static struct snd_soc_jack_gpio headset_gpio[] = { + { + .name = "Headset Jack", + .report = SND_JACK_HEADSET, + .debounce_time = 150, + .jack_status_check = headset_jack_check, + }, + { + .name = "Headset Key", + .report = SND_JACK_BTN_0 | SND_JACK_BTN_1 | SND_JACK_BTN_2, + .debounce_time = 30, + .jack_status_check = headset_key_check, + }, +}; + static int midas_start_fll1(struct snd_soc_pcm_runtime *rtd, unsigned int rate) { struct snd_soc_card *card = rtd->card; @@ -291,18 +407,67 @@ static int midas_late_probe(struct snd_soc_card *card) return ret; } - ret = snd_soc_card_jack_new_pins(card, "Headset", - SND_JACK_HEADSET | SND_JACK_MECHANICAL | - SND_JACK_BTN_0 | SND_JACK_BTN_1 | SND_JACK_BTN_2 | - SND_JACK_BTN_3 | SND_JACK_BTN_4 | SND_JACK_BTN_5, - &priv->headset_jack, - headset_jack_pins, - ARRAY_SIZE(headset_jack_pins)); - if (ret) + if (!priv->gpio_headset_detect) { + ret = snd_soc_card_jack_new_pins(card, "Headset", + SND_JACK_HEADSET | SND_JACK_MECHANICAL | + SND_JACK_BTN_0 | SND_JACK_BTN_1 | + SND_JACK_BTN_2 | SND_JACK_BTN_3 | + SND_JACK_BTN_4 | SND_JACK_BTN_5, + &priv->headset_jack, + headset_jack_pins, + ARRAY_SIZE(headset_jack_pins)); + if (ret) + return ret; + + wm8958_mic_detect(aif1_dai->component, &priv->headset_jack, + NULL, NULL, NULL, NULL); + } else { + /* Some devices (n8000, t310) use a GPIO to detect the jack. */ + ret = snd_soc_card_jack_new_pins(card, "Headset", + SND_JACK_HEADSET | SND_JACK_BTN_0 | + SND_JACK_BTN_1 | SND_JACK_BTN_2, + &priv->headset_jack, + headset_jack_pins, + ARRAY_SIZE(headset_jack_pins)); + if (ret) { + dev_err(card->dev, + "Failed to set up headset pins: %d\n", ret); + return ret; + } + + ret = snd_soc_jack_add_zones(&priv->headset_jack, + ARRAY_SIZE(headset_jack_zones), + headset_jack_zones); + if (ret) { + dev_err(card->dev, + "Failed to set up headset zones: %d\n", ret); + return ret; + } + + headset_gpio[0].data = aif1_dai->component; + headset_gpio[0].desc = priv->gpio_headset_detect; + + headset_gpio[1].data = aif1_dai->component; + headset_gpio[1].desc = priv->gpio_headset_key; + + snd_jack_set_key(priv->headset_jack.jack, + SND_JACK_BTN_0, KEY_MEDIA); + snd_jack_set_key(priv->headset_jack.jack, + SND_JACK_BTN_1, KEY_VOLUMEUP); + snd_jack_set_key(priv->headset_jack.jack, + SND_JACK_BTN_2, KEY_VOLUMEDOWN); + + ret = snd_soc_jack_add_gpios(&priv->headset_jack, + ARRAY_SIZE(headset_gpio), + headset_gpio); + if (ret) + dev_err(card->dev, + "Failed to set up headset jack GPIOs: %d\n", + ret); + return ret; + } - wm8958_mic_detect(aif1_dai->component, &priv->headset_jack, - NULL, NULL, NULL, NULL); return 0; } @@ -411,6 +576,9 @@ static int midas_probe(struct platform_device *pdev) struct snd_soc_card *card = &midas_card; struct device *dev = &pdev->dev; static struct snd_soc_dai_link *dai_link; + enum iio_chan_type channel_type; + u32 fourpole_threshold[2]; + u32 button_threshold[3]; struct midas_priv *priv; int ret, i; @@ -434,6 +602,90 @@ static int midas_probe(struct platform_device *pdev) return PTR_ERR(priv->gpio_lineout_sel); } + priv->gpio_headset_detect = devm_gpiod_get_optional(dev, + "headset-detect", GPIOD_IN); + if (IS_ERR(priv->gpio_headset_detect)) + return dev_err_probe(dev, PTR_ERR(priv->gpio_headset_detect), + "Failed to get headset jack detect GPIO\n"); + + if (priv->gpio_headset_detect) { + priv->adc_headset_detect = devm_iio_channel_get(dev, + "headset-detect"); + if (IS_ERR(priv->adc_headset_detect)) + return dev_err_probe(dev, + PTR_ERR(priv->adc_headset_detect), + "Failed to get ADC channel\n"); + + ret = iio_get_channel_type(priv->adc_headset_detect, + &channel_type); + if (ret) { + dev_err(dev, "Failed to get ADC channel type\n"); + return ret; + } + + if (channel_type != IIO_VOLTAGE) { + dev_err(dev, "ADC channel is not voltage\n"); + return ret; + } + + priv->gpio_headset_key = devm_gpiod_get(dev, "headset-key", + GPIOD_IN); + if (IS_ERR(priv->gpio_headset_key)) + return dev_err_probe(dev, + PTR_ERR(priv->gpio_headset_key), + "Failed to get headset key GPIO\n"); + + ret = of_property_read_u32_array(dev->of_node, + "samsung,headset-4pole-threshold-microvolt", + fourpole_threshold, + ARRAY_SIZE(fourpole_threshold)); + if (ret) { + dev_err(dev, "Failed to get 4-pole jack detection threshold\n"); + return ret; + } + + if (fourpole_threshold[0] > fourpole_threshold[1]) { + dev_err(dev, "Invalid 4-pole jack detection threshold value\n"); + return -EINVAL; + } + + headset_jack_zones[0].max_mv = (fourpole_threshold[0]); + headset_jack_zones[1].min_mv = (fourpole_threshold[0] + 1); + + headset_jack_zones[1].max_mv = (fourpole_threshold[1]); + headset_jack_zones[2].min_mv = (fourpole_threshold[1] + 1); + + ret = of_property_read_u32_array(dev->of_node, + "samsung,headset-button-threshold-microvolt", + button_threshold, + ARRAY_SIZE(button_threshold)); + if (ret) { + dev_err(dev, "Failed to get headset button detection threshold\n"); + return ret; + } + + if (button_threshold[0] > button_threshold[1] || + button_threshold[1] > button_threshold[2]) { + dev_err(dev, "Invalid headset button detection threshold value\n"); + return -EINVAL; + } + + for (i = 0; i < 3; i++) { + if (i != 0 && button_threshold[i] <= 0) { + dev_err(dev, "Invalid headset button detection threshold value\n"); + return -EINVAL; + } + + headset_key_zones[i].min_mv = button_threshold[i]; + + if (i == 2) + headset_key_zones[i].max_mv = UINT_MAX; + else + headset_key_zones[i].max_mv = \ + (button_threshold[i+1] - 1); + } + } + ret = snd_soc_of_parse_card_name(card, "model"); if (ret < 0) { dev_err(dev, "Card name is not specified\n"); From patchwork Sat May 25 13:28:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artur Weber X-Patchwork-Id: 13674020 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 82B0EC25B7D for ; Sat, 25 May 2024 13:28:39 +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=KjtjEI/RTwlAuyI8mrsTZJQ39Ni+40WrFydcDPtAfHw=; b=4/uljOCPOfFUxj D/gGvRf14lafptg76yG/m5t5TFwSKPAuL90X6lmiJHakKuWuIRmyjEMJWQpcVMmEATQ5XMvthOfjT xc6QaFNF2gZZ9JMHMxUWhOZtfqBLAEJ5UIDDZ6tnOY08NhFpqeKniMbtuq0GH2KWE48Lmm6CEVLGw SfpbX5n9vUFwgXmBUWxSBbSZWIr5ftJN2ChSqBNYvdh02o58114kqz0kyUqCjK1ftRq9UX+UKiqJk J2dzpAHNKKcNqGfeXL6Z89g4nsPQnG7Dl6+yNojosPGdh1w2vERtK7B6q9LE2K8ZoDBoT75/P1aJw z7FaoLPPLg5J7IBo60wg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sArRl-0000000B4Ea-3Fgh; Sat, 25 May 2024 13:28:29 +0000 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sArRY-0000000B48K-2FzY for linux-arm-kernel@lists.infradead.org; Sat, 25 May 2024 13:28:18 +0000 Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-5755fafa5a7so9240558a12.1 for ; Sat, 25 May 2024 06:28:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716643695; x=1717248495; 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=aYm1aEjf0Zap75LycmMoJDPmBXZE+yZRaT5MJKObyzU=; b=T2kqHxC9ezURjnmiZYi/yw81oqXXQdD46ewNrUcgTXv9OEHwz+FgF20oRmA6ikYMtO y61kE8t+UKw0/jKjbC8rlsGHcdl1FVGDJqkkbXP1LgGNj4afendDYIpNsCSBCNOT1rwT u3MfssyJzqFTOf3kNOmfUd+DbpvlddUJ3x5mpfUhz3IT5cvedIktwzugY7yNitcWk1Rt fa1pbt3ZutdsblqKy/ne9TnOron84b83wwUl+puFWf+MLDJPWzxYARRLH7KKbz/PjUIO IImItgi/DXYEzPjQec2qeEQdH2TY5A4qGDowH3Ej+9zOGTheIOafZx2qlfKV/J0a4ToJ L67Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716643695; x=1717248495; 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=aYm1aEjf0Zap75LycmMoJDPmBXZE+yZRaT5MJKObyzU=; b=cBbs5HIvMMW+/RQJcYdduSlny8Xj3hsA6i4csW/XKnv/tGgY1lg0IHmOySTDyTiiDJ WWWJuWmRlBFbG9tBViauYKj7yisGeyct4+eDx+6dZHAU913yPZiDyNsXplDUjcJloHtD RI+mvsKC7P+pYCol3hJad6gcuQh7wZJHm7I1bGMchJGWfMsA4hwl8ieathj1P4QrLJO1 aOkQ3bNBM07K+qRLKLZDv71Mmb5hvVyJVSNKMfveSJbuMjMDCMeXJlfUlTR91VK2NRd9 RjmvKYJ9jP2kfDINSO5FsB58e0hhoLjgBnnrWHdCTU27IaoHh04UjFwWQqEi8JLB9805 pInA== X-Forwarded-Encrypted: i=1; AJvYcCVORG7+DTMqS85jCOoYTagMX0CZXDjl0GAO0seZPLUwTzwZZ1GQSS0GTCLNURPCEVlDx2MCouinEi9jsJxTJQyoGvgctwmCQVDeVD4oGHiUxySBj1o= X-Gm-Message-State: AOJu0YzSpKh931NmfIu3i9xQcGZNOInT8gOo0n62zSYI0C3q0EYxM42o NyFL9qCtG/pi3Td+3NCainXdLHjXNVf7rnFwD02/gwmCZ7SrD0EW748Gaw== X-Google-Smtp-Source: AGHT+IHdx/tw9IhnGg8vGuaesdmmsPdkFnOGx7QFZnPi31e5dF3k4vigUZYqt0/oZwQjTd+tJOtmbQ== X-Received: by 2002:a17:906:1117:b0:a55:a895:46ae with SMTP id a640c23a62f3a-a6265259847mr314823766b.63.1716643694468; Sat, 25 May 2024 06:28:14 -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.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 May 2024 06:28:14 -0700 (PDT) From: Artur Weber Date: Sat, 25 May 2024 15:28:10 +0200 Subject: [PATCH v4 6/9] ASoC: samsung: midas_wm1811: Use dev_err_probe where appropriate MIME-Version: 1.0 Message-Id: <20240525-midas-wm1811-gpio-jack-v4-6-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=1631; i=aweber.kernel@gmail.com; s=20231030; h=from:subject:message-id; bh=7q1elFo7CAxZkZBweHbgmjBT8X4yHLYsePVZJR8HO/Y=; b=awYAMRq5ulLIglF1H1Y0PzqOS1+tuiQldsorqr7g2v3Tj2K+KBY61oddW8/uQHpyx94/xqJYL nI8BlGptFftDtpMEsYUXRbgdBe19G8yVyT0v6GPBo4T6+cC5eZMmRmk 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_062816_694623_33571DA4 X-CRM114-Status: GOOD ( 13.67 ) 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 Since we're already using it in the newly-added GPIO requests for jack detection, extend it to the previous checks as well. Signed-off-by: Artur Weber --- Changes in v4: - Adapted to regulator get functions being dropped in favor of SND_SOC_DAPM_REGULATOR_SUPPLY Changes in v2: - Added this commit --- sound/soc/samsung/midas_wm1811.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/sound/soc/samsung/midas_wm1811.c b/sound/soc/samsung/midas_wm1811.c index 88fa9e5bc093..ad0283364081 100644 --- a/sound/soc/samsung/midas_wm1811.c +++ b/sound/soc/samsung/midas_wm1811.c @@ -590,17 +590,15 @@ static int midas_probe(struct platform_device *pdev) card->dev = dev; priv->gpio_fm_sel = devm_gpiod_get_optional(dev, "fm-sel", GPIOD_OUT_HIGH); - if (IS_ERR(priv->gpio_fm_sel)) { - dev_err(dev, "Failed to get FM selection GPIO\n"); - return PTR_ERR(priv->gpio_fm_sel); - } + if (IS_ERR(priv->gpio_fm_sel)) + return dev_err_probe(dev, PTR_ERR(priv->gpio_fm_sel), + "Failed to get FM selection GPIO\n"); priv->gpio_lineout_sel = devm_gpiod_get_optional(dev, "lineout-sel", GPIOD_OUT_HIGH); - if (IS_ERR(priv->gpio_lineout_sel)) { - dev_err(dev, "Failed to get line out selection GPIO\n"); - return PTR_ERR(priv->gpio_lineout_sel); - } + if (IS_ERR(priv->gpio_lineout_sel)) + return dev_err_probe(dev, PTR_ERR(priv->gpio_lineout_sel), + "Failed to get line out selection GPIO\n"); priv->gpio_headset_detect = devm_gpiod_get_optional(dev, "headset-detect", GPIOD_IN); From patchwork Sat May 25 13:28:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artur Weber X-Patchwork-Id: 13674023 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 442E5C25B78 for ; Sat, 25 May 2024 13:28:45 +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=5AmEZeuAvdVFHN3ZsOJiRu6BkzRxOR3JDAUxXg4dhbU=; b=xSw02q+TXuVFfP QyUUqvXyBpxe6MHiHX0vZuzwyGiJK/JexqE4ijntl3WO5nAb/GguUqYaHSoQfLvq3ul9aQ2RoPmUF +7eXPs9bE7eKol2DFlL8INXBCQQqzaoaFn5w6xXI9cMUd7UvyDlbI6iydeu33424UL0QoF+Td4jRr flF1RfZVWHFEmMA5rCij9U4zcEOQGWq81D+8ZgxyAzgCgQXwv+IIy3t6wOwqfwhhkF1wggb+lOz6b 5dS97bLOEWxYRsdz4yL4mwlMgZiFLOQ62j+aBCbehNXsVho9GE6zrqpeU9gFAzcyvezUio2gTASI6 i6Hd17+bH+fWPfNIpUZw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sArRn-0000000B4G5-1kIg; Sat, 25 May 2024 13:28:31 +0000 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sArRZ-0000000B48W-0O7a for linux-arm-kernel@lists.infradead.org; Sat, 25 May 2024 13:28:19 +0000 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-a6265d3c488so233236466b.0 for ; Sat, 25 May 2024 06:28:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716643696; x=1717248496; 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=cUjZKrfisu2MIRRIzFKLBIKTAToYLPq2V2E0DmuWK3M=; b=MSTgPCdOB1iltQmfrwdQ8MGlE8QE2y3MJ5FpTyr17F0xVfoyskVFwPtvljDfGabcRj SEdoJXgHN9pJI2T9e8znIz+nhvmHThwrv4QWVfRmth3NzSbS/FULKMj6TuMg34UT5BW0 4FawUuCUC1envl/X5L4yHzXrNyFA0yUAcPcAOH95FYF/bK3bcJAoJPTuu5G7g9wa2zyu TPprxt6qRonQJ7SDMs9HixbvliXTZ0WMOtJX2aovCj8wUJ3/E9SavSrdjCUVYdmtJgi3 0rBRD5RQrisA3u4rNTgh6Gsy+82aBOT6t2q4/evpCU0gbl8322K2xkSDNXeEu5nRK6Dr ZvkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716643696; x=1717248496; 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=cUjZKrfisu2MIRRIzFKLBIKTAToYLPq2V2E0DmuWK3M=; b=RbWiNH9gaW4rqdruRVH2uSAnx4kysLufrkBA36S+4d3qjZOD2MOy6hvA6E91x4F/lW Qg3m2TTTXvzHdllmcFinzUQf/3nztU5O8GxGCjKzbPHap/b6StXmy1xOJCkceQWKSFUE Ge5xPnsy0PYADfjT2JHjdQs1ja0/uuraBX2dD3vMGA6tamuxyvcYQnD/aaPUT9DKZpQv WFrSUueKlb0DLsmop99D57FrQvmzRsmuGzHmrGFvjpC7sNmef0oQeX7i+p6E1gmh3nZF Bj6QWq4OQpzQkjLcmr4OGDRHbrBjcZtrdTYTxzBI7T7U3sm2Nh7j9MC8CnLwO8p/U2ZK dLMg== X-Forwarded-Encrypted: i=1; AJvYcCVG/3z7FgZutVYy4MZG2Kr510jltdMpOyRu3em/dMrS1jHDMw3Fsv3v0jJEYGcpMZBsMA4QYSjX0ppWCS8KYth+glaTX2tdrWvgm3Q1W07pqrGmquk= X-Gm-Message-State: AOJu0YxpH1MaiU6DmW1dCDjH0Mj4GKRf0Perq5Be5UHUQqU6pRSngn1C ERpZy5pqwdccrvmrfkJsCBHh0xRcskaV/Q57xB/Nbrz91nyyOc1v X-Google-Smtp-Source: AGHT+IHecgBLLiR2XNqDGoawDWaRaibToLWBukY8GFmV6rY0WCbDFPgUt5GIcLfdOSKMc8LBeMskbw== X-Received: by 2002:a17:907:9048:b0:a5a:5bc8:9fcd with SMTP id a640c23a62f3a-a62646d573amr341067966b.43.1716643695688; Sat, 25 May 2024 06:28:15 -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.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 May 2024 06:28:15 -0700 (PDT) From: Artur Weber Date: Sat, 25 May 2024 15:28:11 +0200 Subject: [PATCH v4 7/9] ARM: dts: samsung: exynos4212-tab3: Fix headset mic, add jack detection MIME-Version: 1.0 Message-Id: <20240525-midas-wm1811-gpio-jack-v4-7-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=1934; i=aweber.kernel@gmail.com; s=20231030; h=from:subject:message-id; bh=hH25eTCdZC3BJgBa3AD+9InewcsW9rj0sd8f9BvAVfs=; b=8suLwt6PYYGht/gjaVmfd4Bf9bOltHXD8x8FCQuaPn3LrrrQKrPEQ7bht7esAwrg3XIlV6ZH+ Wr93+pTNpjPBik9iZXR4UwXTlgPWDVB5/SEZCqWitcGOvGz9XZyaAEQ 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_062817_249206_6ABFCD32 X-CRM114-Status: GOOD ( 11.20 ) 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 Set up headset mic bias regulator and add the necessary properties to the samsung,midas-audio node to allow for headset jack detection. Signed-off-by: Artur Weber --- Changes in v2: - Added headset mic bias regulator - Added samsung prefix to threshold properties - Dropped wm1811 config changes --- arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi b/arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi index e5254e32aa8f..8dc81112172c 100644 --- a/arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi +++ b/arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi @@ -294,11 +294,30 @@ submic_bias_reg: voltage-regulator-5 { regulator-max-microvolt = <2800000>; }; + earmic_bias_reg: voltage-regulator-6 { + compatible = "regulator-fixed"; + regulator-name = "EAR_MICBIAS_LDO_2.8V"; + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + gpio = <&gpm0 0 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; + sound: sound { compatible = "samsung,midas-audio"; model = "TAB3"; mic-bias-supply = <&mic_bias_reg>; submic-bias-supply = <&submic_bias_reg>; + headset-mic-bias-supply = <&earmic_bias_reg>; + + lineout-sel-gpios = <&gpj1 2 GPIO_ACTIVE_HIGH>; + + headset-detect-gpios = <&gpx0 4 GPIO_ACTIVE_LOW>; + headset-key-gpios = <&gpx3 6 GPIO_ACTIVE_LOW>; + samsung,headset-4pole-threshold-microvolt = <710 2000>; + samsung,headset-button-threshold-microvolt = <0 130 260>; + io-channel-names = "headset-detect"; + io-channels = <&adc 0>; audio-routing = "HP", "HPOUT1L", "HP", "HPOUT1R", @@ -345,6 +364,11 @@ wlan_pwrseq: sdhci3-pwrseq { }; }; +&adc { + vdd-supply = <&ldo3_reg>; + status = "okay"; +}; + &bus_acp { devfreq = <&bus_dmc>; status = "okay"; From patchwork Sat May 25 13:28:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artur Weber X-Patchwork-Id: 13674022 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 CE09CC25B7C for ; Sat, 25 May 2024 13:28:42 +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=94WHpMkrRBlbahjbgKImmBVNXuLDUoUOVf/qznRTGjA=; b=QD5WQkSn3/9ITf 4wZe3T/UelA7GUsPMzuQTDXANMfwnyVnPeWPqg5sCZTU3XAG4RpyH6K6zuMUbMHzrkXesth3tkik1 4GGnfjYkv10Wzf0ykXUYH/PlCcVM99xOFsDNvHmoiXJSQZiMXAOtEcCFuOzSuK6DhKHyW2P26rmMp OUV/5ZcQ2V3FqszpNGdHfrFhzT8B/Tme3/1+HgXJ1Vmma+ztLE2E4N7A4kEEce/uVh+bTvxOwxDRh tLAjmTYDJDNd5vRtq31pWzprKXHnrdI3l+kFllC7PSCZn5fNjNlA9CQK48NdXYns92NQ6YZ0UHfJQ h1yhBvfiSYPbpPevKB4A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sArRp-0000000B4H6-0H3F; Sat, 25 May 2024 13:28:33 +0000 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sArRa-0000000B49T-3avD for linux-arm-kernel@lists.infradead.org; Sat, 25 May 2024 13:28:20 +0000 Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-5785f861868so1734700a12.2 for ; Sat, 25 May 2024 06:28:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716643697; x=1717248497; 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=KVTf+ORIRGYRpXo2GEU5zQOEzBOgFtModBKMJI7KIkI=; b=j8gXANe6aHISkAxlhNC+8/7GB95Wy5LtfeJH2G//x63FmUmwwswhjzqXmVG3DA1Xsr HoEpZXjMGAMvUurGFgdKxw5ef6nh7uNt1b0QtHxmumq0hKADpBuOwwAacxaQdDgNAJYh QpDv6OHrPh4UbBW39iouHSYGO4UMHriNGE8pXJMK1uUbKQgWR7MvO8osw4sSiemy1asc YEAPebq9/QIFf2YGSy/3rhxOPeJrW9BMLGGsM5A3QZbeU3SscOUh+QrNdqRMS3uXcOqI +XM5egxWMij1vvF1PvNBP35aStrUAEghD7zuW+jCDJuHhoL5aSW4PCRluzErJlhn4odv pQ3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716643697; x=1717248497; 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=KVTf+ORIRGYRpXo2GEU5zQOEzBOgFtModBKMJI7KIkI=; b=m+GpGZoU/HGIqwYaNp8e/Vme0dOj3da6kzQJpdFB4Qgu/zEtN/ZuqNha6U/QGJLug4 GmS+26nyvu47SbTXpvjvd0tBc+e4uC84vcxnCI6OkUCgYHmgXT2mLR5RCgoBQ5S/AyWq JTgTZKLrdF0sHQ2E2ZqiIMMLCjFkzZxzL5c2Su62PWbggb7sXi6E+JsVeCXMZveZHByU lOXF3fP5Fma9eZhS/BX9Dt1tkKqB92U9LujML5GWrkFr/7QLuHjUV3Ma/f8Yl3i9EaUt sx7aMJhOPFLkB2un+FdlJb8kGxVg0+h5EnPF/Iboi1nf+PXx2v9pZVgxxBx/3+bu0lS4 9Yyw== X-Forwarded-Encrypted: i=1; AJvYcCXf5V5tA/I6CXsGIwSuuonvsr9U4CwSQ8cbM2YeNl32KX22Mrb5IzJF6Z2Qc8HgMJxrpmEaffirwWokQIJvZaWESgnqZT+HC9o5GvIRWXntK7Gv3dw= X-Gm-Message-State: AOJu0YyxJTTyVVmXa5I9dDp2Gs52dpD05lnAEzlLY4zQ90Q/Pkd09g4G EF/44G9uNdJjHbNLVcqx4lA0w0EitFn2h1+ZgxD1K24SUAyBVTL7 X-Google-Smtp-Source: AGHT+IGKy/nfMumZ+piDk12ki5yLScoDlP3w4SoUDbj6/OPTWDEjPeyHUakIPs5ygv6O1U2HHNXMYg== X-Received: by 2002:a17:906:6d95:b0:a59:bbd6:bb39 with SMTP id a640c23a62f3a-a6264f0ebfamr326678866b.55.1716643697033; Sat, 25 May 2024 06:28:17 -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.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 May 2024 06:28:16 -0700 (PDT) From: Artur Weber Date: Sat, 25 May 2024 15:28:12 +0200 Subject: [PATCH v4 8/9] ARM: dts: samsung: exynos4212-tab3: Add MCLK2 clock to WM1811 codec config MIME-Version: 1.0 Message-Id: <20240525-midas-wm1811-gpio-jack-v4-8-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=1280; i=aweber.kernel@gmail.com; s=20231030; h=from:subject:message-id; bh=9NhvL8rRJ4NpIlfmWPhGyv2x7+JR1l7yy4pYIQI11b4=; b=C0ynPtHNYmis/xfQ/wB1ZfG8JHLYQUqSEjR4rYX7GYbMQmbw4YCAxg/2J5P30kp+52wjTF7+8 rsbM/TdIWdzB7cRXlBvMytyyjCrEOlBBw5psPJJ9C8szKVM66+8pWU4 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_062818_938492_24E83F91 X-CRM114-Status: GOOD ( 13.31 ) 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 In the schematics, the MCLK2 pin is shown as connected to CODEC_CLK32K, which is derived from the same 32KHZ_PMIC clock as Bluetooth/WiFi and GPS clocks. 32KHZ_PMIC is connected to the BTCLK pin, represented in mainline as S2MPS11_CLK_BT. Add the MCLK2 clock to the WM1811 codec clock property to properly describe the hardware. Signed-off-by: Artur Weber --- Changes in v3: - Split out from "[PATCH v2 7/7] ARM: dts: samsung: exynos4212-tab3: Fix up wm1811 codec config" --- arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi b/arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi index 8dc81112172c..47e9a230f2e8 100644 --- a/arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi +++ b/arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi @@ -529,8 +529,9 @@ &i2c_4 { wm1811: audio-codec@1a { compatible = "wlf,wm1811"; reg = <0x1a>; - clocks = <&pmu_system_controller 0>; - clock-names = "MCLK1"; + clocks = <&pmu_system_controller 0>, + <&s5m8767_osc S2MPS11_CLK_BT>; + clock-names = "MCLK1", "MCLK2"; interrupt-controller; #interrupt-cells = <2>; interrupt-parent = <&gpx3>; From patchwork Sat May 25 13:28:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artur Weber X-Patchwork-Id: 13674024 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 9D09FC25B78 for ; Sat, 25 May 2024 13:28: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=spihs16BfC7268Sgiu21adB38WoYX0YvAxLcvKyF1Og=; b=CWMd684jn6MA8S wDhZ6N1OX/8jebePhCPdIke24ckyu2wsOWlw0ZYjywP7f1fOBWzOLRGybCtO5UFJPhmYq7HIs3cvu fZ1oSCjlr0pseKh4iPChre/R3/BeOpIJpNj6fhic1OpnjnHbIUwwAZiPYadvVGlgrckKXIvCDPwgL BJuD9PztA+s7cxPJP/a/tcU8W3PsR0timJ+zfJ9krug+ai5acnbFAjy/MA9eofwWkM7L9eRasNzOq xCTsoMIsmX91iCDU72t0SuqYDmUblG82H4Hk8t/pj6qO2SrT0g4RKR0lovy1BGsX0VFC6fE5RDLQw H00UN5ywNeQ39YiZqbIA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sArRr-0000000B4Jl-3lwA; Sat, 25 May 2024 13:28:35 +0000 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sArRc-0000000B4A5-1MEd for linux-arm-kernel@lists.infradead.org; Sat, 25 May 2024 13:28:21 +0000 Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-a5a5cce2ce6so1245061466b.3 for ; Sat, 25 May 2024 06:28:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716643698; x=1717248498; 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=xAevoRwyHB/hjeggss8BgF1gg74yCzQU/uk4mIsOlV8=; b=f+kp+h7S6UgMqFKiGWLdwOgASm1A1SpVov3A8O0Q9HxhUF3oZQWoJ51ho7kxm6ddlV Ig1LGLoYT5J6OvqiVNrgf+z3G7zprt5b27FDNhwCZv2QS7ePMtRi92ZUe7vaDm6GiQ2K 7te5dtyzHzoDbMIt6nvfDGj5QAVIzfC1QG3HT4n8Y75G/S4gbp/j3jWBEkBDfPG+6mge gg5X/+rxmSb3/RZ6VUT6NRA+9+eUV14elge3FeJvTPyAXSxmClmnoMK/uABUyhGzkvDZ n82VUkc0Bs7N6rU9Q/sBZeLUn0xaH/LIotHV6oG/Uws8QB7mmH3wrYQ6NC3Hx/gl86xk KIvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716643698; x=1717248498; 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=xAevoRwyHB/hjeggss8BgF1gg74yCzQU/uk4mIsOlV8=; b=OtUNX9grLJ/9If+HenwY+ifhyyGvXwqp2kDFwADrR+XSqeqGZeG5Zvm7hjywsEVHEL +UUtQY0G9QvLqUQHbhj29cYIisYJtkkrmr0Pn/XDdqxnCZWmMs2J6Nm+gz8LOx3XOMgX wg3G44qwdchFjCOqWjBguCwn1AHpL+UfZ9pDmDQ5iNo/kYLjbKme6oGek0ctejavJoXK A7rSk+3/bjsbvrJSVS/tt5VtooZIArcfQqNDPIsKxSHHtuUraqd5j4R199HWBUdvLhT1 oBVUze1ttRqAWnl8Lw/PQk28rXhXU9NsXsm8oP489u2pkIRFqEHb7sMRU0GKAati7NoQ bduw== X-Forwarded-Encrypted: i=1; AJvYcCVtwDMerLhfDrnrleiRQtkPhfgnsoY7c3xub2nJfdkZJ55VUnGhZncIa3jH1SkY3OtF8oT2e1G8q/7roNFLE1l5FR0RRjG7PLI2b6A2mWdQZGnO9YY= X-Gm-Message-State: AOJu0YwD3tkCIyvVMiIBfBJ4cLai8SH/d++1ytIAURZoR2C49GqnSlmF Jy9iTBAX8JEBYg5DbE4lFjXW6zAbmxIOGtTjCIX80nAq2JYAFIdF X-Google-Smtp-Source: AGHT+IHjDWw31Jpb0flKPT54OLT41uuXKaoyPQviyN3N7/UlfI6Rk1BZIMko/WbbCb3qjGua2q1M2w== X-Received: by 2002:a17:906:68c7:b0:a59:ab57:7413 with SMTP id a640c23a62f3a-a62651341ffmr304999866b.73.1716643698275; Sat, 25 May 2024 06:28:18 -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.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 May 2024 06:28:17 -0700 (PDT) From: Artur Weber Date: Sat, 25 May 2024 15:28:13 +0200 Subject: [PATCH v4 9/9] ARM: dts: samsung: exynos4212-tab3: Drop interrupt from WM1811 codec MIME-Version: 1.0 Message-Id: <20240525-midas-wm1811-gpio-jack-v4-9-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=1130; i=aweber.kernel@gmail.com; s=20231030; h=from:subject:message-id; bh=JqmBRm5p/y60vQho/QixG5OijJiMY4yvo8+3qIYS2Eg=; b=att6PI+S7xL/90ESu59NSz4LR4vIES/yJXLYib2LgY8EMPIGeok1wNdGajg7ym3EcfPb7CnFU Pwld1M2ToFDAxruK69JapsFnNIrDHO+vaCy7Kw72doBiWQPqda/rdnC 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_062820_420000_62F673F2 X-CRM114-Status: GOOD ( 13.62 ) 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 This was initially copied from the Midas DTSI, but there is no proof that the same interrupt is also used on the Tab 3. The pin listed as the interrupt here is GPIO_HDMI_CEC on the Midas, but for the Tab 3 it is the headset button GPIO - GPIO_EAR_SEND_END. Drop the interrupt, since there is no proof that it is used. Signed-off-by: Artur Weber --- Changes in v3: - Split out from "[PATCH v2 7/7] ARM: dts: samsung: exynos4212-tab3: Fix up wm1811 codec config" --- arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi b/arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi index 47e9a230f2e8..20e5e7ba6b92 100644 --- a/arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi +++ b/arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi @@ -534,8 +534,6 @@ wm1811: audio-codec@1a { clock-names = "MCLK1", "MCLK2"; interrupt-controller; #interrupt-cells = <2>; - interrupt-parent = <&gpx3>; - interrupts = <6 IRQ_TYPE_LEVEL_HIGH>; gpio-controller; #gpio-cells = <2>;