Message ID | 20240508-midas-wm1811-gpio-jack-v2-0-b4d36cd02c6e@gmail.com (mailing list archive) |
---|---|
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> 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 41870C19F4F for <linux-arm-kernel@archiver.kernel.org>; Wed, 8 May 2024 11:01: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:MIME-Version:Message-Id:Date: Subject:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=Rwa4gN08FA4fM3Q/3+dgok/m3d84cYtgmibARSHklIE=; b=yeUV90fWyK5jzu eVJVLSuB2H3dINWEC1zJZoBulYw4szPt5FUGusm8lGWcCUbZ+vx8B9eBizFHu1d4PJUUQ0xtSVs8I aVJ7ZQdOTYuKbCbVk76YntwhHN85DHNZxAFGeVy/8REqG0NMclE38mCg0NYaeAGhgW3LufYZ8krcr UQwniA4h8LvvSpdLjV7T94PONQNF6KAI61s9NkYD0rmzQyGAnnbqUdD9bBFBgMqbusrZGsAEWn8NQ 6ifU2fJsL6TaWkpdjLtEDT9e55RSj5xt1KcVSeSzepbPrFyrC6UG2dfD3wY+fqL1JYFAD/vqRA+0o 03jcX1gs55PF0Qq8dmGA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4f39-0000000F5yH-0NUf; Wed, 08 May 2024 11:01:27 +0000 Received: from mail-ej1-x62a.google.com ([2a00:1450:4864:20::62a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4f34-0000000F5vS-04M9 for linux-arm-kernel@lists.infradead.org; Wed, 08 May 2024 11:01:24 +0000 Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-a59b097b202so823800666b.0 for <linux-arm-kernel@lists.infradead.org>; Wed, 08 May 2024 04:01:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715166078; x=1715770878; darn=lists.infradead.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=bh9eQFKsbR4mYoCeoLAhSWiy8pLGnHOWJ/q/lwxlcyaMuuQLPluqJwfs3XtL+1B/Qv klcAOaobe04E0fe9OagyVlNvrAcmmL8dWQBrufVAEZW4w1obVFRDsr98QxOmbSduoMVW ftPlbYhLFL+V8FQq/f4D42bUv1RFFS0f7cn7IEtoWE+4SPFHYYaniIv2QB1aqnqTA7Co N9CkZl0YxQHZooAJLO/p2BCYZhQo6qNKmtU5mgMvaNngH27evmIutEJZClZfFOjzL0pB T4hrbaxtCrD8Zhjc2tyeMwxTw81NWmHB122bhMUCidVYQChbAoB4rJVjJKL2ugNLMQnP BHqQ== 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=CCbijj3KjWqrf/CPrg+m9GXeXbTrqdKBclVVgqwbLz9zZgo2MdKQ6sL2mmBJf2IMot wC4S3sp2NkqvE2FQ+xeK/6lzd+qWCyVzCKBMADyKBIA2tr1z8gqZPYkDNMlUHZuvtEIV zrBXXBPAolNwtkwSnkovl0EjHfNzanFwy2fyYcU2P9Jg9boxy5+Qio/pbolBxZPHAy2a 4dyHNaKWZ6ZaljaI3vCURt0PCTPXHtcw2KHlP8xX8EGvg0wUR3YD+mm5C88PTiugbKzD k7jCTCaokzi/aVIxUhz618Cyo+4PkwSPR5ue6TA3CjVgvCyav+lR8lREOkIJ/W56KJ6K L1kg== X-Forwarded-Encrypted: i=1; AJvYcCUJz/Q7oZzRXaRwyOav7Jc+pb3tJxeC52ymJZUhUbjLvkHXsxv2kpoZKjAH3pYi2X0vp4Us12vbv3SF99lV7mC8GcaiF03vSBZ+4pBXSWRQIwotqBU= X-Gm-Message-State: AOJu0YzFhzxfLjsqHBQycXsDLYu7EAG2jXIXHeyDtDSxlxDof+uGhbCQ zGvTLYYjjrgOUIb+BSSZEnyB8Hpuo/A6BD7azpsuWI1MvJ3/rpd+ X-Google-Smtp-Source: AGHT+IE8hv2zDJ3LkL3ncFxb3Ha6bL6EU12va4uVfT4eJ+Rn37xQs/HDgl9eOJT08amMnIDxyvOygA== 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 <aweber.kernel@gmail.com> 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> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAOhaO2YC/3WNQQ6CMBBFr0K6dkynKhBX3MOwaKcFRi0lrUEN4 e5WEpcu30v++4tILrJL4lwsIrqZE4cxg9oVggY99g7YZhZKqqM8SQWerU7w9FgjQj9xgKumGxi USpUGK0ck8niKruPXFr60mQdOjxDf28+MX/tLHv4lZwQJriZrjS0rMl3Te833PQUv2nVdPxCQI ZG8AAAA To: Sylwester Nawrocki <s.nawrocki@samsung.com>, Krzysztof Kozlowski <krzk+dt@kernel.org> Cc: Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>, Rob Herring <robh@kernel.org>, Conor Dooley <conor+dt@kernel.org>, Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>, Alim Akhtar <alim.akhtar@samsung.com>, 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 <aweber.kernel@gmail.com> 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= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240508_040122_113188_7F8E44DC X-CRM114-Status: GOOD ( 13.31 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
ASoC: samsung: midas-audio: Add GPIO-based headset jack detection
|
expand
|
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 <aweber.kernel@gmail.com> [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,