Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp416776lqo; Wed, 8 May 2024 04:02:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV3FNQgVaDTv60oGgz6fCisJGyXM8nNn6MchYlYgdgctY3IqwjtAZtqw2wd4lCiZVI6xPJfqXBNn20q/ozPLAHLbMoq2Hy3c2FKwZ2pdA== X-Google-Smtp-Source: AGHT+IE/o9pNsn2iQZvnv5e7mdYACPVXAKYc2AWK8I89Rvac5a+fA0R9GJyGTz5/Rs0lpvP1isQc X-Received: by 2002:a05:6830:12d4:b0:6ef:9794:b640 with SMTP id 46e09a7af769-6f0b7828682mr2183586a34.4.1715166130715; Wed, 08 May 2024 04:02:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715166130; cv=pass; d=google.com; s=arc-20160816; b=YC1G10Q/5sTWZiWYqPEuzcxVIoS1CbGgG10sL3iVbcLKsTiZjjsknjIa1uiDZQ3boZ m1CChb8coltVJjNMX7OjbSiEvu7rHtgQcPcOxaZf1VC6XP9Cl493cFqfF9i+siYtJlwo 2ZmoasveCxtJiG37VlYzAuiKePKr23GdNgeaCQ6DDkeDOVdYZXg8zm5h5Sm0ZpPL2sQg KFcx/+WJYReCKPFaWoN2IBJBuw8enewIZyQWVln9BYU4kVnDuE+X6SjelBuIYEIz0LE3 2ObYFrDBZT2crtQe/edVu/q0iXQZNtp7eWhjTO8koHXSAdq0idbMrT+m5YX0TNpeCuWJ KTRw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:from :dkim-signature; bh=nLUfxm5MoMUpMeCDhK5Bz2fJOiPFk2NnRkp477QVdeE=; fh=HqdCerbvvT7F163GAEYTNQQOBbkhkVvKvOzt/Naxh8M=; b=A8lZFHRmxIGMnjS6yGMmwJ7PPIJfaiWCRKr/d8ZIjBr1VjqAQ3CzDyR2ZMp33nzWYv MF2f4mSNVS/MvemiH9Ag+cRgi/LHbELetaNqrscoVrMg/rQw//PRGsVaoXMfjLLqJGdp gZPo2NNoG8viP5vqOBs/6qkEV0RebVFKVcSR0Zhm3sqZRwI7eHoDLPpALm9rQG8lL0RR +2JhjCusvMtqQoQ2YvtvZv6WRLw2XbrJDN7qHE816B7eoVXGp5FlJ2YSKL3yHk85x8Q9 bkNHf+Nmyfa6XrnHezX5vGDJv12GkuagMP/LAP/5duW1vd4h8dF4m3NbRGZCWwL8i50l hRAA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=DiZrZiHc; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-173095-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-173095-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id r10-20020a056830448a00b006ee05983a61si4776759otv.122.2024.05.08.04.02.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 04:02:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-173095-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=DiZrZiHc; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-173095-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-173095-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 529A2281117 for ; Wed, 8 May 2024 11:01:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A4FAE81AC1; Wed, 8 May 2024 11:01:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DiZrZiHc" Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DA15D81729; Wed, 8 May 2024 11:01:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715166083; cv=none; b=WA5JSc/ZoXyG8dg3t5lDMnvDECn6W1Gs/C29ouN/81USVvlG3r2m/LJoP3tEK6LajPLIdv3CFk/z6NElaEmSiEYzqQLoSM5NOHD+ffzb7FY7N/TH2HSFAN5bOBHXmpjl81FxIY9H3TRzqgkIIdVROzJbIypN2p1D+rDTA0UkUqw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715166083; c=relaxed/simple; bh=r5VX4FkZssbN7CluXLWuH6JvBu0lDlmJiHnKY2yOe2I=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=bmBRWEZ2sl3yvAp55n3FZ/sbub15tiadcsFt0uQ1Q/tKus4ghyHijl0M6b78RA9cfOMa0xqnu6bgIpPqACGzlTqJVfCSH4NN69+1tgZzeODlLJimCYWI/UBT1J6u01wnQy2U8qTBrxEG0c1lBb+kY2a9/l9ytL+PSO4Rjz4uM9o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=DiZrZiHc; arc=none smtp.client-ip=209.85.218.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej1-f45.google.com with SMTP id a640c23a62f3a-a599a298990so1136409466b.2; Wed, 08 May 2024 04:01:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715166078; x=1715770878; darn=vger.kernel.org; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=nLUfxm5MoMUpMeCDhK5Bz2fJOiPFk2NnRkp477QVdeE=; b=DiZrZiHcDaQMtrjjTnQfcgA1simWtdWIpeVRb5uC5N/iwhKmxyuevj6OuTacdaou2Z Vfeo4Apu6V+CZATp0kPDGuY6kZYp6kPULNH7rR8bxR4OSMp+OJ62+MCnXear690zV0Bm jPWLcm8S9yyZ9fgoqQuzESa9jsqwkA3/LUhvVb3geosY5TI+ZSkp53o4wKo9i/EsysgK bNXw2P+gwtmTvH0s/0V3X2wjUcKmP05DFTHS+I9Iq6H1phFEJzj7jMPWgdS8sA3DMs3l lJCmX6NfUQoL6odH8kJjx5GdIsOg3mww49+goSHmDOMoXCQ67mx3IZ1Zhx2+y7MxoRWu hxTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715166078; x=1715770878; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=nLUfxm5MoMUpMeCDhK5Bz2fJOiPFk2NnRkp477QVdeE=; b=FAkqUZQBQjRCGWsE/h4qiI9VqoC/z7UfSoriicx/iF7BBHw7rRRlsN+3k5I9qln7tt SBjAYAgEk3r4Aqf2y6mOSmyUc151pLlW2NGT6ljadAAqakzF2l2ntJ8sT8QnxeuHsLYH k85RningKtxhPb4+pn2QABbehej1pu7h0z6RC9K/KP/Ginoz9aG3Smr/AjBeaszPP0SM Wd6hzG0pDPSWLTQzVPZgplfDoaAOvA3RiVHtqnnQs8sF3G3PQdA7IQupmxdDdSSeH+7j 5Rri/LEgkfhFTIWzT7WBWsQZP/tLxHbCo/abzif9LKlwU093eNMdclXbk/KDu4mYm1PL XWcg== X-Forwarded-Encrypted: i=1; AJvYcCX8c7gbZh1ZO7799J1L/wGPvM0Ixu3gz5ucxrV/R1P4LyoBD/oZCg2ebYyXiC1d+vh8KjzZOGcSr2A0aBM3wXxA+Fec1PSBA3EZFw/Cq4+f72lYDo9cHmY1RgWPGl+8aIalPVoL4mn9vmztW0D8j2idKAgn5VX+5FQudPmriHeykd5vqXbFf09ydzimcmEO9dLytRYJHSYoTwqCtdqt5MaYW7FXjloL+Po= X-Gm-Message-State: AOJu0Yz4Kt0eIfkRR9rtrkBk4pS0H9e5dfCxdqxp4ZhiSOtGHiNZWanZ 1deSrXH+b9yNBAG6hiF3PpkvdT+FcOcmC2rXYDzKCrwahjcNPqKE99H4ng== X-Received: by 2002:a50:d5da:0:b0:572:32e4:daca with SMTP id 4fb4d7f45d1cf-5731d9f1f1emr1431811a12.25.1715166077915; Wed, 08 May 2024 04:01:17 -0700 (PDT) Received: from hex.my.domain (83.8.126.253.ipv4.supernova.orange.pl. [83.8.126.253]) by smtp.gmail.com with ESMTPSA id m6-20020a056402510600b005726b58a436sm7455793edd.30.2024.05.08.04.01.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 04:01:17 -0700 (PDT) From: Artur Weber Subject: [PATCH v2 0/7] ASoC: samsung: midas-audio: Add GPIO-based headset jack detection Date: Wed, 08 May 2024 12:58:48 +0200 Message-Id: <20240508-midas-wm1811-gpio-jack-v2-0-b4d36cd02c6e@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAOhaO2YC/3WNQQ6CMBBFr0K6dkynKhBX3MOwaKcFRi0lrUEN4 e5WEpcu30v++4tILrJL4lwsIrqZE4cxg9oVggY99g7YZhZKqqM8SQWerU7w9FgjQj9xgKumGxi USpUGK0ck8niKruPXFr60mQdOjxDf28+MX/tLHv4lZwQJriZrjS0rMl3Te833PQUv2nVdPxCQI ZG8AAAA 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=1715166076; l=2757; i=aweber.kernel@gmail.com; s=20231030; h=from:subject:message-id; bh=r5VX4FkZssbN7CluXLWuH6JvBu0lDlmJiHnKY2yOe2I=; b=efwB+kVCs/L/SZZaODuzZbKPTctk3zichDAOp2lR+DvHFC7GKEvMKy77JrMEeOY/zvUyB2G1z 5nECFtfNyNpAk5lJ8jrkQdC6RykE44TaxW2X4Fe0ZihcEigyUe8jgwR X-Developer-Key: i=aweber.kernel@gmail.com; a=ed25519; pk=RhDBfWbJEHqDibXbhNEBAnc9FMkyznGxX/hwfhL8bv8= Many of Samsung's Exynos 4 devices share the same midas-audio driver to handle the codec setup. While most of these devices, including the Midas itself, use the jack detection provided by the WM8994 driver, other devices such as the Samsung Galaxy Tab 3 8.0 (lt01) use two GPIOs and an ADC channel to determine jack insertion, the jack's type, and button presses (for headsets with volume up/down/play buttons). In the downstream kernel, this behavior is implemented in the sec-jack driver[1], and the per-device settings are configured in *-jack.c files in the mach folder (see e.g. the Tab 3's implementation[2]). This patchset implements this mechanism in the midas_wm1811.c driver, and adds new DTS options to allow for its configuration. It also enables jack detection for the Samsung Galaxy Tab 3 8.0. A very similar mechanism was already present in the aries_wm8994.c driver[3]; this implementation heavily borrows from it, though there are a few extra cleanups as well. Signed-off-by: Artur Weber [1] https://github.com/gr8nole/android_kernel_samsung_smdk4x12/blob/lineage-14.1/drivers/misc/sec_jack.c [2] https://github.com/gr8nole/android_kernel_samsung_smdk4x12/blob/lineage-14.1/arch/arm/mach-exynos/tab3-jack.c [3] https://github.com/torvalds/linux/blob/master/sound/soc/samsung/aries_wm8994.c --- Changes in v2: - Added vendor prefix to threshold properties - Added separate headset mic bias regulator - Changed some cases of dev_err + return with return dev_err_probe - Added an extra patch to replace some previous dev_err + return cases with dev_err_probe - Moved tab3 DTS wm1811 codec config changes to separate commit --- Artur Weber (7): ASoC: dt-bindings: samsung,midas-audio: Add headset mic bias supply ASoC: dt-bindings: samsung,midas-audio: Add GPIO-based headset jack detection ASoC: samsung: midas_wm1811: Add headset mic bias supply support ASoC: samsung: midas_wm1811: Add GPIO-based headset jack detection ASoC: samsung: midas_wm1811: Use dev_err_probe where appropriate ARM: dts: samsung: exynos4212-tab3: Fix headset mic, add jack detection ARM: dts: samsung: exynos4212-tab3: Fix up wm1811 codec config .../bindings/sound/samsung,midas-audio.yaml | 33 ++ arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi | 31 +- sound/soc/samsung/Kconfig | 2 +- sound/soc/samsung/midas_wm1811.c | 343 +++++++++++++++++++-- 4 files changed, 379 insertions(+), 30 deletions(-) --- base-commit: e67572cd2204894179d89bd7b984072f19313b03 change-id: 20240502-midas-wm1811-gpio-jack-b10226b17ecc Best regards, -- Artur Weber