linux-loongson/Documentation/devicetree/bindings/sound/samsung,midas-audio.yaml
Artur Weber 0a590ecc67
ASoC: dt-bindings: samsung,midas-audio: Add GPIO-based headset jack detection
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 <aweber.kernel@gmail.com>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://msgid.link/r/20240525-midas-wm1811-gpio-jack-v4-2-f488e03bd8c7@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-05-29 13:45:41 +01:00

146 lines
3.5 KiB
YAML

# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/samsung,midas-audio.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Samsung Midas audio complex with WM1811 codec
maintainers:
- Sylwester Nawrocki <s.nawrocki@samsung.com>
allOf:
- $ref: sound-card-common.yaml#
properties:
compatible:
const: samsung,midas-audio
cpu:
type: object
additionalProperties: false
properties:
sound-dai:
maxItems: 1
description: phandle to the I2S controller
required:
- sound-dai
codec:
type: object
additionalProperties: false
properties:
sound-dai:
maxItems: 1
description: phandle to the WM1811 CODEC
required:
- sound-dai
samsung,audio-routing:
deprecated: true
$ref: /schemas/types.yaml#/definitions/non-unique-string-array
description: |
List of the connections between audio components; each entry is
a pair of strings, the first being the connection's sink, the second
being the connection's source; valid names for sources and sinks are
the WM1811's pins (as documented in its binding), and the jacks
on the board: HP, SPK, Main Mic, Sub Mic, Headset Mic.
Deprecated, use audio-routing.
mic-bias-supply:
description: Supply for the micbias on the Main microphone
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
lineout-sel-gpios:
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
- codec
- audio-routing
- mic-bias-supply
- submic-bias-supply
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/gpio/gpio.h>
sound {
compatible = "samsung,midas-audio";
model = "Midas";
fm-sel-gpios = <&gpaa0 3 GPIO_ACTIVE_HIGH>;
mic-bias-supply = <&mic_bias_reg>;
submic-bias-supply = <&submic_bias_reg>;
audio-routing =
"HP", "HPOUT1L",
"HP", "HPOUT1R",
"SPK", "SPKOUTLN",
"SPK", "SPKOUTLP",
"SPK", "SPKOUTRN",
"SPK", "SPKOUTRP",
"RCV", "HPOUT2N",
"RCV", "HPOUT2P",
"IN1LP", "Main Mic",
"IN1LN", "Main Mic",
"IN1RP", "Sub Mic",
"IN1LP", "Sub Mic";
cpu {
sound-dai = <&i2s0>;
};
codec {
sound-dai = <&wm1811>;
};
};