linux-sound.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Artur Weber <aweber.kernel@gmail.com>
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>
Subject: [PATCH v2 0/7] ASoC: samsung: midas-audio: Add GPIO-based headset jack detection
Date: Wed, 08 May 2024 12:58:48 +0200	[thread overview]
Message-ID: <20240508-midas-wm1811-gpio-jack-v2-0-b4d36cd02c6e@gmail.com> (raw)

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,
-- 
Artur Weber <aweber.kernel@gmail.com>


             reply	other threads:[~2024-05-08 11:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-08 10:58 Artur Weber [this message]
2024-05-08 10:58 ` [PATCH v2 1/7] ASoC: dt-bindings: samsung,midas-audio: Add headset mic bias supply Artur Weber
2024-05-08 10:58 ` [PATCH v2 2/7] ASoC: dt-bindings: samsung,midas-audio: Add GPIO-based headset jack detection Artur Weber
2024-05-08 12:52   ` Rob Herring (Arm)
2024-05-08 10:58 ` [PATCH v2 3/7] ASoC: samsung: midas_wm1811: Add headset mic bias supply support Artur Weber
2024-05-08 10:58 ` [PATCH v2 4/7] ASoC: samsung: midas_wm1811: Add GPIO-based headset jack detection Artur Weber
2024-05-08 10:58 ` [PATCH v2 5/7] ASoC: samsung: midas_wm1811: Use dev_err_probe where appropriate Artur Weber
2024-05-08 10:58 ` [PATCH v2 6/7] ARM: dts: samsung: exynos4212-tab3: Fix headset mic, add jack detection Artur Weber
2024-05-08 10:58 ` [PATCH v2 7/7] ARM: dts: samsung: exynos4212-tab3: Fix up wm1811 codec config Artur Weber
2024-05-09  7:13   ` Krzysztof Kozlowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240508-midas-wm1811-gpio-jack-v2-0-b4d36cd02c6e@gmail.com \
    --to=aweber.kernel@gmail.com \
    --cc=alim.akhtar@samsung.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=robh@kernel.org \
    --cc=s.nawrocki@samsung.com \
    --cc=tiwai@suse.com \
    --cc=~postmarketos/upstreaming@lists.sr.ht \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).