Commit 52100401 authored by Mark Brown's avatar Mark Brown

ASoC: samsung: midas-audio: Add GPIO-based headset

Merge series from Artur Weber <aweber.kernel@gmail.com>:

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.
parents e80613d6 255009d2
......@@ -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
......@@ -61,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
......
......@@ -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
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment