From patchwork Sun May 19 08:17:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artur Weber X-Patchwork-Id: 797982 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (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 69B24C25B78 for ; Mon, 20 May 2024 13:57:34 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 85C0085D; Mon, 20 May 2024 15:57:22 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 85C0085D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1716213452; bh=oxZAMqMqlKlTjZ/d/nZ7mM8CRcGM1aALJhSvZTlSCIE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=VH+Hs98IsWnbIkh5TFMFBgyajAKVJk8nAYaCIJGVBbaW4Y/SQ4NLQpu147yGplVTG +XBBchQ1pAokR/lfwh9iDSvEgl78X1BB7LKa7cZuA/pr6AzN+O/j/R2T+0v4TD16yf ORflLDxSPEB2P4vP9FDKPS9paRsaXhyGNtLig3NM= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2119DF8063E; Mon, 20 May 2024 15:56:14 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 45B8AF80641; Mon, 20 May 2024 15:56:14 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id C3F8AF805A9; Mon, 20 May 2024 14:43:28 +0200 (CEST) Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 4EEB1F8020D for ; Mon, 20 May 2024 14:43:26 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 4EEB1F8020D Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=KHhsrSRR Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-420180b58c5so17741745e9.3 for ; Mon, 20 May 2024 05:43:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716209005; x=1716813805; darn=alsa-project.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=GBQXsZU35VYhqiFUuzQSMRWlgIZsYX5osBGZyaRNZAc=; b=KHhsrSRRHlHVBCiwe6FMMrP9kRR8n2LH1l1K/f2kILeB23d7t7WzswxIBiK7EQodD3 ujBlyJk6NwpQHoqiTU4VRpLThkfVoBM3F4tKE1lGK+iMM1vOZ8QC2JuDXuGZ29iIBlMk 0IAw6Jg6NqLrvuKDFknPqhvFFqZj4s5ys+QVSRnbUzpYTfSto+WhjUgreQ7C/mBN452D w+RXspyU7UN6Z5ez673RWGpcrOqlYHOsZY/JPSQpUiYrqtG6J+sGoSiBsNmPrYD+vkNI Uw6AW56WuHYz15b9jLsTQjTHQBTxpOkwz/rh0DqSPRZW12GJ0f6PCWjSyIPSpVxD4TvH 8SZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716209005; x=1716813805; 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=GBQXsZU35VYhqiFUuzQSMRWlgIZsYX5osBGZyaRNZAc=; b=uYGYksUNhVH3YFbBmBrOfTp7nkGWdrauJ0/8ekS3x7+sncl3pjwpHUUd5vNcTKOWPt CCeUxBXtG4ZGLveUayP7UILvEOIFm8QpwWIZOd57q/YhXguEluSEVHLoJEoJPaMOQFU4 mq4etQhloTTJUY2bR0wNMQ7ftdyNWbY+8dxXzYTR7ZbHpBpbdsQxpBEeJI5m2fRSk/Kf Y2rC0VanJ9O3uMgt6NnfGIk8S1sX+lokO9LqnLppCTwGHcBdQf037lShCLpOPljyeApP W14SQnliNzZOaQVHmWpe71MubOSI1mWxBbej96N/2c0so7mF69YQ/BBgC2aRXvLTgXDV JsnA== X-Forwarded-Encrypted: i=1; AJvYcCUtDZj15reKGyc1qzCQySQr1oxFE6p9hgtPLoHUjOBnnhybNg639bEZ0kKobgCRHqvgE6gdq7ZnPkhmQeCBqaKXfTLIEL4xKXTjNIw= X-Gm-Message-State: AOJu0Yxh+x90kC7QIidcMZxgThy5/CXFGEu+KeCzU2/kNHNkZs7Edtq2 sdbzRK45YTkhyZGLDlhqXO+mPYp9fPUJF3GMUad4nyEdJNUwLKNdBMFqbA== X-Google-Smtp-Source: AGHT+IEilfnVxtejbu/ht9RsEU/PAmph0nDxRzwauS2k1nuOc2xrr0wwjEZekDl9AfdgWnlGYcB5Eg== X-Received: by 2002:a05:6512:b15:b0:51a:ca75:9ffe with SMTP id 2adb3069b0e04-5221057b50bmr23433137e87.42.1716106689783; Sun, 19 May 2024 01:18:09 -0700 (PDT) Received: from hex.my.domain (83.8.125.62.ipv4.supernova.orange.pl. [83.8.125.62]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5733c34e5ccsm13698518a12.95.2024.05.19.01.18.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 May 2024 01:18:09 -0700 (PDT) From: Artur Weber Date: Sun, 19 May 2024 10:17:47 +0200 Subject: [PATCH v3 1/8] ASoC: dt-bindings: samsung,midas-audio: Add headset mic bias supply MIME-Version: 1.0 Message-Id: <20240519-midas-wm1811-gpio-jack-v3-1-0c1736144c0e@gmail.com> References: <20240519-midas-wm1811-gpio-jack-v3-0-0c1736144c0e@gmail.com> In-Reply-To: <20240519-midas-wm1811-gpio-jack-v3-0-0c1736144c0e@gmail.com> To: Sylwester Nawrocki , Krzysztof Kozlowski Cc: Liam Girdwood , Mark Brown , Rob Herring , Conor Dooley , Jaroslav Kysela , Takashi Iwai , Alim Akhtar , alsa-devel@alsa-project.org, linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Artur Weber X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1716106686; l=1024; i=aweber.kernel@gmail.com; s=20231030; h=from:subject:message-id; bh=oxZAMqMqlKlTjZ/d/nZ7mM8CRcGM1aALJhSvZTlSCIE=; b=BhIKKL+8RIOGcP4bUlY911QYk1W9Fy3JXaNFWUp3TXITqmXYjEBxWsyPihAzfzCdyP0qEcTeV ow6N+zBCrMNAp4ThqQJrxiywHiLgDSQJXmY+JaRKZwzCc+BvJiEYIum X-Developer-Key: i=aweber.kernel@gmail.com; a=ed25519; pk=RhDBfWbJEHqDibXbhNEBAnc9FMkyznGxX/hwfhL8bv8= X-MailFrom: aweber.kernel@gmail.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1 Message-ID-Hash: CWQCR55DVTWXCZD7SK3WCHYLRRY3TQVL X-Message-ID-Hash: CWQCR55DVTWXCZD7SK3WCHYLRRY3TQVL X-Mailman-Approved-At: Mon, 20 May 2024 13:56:00 +0000 X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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 --- 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 Sun May 19 08:17:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artur Weber X-Patchwork-Id: 797884 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (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 EE2E6C25B78 for ; Mon, 20 May 2024 13:56:41 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 3EBF1E80; Mon, 20 May 2024 15:56:30 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3EBF1E80 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1716213400; bh=EZXePcBvXKiwP3EXDEHqCyB/Gu0AEIhLbrUV4Fe+KI4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=eNSbm4rnzemZGgPH9RXKmrxVIo0u0DP3dMCW0EUflL01rk9gJKtVlFYSpbhdbuQXQ H/AvD66bk1ZimDIOmfOxNo4nUmcZF1CrxXFgaGY8yc8ATe8rSOux1sA6G9hSeNqIgx sxfSnhFm/HemIFFOEx7nKT9be4ptfDKfTR6mInBg= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 862CFF8042F; Mon, 20 May 2024 15:56:07 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id AA6ABF805E5; Mon, 20 May 2024 15:56:06 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8FF4CF805BF; Mon, 20 May 2024 15:03:54 +0200 (CEST) Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id AB608F80578 for ; Mon, 20 May 2024 15:03:49 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz AB608F80578 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=HmkIHcFv Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-a59b49162aeso687682366b.3 for ; Mon, 20 May 2024 06:03:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716210228; x=1716815028; darn=alsa-project.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=R9dPohp8pfuUkAslj/44LQMkiwtv+DsL3rPN9tPKGHw=; b=HmkIHcFvTpRYbHtb9+ccDOW+WtKbov5YpbB06VgzM/LOiXO+rzxI95AGLSof15/naB wC7R6xcgY/LVid826AOPWRiuOISE6r1uStWw7TMhgNyjcn0v5aoNujgqpJ/e4JwEhAte /1k7kkfU66n3bVmukKv5gaIjnNyNQuiv70Tvgk1DJp793cL/hKvznacF3hm2mRUevbIA 5wAkkse4xFMYEFBcBe6a0BWrCkvb+D7zn5/Ta8vJQcIIKZX62pt4EzT98IP0a1YPNiOm E7OgvoxI5sBVqA+sFJzWRF2GfbBhYrJ4MqrbhcJ5ZUlc/wnQzHgOOa7BGd5hUJ161rlW SuIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716210228; x=1716815028; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=R9dPohp8pfuUkAslj/44LQMkiwtv+DsL3rPN9tPKGHw=; b=EFscRh0N16Gj2YDTV71oR5FvTBfILxQmUxmKXOhtYPy8o412XBdiKzPhBfsm1uv4Fs 1aAP8fmRfIEOd/sRhgVLb1icQMroC1TcgJgv+pop8affcCS/hX90Y9JV03TRnaWH7xEV H4K2kYFLIEPQDk5+huiZEBHxta3T/vnvFTBf1FIJYeLlkt+tr5rUr2s96qdX3pJ8HxxV 22sPKOkmAarUFHziHAAk5/530SyqhUpUde/Zr7wZriLlfNQVgNyXQ4bjIjl5utp9Rd7A pqg9VWHNlJNgPjQDgtxd7wsuP0fkrRFho7jqX0mCF8LG55K86nY29jGSyQ+Lb6JTqFen S9wg== X-Forwarded-Encrypted: i=1; AJvYcCV1UNMOYHu2tKJ13v61BIb3KOhgGfbxj7rcEtsTveD5B6nk4+t9wQe1bWe1XQUAMMmLuBNXGTHDC1K/wHN1WBWUCDaC5sdav4FhuJY= X-Gm-Message-State: AOJu0YykBpWJ70+72uF1Ddh89An5aR2u58BXD+in48XcIUjtFLVA552X enM3suF2+XNxIEXhKi6AI2O9xyBaM/aVDZYH/7EF8/ZZhKMr0RZVbVNozg== X-Google-Smtp-Source: AGHT+IFSJPpCsXD8nlzNZtTtwVuOywlJ3kEeHAEQNsTVgsVqCTp5lAG6+vAvM/y1zxZstH6QWCi7tQ== X-Received: by 2002:a50:9519:0:b0:575:d74:338c with SMTP id 4fb4d7f45d1cf-5750d7433dbmr5644244a12.10.1716106691185; Sun, 19 May 2024 01:18:11 -0700 (PDT) Received: from hex.my.domain (83.8.125.62.ipv4.supernova.orange.pl. [83.8.125.62]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5733c34e5ccsm13698518a12.95.2024.05.19.01.18.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 May 2024 01:18:10 -0700 (PDT) From: Artur Weber Date: Sun, 19 May 2024 10:17:48 +0200 Subject: [PATCH v3 2/8] ASoC: dt-bindings: samsung,midas-audio: Add GPIO-based headset jack detection MIME-Version: 1.0 Message-Id: <20240519-midas-wm1811-gpio-jack-v3-2-0c1736144c0e@gmail.com> References: <20240519-midas-wm1811-gpio-jack-v3-0-0c1736144c0e@gmail.com> In-Reply-To: <20240519-midas-wm1811-gpio-jack-v3-0-0c1736144c0e@gmail.com> To: Sylwester Nawrocki , Krzysztof Kozlowski Cc: Liam Girdwood , Mark Brown , Rob Herring , Conor Dooley , Jaroslav Kysela , Takashi Iwai , Alim Akhtar , alsa-devel@alsa-project.org, linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Artur Weber X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1716106686; l=2328; i=aweber.kernel@gmail.com; s=20231030; h=from:subject:message-id; bh=EZXePcBvXKiwP3EXDEHqCyB/Gu0AEIhLbrUV4Fe+KI4=; b=y0s6y128OFbER9wO691Pl1y+dbxejiJKN2KyMeWLB/2Zj0rDj0uqrU/vqrYEf3sfku35wMvuJ 4n07G9uGfoZC4uco+vrUBL0eL2AF5KeXYuDpzrN+9MsyZOiAHxEX8eh X-Developer-Key: i=aweber.kernel@gmail.com; a=ed25519; pk=RhDBfWbJEHqDibXbhNEBAnc9FMkyznGxX/hwfhL8bv8= X-MailFrom: aweber.kernel@gmail.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1 Message-ID-Hash: IVBL6OFJ347JDEYW5CANTVRVM2XYZYXS X-Message-ID-Hash: IVBL6OFJ347JDEYW5CANTVRVM2XYZYXS X-Mailman-Approved-At: Mon, 20 May 2024 13:56:00 +0000 X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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 From patchwork Sun May 19 08:17:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artur Weber X-Patchwork-Id: 797984 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (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 61EE3C25B78 for ; Mon, 20 May 2024 13:56:35 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 12117868; Mon, 20 May 2024 15:56:18 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 12117868 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1716213388; bh=vuYNtCSoGcmTk8GfhvJhaoNcv6Dz56BFdGIefFxXzuk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=aJi45WzbbbM1aNZWehGnliFOBjghYWC2cF1K+MkpCMm4T6au89OTsP4W5e/7bqAcF 3zAZuZZJmRwz+6dk2T3TDlcCxJX5kiFqckWFyEYLMSM7dadoCspEOqcHfNPo1uBGFH +LZU37iXp8+LkGA8iIfxSvLolCNh3bhU1W43JkA8= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4A662F805B3; Mon, 20 May 2024 15:56:04 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id CF375F805C5; Mon, 20 May 2024 15:56:03 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2C862F805C2; Mon, 20 May 2024 15:16:52 +0200 (CEST) Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 29AFEF80578 for ; Mon, 20 May 2024 15:16:48 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 29AFEF80578 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=MdUn+LPv Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-42016c8daa7so18515205e9.2 for ; Mon, 20 May 2024 06:16:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716211007; x=1716815807; darn=alsa-project.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=EUmoS//RS/NzAGvmwPir69ysTLwZDq4qcPlEK/AGs3g=; b=MdUn+LPvJnfIopv15i+3+iLEhATkz/RqJ4qhR2d8Bwy07oj7o5zHovElf5CZHgs3Ma bVLvxlYUZ26Acz93Wl/AtweZXE+r+K1Qxk9Jz4M/8lgUGb3PBMrGbMNGeQXMDtWh7Ffa Xo2ANhTgURXi0vd+QqyHdVi+GoqSTCP/pvPiNJ4P3enEP47QZRUnVel2OHxTMAdVmfRM NckibvRs6iXnCBRJlHMONbVnD+boaj8o95aqKTo/DY9FNZAY4GYcj3dbeNrrSO3AGAdF JTMbj1OYhHWzzX7NaMJ9SYbFQBFQcBUS0nxy5kygLTBrRMWy2kTbWaXnqLFo3wxt3xSo EcQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716211007; x=1716815807; 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=EUmoS//RS/NzAGvmwPir69ysTLwZDq4qcPlEK/AGs3g=; b=QxRiy1Xrc6nYIUZZtR8zF6qy9MDNi+HUVfZH1O8G4TzqPlpb/ZEeqEDXUThneT48H6 OptlYJMZZCb6wxJMpi5xqmrIEN93rrmZsYGrxdiKi54fO9k9U30z41S6p4lzuoldmpSz uNiqqXoSj6TcLiujxwYWN81zm4higKqZwTQjIfwhyFqxgHoaCCYN98ZSvNvdjVDfqG7R NF/o3eBijwJppxSjawNzpY3vU/Lwk6u0Xg/ZyYDOhprwfaVuiOo29ybeIwVcDR+zfDJa VrxgpWu0BnjzpRarIIbG/MH7pL36AOBomiSjBOFDldAxts5Z/JQpalaOcULK0I01+OD/ /BGg== X-Forwarded-Encrypted: i=1; AJvYcCVSUI6DRuEALBplMdOITKz8GgvDV0yzdzr5AVDwkG1HfF2YizCU5DluL/FXH+/tGq9kFi9kbLmZBy+CM63HWvuSw/90E3MTXHDdeCA= X-Gm-Message-State: AOJu0YxBOiQv6V8GuGKxiSryPNeLqIAv5oRsvQA0c/JXeM2U2DlzZw9O 9R+wCDE9oi+jofvR1iwhytjfGQDY+b/sUhE+dT7Uv2trmgKxVO6XKmvCNQ== X-Google-Smtp-Source: AGHT+IFtA0Va8QiICPbaNatA5PVquOStRUtv//wy7zLyNNpUAzWXvwJve0s999PpRDl1QmQ8sDDadQ== X-Received: by 2002:a50:8a84:0:b0:572:7280:89d6 with SMTP id 4fb4d7f45d1cf-5734d597a25mr18601319a12.7.1716106692558; Sun, 19 May 2024 01:18:12 -0700 (PDT) Received: from hex.my.domain (83.8.125.62.ipv4.supernova.orange.pl. [83.8.125.62]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5733c34e5ccsm13698518a12.95.2024.05.19.01.18.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 May 2024 01:18:12 -0700 (PDT) From: Artur Weber Date: Sun, 19 May 2024 10:17:49 +0200 Subject: [PATCH v3 3/8] ASoC: samsung: midas_wm1811: Add headset mic bias supply support MIME-Version: 1.0 Message-Id: <20240519-midas-wm1811-gpio-jack-v3-3-0c1736144c0e@gmail.com> References: <20240519-midas-wm1811-gpio-jack-v3-0-0c1736144c0e@gmail.com> In-Reply-To: <20240519-midas-wm1811-gpio-jack-v3-0-0c1736144c0e@gmail.com> To: Sylwester Nawrocki , Krzysztof Kozlowski Cc: Liam Girdwood , Mark Brown , Rob Herring , Conor Dooley , Jaroslav Kysela , Takashi Iwai , Alim Akhtar , alsa-devel@alsa-project.org, linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Artur Weber X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1716106686; l=2705; i=aweber.kernel@gmail.com; s=20231030; h=from:subject:message-id; bh=vuYNtCSoGcmTk8GfhvJhaoNcv6Dz56BFdGIefFxXzuk=; b=Oph8hMfgjPv7+ASAJ6X81w2AItr7S+gGYQiA9lMJgDun4mT3Z8oy8+F7ihMMEw8x/x9MM0sTS JswKrd6RYJNAbRYAXVEkhrsO34yH4MtOXVYi+wgzHZq41rRJmRkYJWp X-Developer-Key: i=aweber.kernel@gmail.com; a=ed25519; pk=RhDBfWbJEHqDibXbhNEBAnc9FMkyznGxX/hwfhL8bv8= X-MailFrom: aweber.kernel@gmail.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1 Message-ID-Hash: USBIWFAXGQAGK34DHQTJ7BPF4T7W73YE X-Message-ID-Hash: USBIWFAXGQAGK34DHQTJ7BPF4T7W73YE X-Mailman-Approved-At: Mon, 20 May 2024 13:56:00 +0000 X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Some devices use a headset mic bias supply (sometimes referred to as "ear mic bias") to enable/disable the headset mic. Add support for getting the supply from DT and setting it up accordingly to the value of the Headset Mic switch. Signed-off-by: Artur Weber --- Changes in v2: - Added this commit --- sound/soc/samsung/midas_wm1811.c | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/sound/soc/samsung/midas_wm1811.c b/sound/soc/samsung/midas_wm1811.c index f31244156ff6..ab0a4804b45e 100644 --- a/sound/soc/samsung/midas_wm1811.c +++ b/sound/soc/samsung/midas_wm1811.c @@ -29,6 +29,7 @@ struct midas_priv { struct regulator *reg_mic_bias; struct regulator *reg_submic_bias; + struct regulator *reg_headset_mic_bias; struct gpio_desc *gpio_fm_sel; struct gpio_desc *gpio_lineout_sel; unsigned int fll1_rate; @@ -201,6 +202,25 @@ static int midas_submic_bias(struct snd_soc_dapm_widget *w, return 0; } +static int midas_headset_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); + + if (!priv->reg_headset_mic_bias) + return 0; + + switch (event) { + case SND_SOC_DAPM_PRE_PMU: + return regulator_enable(priv->reg_headset_mic_bias); + case SND_SOC_DAPM_POST_PMD: + return regulator_disable(priv->reg_headset_mic_bias); + } + + return 0; +} + static int midas_fm_set(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event) { @@ -271,7 +291,7 @@ static const struct snd_soc_dapm_widget midas_dapm_widgets[] = { SND_SOC_DAPM_LINE("FM In", midas_fm_set), SND_SOC_DAPM_HP("Headphone", NULL), - SND_SOC_DAPM_MIC("Headset Mic", NULL), + SND_SOC_DAPM_MIC("Headset Mic", midas_headset_mic_bias), SND_SOC_DAPM_MIC("Main Mic", midas_mic_bias), SND_SOC_DAPM_MIC("Sub Mic", midas_submic_bias), }; @@ -455,6 +475,17 @@ static int midas_probe(struct platform_device *pdev) return PTR_ERR(priv->reg_submic_bias); } + priv->reg_headset_mic_bias = devm_regulator_get_optional(dev, + "headset-mic-bias"); + if (IS_ERR(priv->reg_headset_mic_bias)) { + ret = PTR_ERR(priv->reg_headset_mic_bias); + if (ret == -ENODEV) + priv->reg_headset_mic_bias = NULL; + else + return dev_err_probe(dev, ret, + "Failed to get headset mic bias regulator\n"); + } + 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 Sun May 19 08:17:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Artur Weber X-Patchwork-Id: 797882 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (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 D32B2C25B78 for ; Mon, 20 May 2024 13:57:49 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 096ED826; Mon, 20 May 2024 15:57:38 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 096ED826 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1716213468; bh=tvVeHRzJ1CkifWQbFGlvF0EVZIoz7vxKkkPUGFuk7jM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=gi/B+T+u7OZ+034Y5Gn5dvMvQlAS2uMOBghZpbXbDbthDrQVA4eeGAEc9jksKUFFr TTS2hYoDqrvetUK/f+Vx0yPzhHRD+XmS+9LhFT5SSxHEx4d199xJontV1mecaEwNlQ URjVE8iU6J30oNvFMNA8tLYiH9UDmQgNRb2NbJLA= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 02BABF80685; Mon, 20 May 2024 15:56:16 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id A6E55F80689; Mon, 20 May 2024 15:56:16 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 32CA1F80587; Mon, 20 May 2024 14:33:22 +0200 (CEST) Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 776DEF8020D for ; Mon, 20 May 2024 14:32:51 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 776DEF8020D Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=fooxG37u Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-34db6a29998so1991723f8f.0 for ; Mon, 20 May 2024 05:32:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716208370; x=1716813170; darn=alsa-project.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=poVyIDrS2b/ZXWDdTK9RH0R8g9cefahYbIBUWzC1UWE=; b=fooxG37uh68zEuys3PPYHmF4HF+QhT23qFB7Qo+DU9ko2Lt/AhlE611E4eY+UPbQoS 8wu80jXZ11F+sPu3Qti9QQS+9rT2sazWhNH3GhH2LNCeGaoNXQlZ9VRU13zuKNt1hmUo L4CM9akxanoG6h8kEncaugSG1mzoHQiiiV1FzIYwJcI+tA4sOdH3Qvq2ew6+7H+95Ycc utNlmg5KAF7KwuEoOrLQvZQCBWxA0gzrewKg2Msm8LgGEKlqGOWL2REUcsP3Ur60TLlY ePF+HxgADBlEEH3UqqyF/GcLVeE+AC9DIXtvSxwsNPeoN6W7UzSHoCLfsPpFlSGvx4ja Jzgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716208370; x=1716813170; 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=poVyIDrS2b/ZXWDdTK9RH0R8g9cefahYbIBUWzC1UWE=; b=Qb4cd/7jfEEVk/LGxBX1+USQsWnoPST6pI1ksd2qA4AK1kO7f0VprjFcwNVdlDqenH nvDAmIK7uY9iGmz+BKTk5oRuYBwphL/JlWKnm3JWSS5SIFyym00P9n1gAyfM7cIpA8sW mUtQSXA/WLlNGoja8cSdYfvM9wtVZ3aA/qV3qAGZlXyLuhDwcF/pz+oLqxOOq+MjOA/B BNQgiqW2hJjytu+Oymsp650fp1tyf4OB7wAMVM95ShF+/jI1WwNV+hUAiSe80iQpdnMM nqr+gZYppIH+dlLfeiwei/XKLSauTwScgJleYGnTffoosAPDyWe3tpifoRha4K93ZVCJ 22gg== X-Forwarded-Encrypted: i=1; AJvYcCUuY/wUjPoOaFr5wZSOFo0e+ppp8xfXXuc71z2n6k10ZbZCdGywGgAqi0lmXY1xPlMC6bxIpMyJ+kyxkNiTHZ9FtTGoczwOZ5EXEwk= X-Gm-Message-State: AOJu0Yy6/GHEy5J8/s+XYqH0pZV+QeEv8xGJEeS09VthcRW5c3wnUaJq nzgJasgn9rkHWNe6iUxLfzt31fsxUd+3NfcLKVUGW5FjhJDbbGlIGueDHQ== X-Google-Smtp-Source: AGHT+IGQa8zVgMIpXHn5fL36pQriqk81CxAIOwu4Q/GOcm6if0MbIKvWzuXoQIkeTLfj7lgw3wlfQA== X-Received: by 2002:a50:d7cf:0:b0:572:4041:5637 with SMTP id 4fb4d7f45d1cf-5764d216677mr1442834a12.19.1716106694018; Sun, 19 May 2024 01:18:14 -0700 (PDT) Received: from hex.my.domain (83.8.125.62.ipv4.supernova.orange.pl. [83.8.125.62]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5733c34e5ccsm13698518a12.95.2024.05.19.01.18.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 May 2024 01:18:13 -0700 (PDT) From: Artur Weber Date: Sun, 19 May 2024 10:17:50 +0200 Subject: [PATCH v3 4/8] ASoC: samsung: midas_wm1811: Add GPIO-based headset jack detection MIME-Version: 1.0 Message-Id: <20240519-midas-wm1811-gpio-jack-v3-4-0c1736144c0e@gmail.com> References: <20240519-midas-wm1811-gpio-jack-v3-0-0c1736144c0e@gmail.com> In-Reply-To: <20240519-midas-wm1811-gpio-jack-v3-0-0c1736144c0e@gmail.com> To: Sylwester Nawrocki , Krzysztof Kozlowski Cc: Liam Girdwood , Mark Brown , Rob Herring , Conor Dooley , Jaroslav Kysela , Takashi Iwai , Alim Akhtar , alsa-devel@alsa-project.org, linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Artur Weber X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1716106686; l=12054; i=aweber.kernel@gmail.com; s=20231030; h=from:subject:message-id; bh=tvVeHRzJ1CkifWQbFGlvF0EVZIoz7vxKkkPUGFuk7jM=; b=8flwnlB7SYsRO5RtN1w9LStOJfL32UqWv3Gbo2yMVLTM8PnfFqsqFsLlT6as/IJSTfZb5qvVT 7NTh9Ah/erDBordCCHtqCMN3CuXMByB6mTOmnVRZfrumGR3kcDwZSvL X-Developer-Key: i=aweber.kernel@gmail.com; a=ed25519; pk=RhDBfWbJEHqDibXbhNEBAnc9FMkyznGxX/hwfhL8bv8= X-MailFrom: aweber.kernel@gmail.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1 Message-ID-Hash: QF2ULTXPDFXJUDM2F5WTTDZZ2VY3MTBB X-Message-ID-Hash: QF2ULTXPDFXJUDM2F5WTTDZZ2VY3MTBB X-Mailman-Approved-At: Mon, 20 May 2024 13:56:00 +0000 X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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 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 | 286 +++++++++++++++++++++++++++++++++++++-- 2 files changed, 277 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 ab0a4804b45e..ce94550ee32e 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 @@ -32,6 +34,9 @@ struct midas_priv { struct regulator *reg_headset_mic_bias; 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; @@ -48,6 +53,131 @@ 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 midas_priv *priv = (struct midas_priv *) data; + int adc, jack_type, ret; + int bias_already_on = 0; + + if (!gpiod_get_value_cansleep(priv->gpio_headset_detect)) + return 0; + + if (priv->reg_headset_mic_bias) { + /* + * Get state of Headset Mic switch by checking the headset mic + * bias regulator + */ + bias_already_on = \ + regulator_is_enabled(priv->reg_headset_mic_bias); + + /* + * If it's not enabled yet, temporarily enable headset mic bias + * for ADC measurement + */ + if (bias_already_on < 0) + pr_err("%s: Failed to get headset mic bias state: %d", + __func__, ret); + else if (!bias_already_on) { + ret = regulator_enable(priv->reg_headset_mic_bias); + if (ret) + pr_err("%s: Failed to enable micbias: %d\n", + __func__, ret); + } + } + + /* 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); + return SND_JACK_HEADPHONE; + } + pr_debug("%s: ADC value is %d\n", __func__, adc); + + jack_type = snd_soc_jack_get_type(&priv->headset_jack, adc); + + /* + * Revert the headset mic bias supply to its previous state + * (i.e. if it was disabled before the check, disable it again) + */ + if (priv->reg_headset_mic_bias && bias_already_on == 0) { + ret = regulator_disable(priv->reg_headset_mic_bias); + if (ret) + pr_err("%s: Failed to disable micbias: %d\n", + __func__, ret); + } + + return jack_type; +} + +static int headset_key_check(void *data) +{ + struct midas_priv *priv = (struct midas_priv *) data; + 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; @@ -335,18 +465,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 = priv; + headset_gpio[0].desc = priv->gpio_headset_detect; + + headset_gpio[1].data = priv; + 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; } @@ -453,6 +632,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; @@ -499,6 +681,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 Sun May 19 08:17:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artur Weber X-Patchwork-Id: 797883 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (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 8D37AC25B78 for ; Mon, 20 May 2024 13:57:18 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id B9D717F1; Mon, 20 May 2024 15:57:06 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B9D717F1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1716213436; bh=7ghoUuP1F66lo5lQILjtg4IgiT6Z0TAcd0jCIemjWlQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=HS4xoYKUdCNGlhYk38SNNgy56KAdQx1f+toyjwrieMjXQz2MNKi7hj2MYwbVtUhh2 q1CrwXxgg0JA6RJr0eCTHJ41U4CBuvVWnC8YaJWxW1kYzvLP5ATj8INsP2zrbf29tk BJ31Qd5TaGowLo+94z4C3JO0Rdch413k1OsBv+rY= Received: by alsa1.perex.cz (Postfix, from userid 50401) id A84F5F8061D; Mon, 20 May 2024 15:56:12 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 258DEF80619; Mon, 20 May 2024 15:56:12 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5C0E0F80589; Mon, 20 May 2024 14:37:27 +0200 (CEST) Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 0C9C3F8020D for ; Mon, 20 May 2024 14:37:22 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 0C9C3F8020D Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=R6FajXro Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-4202ca70270so27078335e9.3 for ; Mon, 20 May 2024 05:37:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716208642; x=1716813442; darn=alsa-project.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=JckYzcWe8w+0grZPS9NysF8GgHh7PfoFNUhYz6cHvfw=; b=R6FajXrotevG/39bT65Bvz+OvQAnvHxk0zxS8S2Wbh7tsgH8wmC/+mGyPD8MlYaSZn SaziHsxYtWYggA7nJqY2b61i+z/4O/5YA3o85Vwhh5ABDEN38wZKoRW0LJ6eggXYdZDs w1HpcNKYS5D4hk7YJAg2lwPQheNpNMMQ+FKpyhZUXrgkYJH77zAQvE0Yh+kiHuvmT8QV RkttINqD6ZqWqTUf6qANQmupezKHdH9qlOcodzMN6r//iGQMHFyY9A1iCop028fzKLLB IywQJibAbRZBN6J8T16712yxzZ58alL4KWV1wtAU4OuwsuiB0SHGAZs2+xWNiE5L11OZ bxqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716208642; x=1716813442; 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=JckYzcWe8w+0grZPS9NysF8GgHh7PfoFNUhYz6cHvfw=; b=rVuboAo+sydr/3cWzJlKqFJHrpqq8n04nH8NXqxu5GlOdNai1rZoRdkSaRedEKznZl NwnOaEVHsCsKb56TG/ZQgfw/xsLUx9acTidbz+X4O62aKtDpB97IjvJ8QXfPkc8vxckk Vrz7w2rxWCmEmVeqhO71GF7XPilFFXfSIBVsnbacNKoSCyaTphUJXbwMYtkl4RsP5BKz MqMeUWdudrL9MlZ4V7x6Qy6l7mo0TBP4H/MbAmXdHAhHM8olNT3s6vpvc8pmjORSboE3 RhOtsJ5gnE9SqwTJAZVW/HGJkOZeKiSoAJQEsRCC2JMrgtZWaLNFqwhfrFoI/WmBSvRb 2pAQ== X-Forwarded-Encrypted: i=1; AJvYcCUhfqYIanMTAbWMTf8Clm2bObR3Z1GRzP6kT50NsAqolrBZgqwUO+B+K6bh627qUn+PcIHLp3BOE7zwHrZcWDm+uak2Ps38Z4dSA0U= X-Gm-Message-State: AOJu0YyLfK+c5YPhBVStCv9cw8Gjp5On54x9682qFdxRX57urOYsI0tE 6MVhXGHMCT6CqAGbgbCp6Ltu9Dc6yu14Gc/Di3bX4PpKtzC5rF8p1aZfGw== X-Google-Smtp-Source: AGHT+IG3SMaDBws1fzIkcPLAJz7n7Ag6C6la0lbxW02ImT03Ca69NZo4TJd0EVoTiNb4ZOsqOYvl9w== X-Received: by 2002:a50:d6c3:0:b0:575:a0c:4b8c with SMTP id 4fb4d7f45d1cf-5750a0c4c71mr7898781a12.38.1716106696840; Sun, 19 May 2024 01:18:16 -0700 (PDT) Received: from hex.my.domain (83.8.125.62.ipv4.supernova.orange.pl. [83.8.125.62]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5733c34e5ccsm13698518a12.95.2024.05.19.01.18.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 May 2024 01:18:16 -0700 (PDT) From: Artur Weber Date: Sun, 19 May 2024 10:17:52 +0200 Subject: [PATCH v3 6/8] ARM: dts: samsung: exynos4212-tab3: Fix headset mic, add jack detection MIME-Version: 1.0 Message-Id: <20240519-midas-wm1811-gpio-jack-v3-6-0c1736144c0e@gmail.com> References: <20240519-midas-wm1811-gpio-jack-v3-0-0c1736144c0e@gmail.com> In-Reply-To: <20240519-midas-wm1811-gpio-jack-v3-0-0c1736144c0e@gmail.com> To: Sylwester Nawrocki , Krzysztof Kozlowski Cc: Liam Girdwood , Mark Brown , Rob Herring , Conor Dooley , Jaroslav Kysela , Takashi Iwai , Alim Akhtar , alsa-devel@alsa-project.org, linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Artur Weber X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1716106686; l=1934; i=aweber.kernel@gmail.com; s=20231030; h=from:subject:message-id; bh=7ghoUuP1F66lo5lQILjtg4IgiT6Z0TAcd0jCIemjWlQ=; b=7uG1N3oCFSVcHBgOu630Zb3pi3zaKhxy6TMe+0DPNU1zBvvLFKsgdfN4Ck4LNGhnW0CpYcgRE mdzyO/Ha9ITAAd84jXijoFHaM9QleQPYATtna13/I/VA3AuPupxCnTk X-Developer-Key: i=aweber.kernel@gmail.com; a=ed25519; pk=RhDBfWbJEHqDibXbhNEBAnc9FMkyznGxX/hwfhL8bv8= X-MailFrom: aweber.kernel@gmail.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1 Message-ID-Hash: IEMOWRFHM2JVN5PF2BBZZZMGOJKUJ4RF X-Message-ID-Hash: IEMOWRFHM2JVN5PF2BBZZZMGOJKUJ4RF X-Mailman-Approved-At: Mon, 20 May 2024 13:56:00 +0000 X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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 Sun May 19 08:17:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artur Weber X-Patchwork-Id: 797983 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (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 EA633C25B78 for ; Mon, 20 May 2024 13:57:02 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id F3663852; Mon, 20 May 2024 15:56:50 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz F3663852 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1716213421; bh=EKY+Hy6LBgA2NYrAxNKes2DxchRh15GEYQsulR1Ud3E=; h=From:Date:Subject:References:In-Reply-To:To:Cc:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=padYKMBZfUFEXvHPA4+MOVhRByEuurylhSXM7CSFVB6ZEFyv9jLlnwl3p7IQUpCVg 0wqg2Uv5nvraaR+ABiEiZbESnfe4oAoMc/g7fo0LvCwIzLJcEa972tdLGiTUoBdAK8 2MSa7y/jPphG25l9jR4SRWVPTAqd5kmlpDLwlF+E= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8D274F805FE; Mon, 20 May 2024 15:56:09 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 0D0E4F805FF; Mon, 20 May 2024 15:56:09 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2EA83F805B3; Mon, 20 May 2024 15:34:26 +0200 (CEST) Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 18268F80588 for ; Mon, 20 May 2024 15:34:19 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 18268F80588 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=imw+8wtW Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-420298ff5b1so27946545e9.1 for ; Mon, 20 May 2024 06:34:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716212058; x=1716816858; darn=alsa-project.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=WZHcFtW9++T8RHFOp1RN6v1q8xOqk7qAzG9FoGfpxU8=; b=imw+8wtW7SZI6nHkpUY+pukMdTvXE0JxLRpSAdqUXwY16cPEESo7G4SAHqy6vSb0GU Cqdu1X14clPKAB2lH6wIgnarB/whjw0fMBO0Ojf+d394tg8NVg9pwOjDqqsAJGhjpwGE cwg38GJtflepcsa473zveQYpX+KxaFiR9Amlw2RhWyfkL34lUM8Pw5IB/91BsxHXjAHL fl9dZEVDl4OsaUiNvLAYpGG5rLM7ef4u/AfaEucp1/BlUSXZIYP8SsP8x5bUMaGevprI ElvaYZ+tFkOlFRn4fknkPOEarp8oqvUcx+sTVdu25RKoTczT4WB/wameKjm3H4/0uzjU 7eoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716212058; x=1716816858; 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=WZHcFtW9++T8RHFOp1RN6v1q8xOqk7qAzG9FoGfpxU8=; b=IycIoX8UQSed2VYUWHEH47NGKYE7590GUsO1z9lBipAURDTJo8Po3Tph6t0T4CPIhm 0B8PQLEHPzbOzjWBekw3sj3pMu1LQWzu57bIJJXlR4pzDqvA/JjHqzzrSqr2Y0VyzK2f kfE4WdG2DlPEDgGyIwuMgfAt6Uw0PqAMCj64EpIFj6J/BkQeSV8De6HQ4f03UGKowiOH DswyE2Xifz0Mq8smdQ2qhSqooGJ8pwkPfJqg3kC1AAIWgtS3vQAgtXyM/CiZ5cGoZCAX uubIl4TI2aZGW9DrNEJdX8WE6NZJWoo6kMCyuY6xf3oPKW2UG5dpa2qjuq69yE9iQ+cC eRgg== X-Forwarded-Encrypted: i=1; AJvYcCWizBQPNRJx16Po+JL0HfoN9m7nK98x5l8xhHKf7xXUaosZlnXunyH4PzVmxLY1FjWLW44fwFYf44bDgGVVI7WoJgZojnL0g8F6uuI= X-Gm-Message-State: AOJu0YxRkOM0cBqcJcFmZw5wC0mYW/xntX68xhutKtM3pbPW91o85rcA gfDZgrdLT3f8CmVK0xtB6cFenO+Dyv94lwHrcJub8kQZTT0Soxmsj+h3XA== X-Google-Smtp-Source: AGHT+IHzAvK+rhsJq8Fp46ZI7QRqXTxhpYy+yG/cCF9GqQapzPdzcVtci17vQVRRgkNlN/TxSgrMKA== X-Received: by 2002:a50:d518:0:b0:575:2ccc:13c1 with SMTP id 4fb4d7f45d1cf-5752ccc14damr2537043a12.9.1716106699861; Sun, 19 May 2024 01:18:19 -0700 (PDT) Received: from hex.my.domain (83.8.125.62.ipv4.supernova.orange.pl. [83.8.125.62]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5733c34e5ccsm13698518a12.95.2024.05.19.01.18.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 May 2024 01:18:19 -0700 (PDT) From: Artur Weber Date: Sun, 19 May 2024 10:17:54 +0200 Subject: [PATCH v3 8/8] ARM: dts: samsung: exynos4212-tab3: Drop interrupt from WM1811 codec MIME-Version: 1.0 Message-Id: <20240519-midas-wm1811-gpio-jack-v3-8-0c1736144c0e@gmail.com> References: <20240519-midas-wm1811-gpio-jack-v3-0-0c1736144c0e@gmail.com> In-Reply-To: <20240519-midas-wm1811-gpio-jack-v3-0-0c1736144c0e@gmail.com> To: Sylwester Nawrocki , Krzysztof Kozlowski Cc: Liam Girdwood , Mark Brown , Rob Herring , Conor Dooley , Jaroslav Kysela , Takashi Iwai , Alim Akhtar , alsa-devel@alsa-project.org, linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Artur Weber X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1716106686; l=1130; i=aweber.kernel@gmail.com; s=20231030; h=from:subject:message-id; bh=EKY+Hy6LBgA2NYrAxNKes2DxchRh15GEYQsulR1Ud3E=; b=Nu8HOGw+ABK8etkGN/FIHwRrDIIaop4fIm35cS8IufNRyVktSGw+ltxRgukhX9pKr+Bmh5B/R wxogZ+n7q5vB3cE8+MeF9gE6ftpRyW72QbVAuVZlr+VUAeM/A16FXYw X-Developer-Key: i=aweber.kernel@gmail.com; a=ed25519; pk=RhDBfWbJEHqDibXbhNEBAnc9FMkyznGxX/hwfhL8bv8= X-MailFrom: aweber.kernel@gmail.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1 Message-ID-Hash: Y3FF5FOYCKSIWTG24O6LAS66PQNBFOBH X-Message-ID-Hash: Y3FF5FOYCKSIWTG24O6LAS66PQNBFOBH X-Mailman-Approved-At: Mon, 20 May 2024 13:56:00 +0000 X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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>;