* [PATCH v2 1/6] ASoC: dt-bindings: midas-audio: Declare required properties for GPIO jack det
2024-07-25 10:40 [PATCH v2 0/6] ASoC: samsung: midas_wm1811: Separate compatible for tab3 + fixes Artur Weber
@ 2024-07-25 10:40 ` Artur Weber
2024-07-30 16:05 ` Rob Herring (Arm)
2024-07-25 10:40 ` [PATCH v2 2/6] ASoC: dt-bindings: midas-audio: Add separate compatible for tab3 audio Artur Weber
` (4 subsequent siblings)
5 siblings, 1 reply; 8+ messages in thread
From: Artur Weber @ 2024-07-25 10:40 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Alim Akhtar
Cc: devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel,
linux-sound, ~postmarketos/upstreaming, Artur Weber
GPIO jack detection requires an IIO channel and the detection threshold
to work. Explicitly declare the requirement in DT schema.
Fixes: 0a590ecc672a ("ASoC: dt-bindings: samsung,midas-audio: Add GPIO-based headset jack detection")
Signed-off-by: Artur Weber <aweber.kernel@gmail.com>
---
Changes in v2:
- Use anyOf instead of oneOf in headset-detect-gpios/headset-key-gpios
if: statement
---
.../bindings/sound/samsung,midas-audio.yaml | 29 +++++++++++++++++++---
1 file changed, 26 insertions(+), 3 deletions(-)
diff --git a/Documentation/devicetree/bindings/sound/samsung,midas-audio.yaml b/Documentation/devicetree/bindings/sound/samsung,midas-audio.yaml
index 69ddfd4afdcd..5483421a6fd3 100644
--- a/Documentation/devicetree/bindings/sound/samsung,midas-audio.yaml
+++ b/Documentation/devicetree/bindings/sound/samsung,midas-audio.yaml
@@ -9,9 +9,6 @@ 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
@@ -102,6 +99,32 @@ required:
- mic-bias-supply
- submic-bias-supply
+allOf:
+ - $ref: sound-card-common.yaml#
+
+ - if:
+ anyOf:
+ - required: [ headset-detect-gpios ]
+ - required: [ headset-key-gpios ]
+ then:
+ required:
+ - io-channels
+ - io-channel-names
+
+ - if:
+ required:
+ - headset-detect-gpios
+ then:
+ required:
+ - samsung,headset-4pole-threshold-microvolt
+
+ - if:
+ required:
+ - headset-key-gpios
+ then:
+ required:
+ - samsung,headset-button-threshold-microvolt
+
unevaluatedProperties: false
examples:
--
2.45.2
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH v2 1/6] ASoC: dt-bindings: midas-audio: Declare required properties for GPIO jack det
2024-07-25 10:40 ` [PATCH v2 1/6] ASoC: dt-bindings: midas-audio: Declare required properties for GPIO jack det Artur Weber
@ 2024-07-30 16:05 ` Rob Herring (Arm)
0 siblings, 0 replies; 8+ messages in thread
From: Rob Herring (Arm) @ 2024-07-30 16:05 UTC (permalink / raw)
To: Artur Weber
Cc: devicetree, Krzysztof Kozlowski, Conor Dooley, linux-samsung-soc,
linux-kernel, Alim Akhtar, ~postmarketos/upstreaming,
linux-sound, linux-arm-kernel
On Thu, 25 Jul 2024 12:40:35 +0200, Artur Weber wrote:
> GPIO jack detection requires an IIO channel and the detection threshold
> to work. Explicitly declare the requirement in DT schema.
>
> Fixes: 0a590ecc672a ("ASoC: dt-bindings: samsung,midas-audio: Add GPIO-based headset jack detection")
> Signed-off-by: Artur Weber <aweber.kernel@gmail.com>
> ---
> Changes in v2:
> - Use anyOf instead of oneOf in headset-detect-gpios/headset-key-gpios
> if: statement
> ---
> .../bindings/sound/samsung,midas-audio.yaml | 29 +++++++++++++++++++---
> 1 file changed, 26 insertions(+), 3 deletions(-)
>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 2/6] ASoC: dt-bindings: midas-audio: Add separate compatible for tab3 audio
2024-07-25 10:40 [PATCH v2 0/6] ASoC: samsung: midas_wm1811: Separate compatible for tab3 + fixes Artur Weber
2024-07-25 10:40 ` [PATCH v2 1/6] ASoC: dt-bindings: midas-audio: Declare required properties for GPIO jack det Artur Weber
@ 2024-07-25 10:40 ` Artur Weber
2024-07-25 10:40 ` [PATCH v2 3/6] ARM: dts: samsung: exynos4212-tab3: Fix headset mic, add jack detection Artur Weber
` (3 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Artur Weber @ 2024-07-25 10:40 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Alim Akhtar
Cc: devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel,
linux-sound, ~postmarketos/upstreaming, Artur Weber,
Krzysztof Kozlowski
Unlike the Midas, the Galaxy Tab 3 8.0 does not have a main/sub mic
bias regulator, but it does have a separate headset mic bias regulator.
Add a new compatible for the Tab 3's audio and declare required
regulators separately based on the provided compatible.
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Artur Weber <aweber.kernel@gmail.com>
---
.../bindings/sound/samsung,midas-audio.yaml | 30 +++++++++++++++++++---
1 file changed, 27 insertions(+), 3 deletions(-)
diff --git a/Documentation/devicetree/bindings/sound/samsung,midas-audio.yaml b/Documentation/devicetree/bindings/sound/samsung,midas-audio.yaml
index 5483421a6fd3..cb6105a6b216 100644
--- a/Documentation/devicetree/bindings/sound/samsung,midas-audio.yaml
+++ b/Documentation/devicetree/bindings/sound/samsung,midas-audio.yaml
@@ -11,7 +11,11 @@ maintainers:
properties:
compatible:
- const: samsung,midas-audio
+ oneOf:
+ - const: samsung,midas-audio
+ - items:
+ - const: samsung,tab3-audio
+ - const: samsung,midas-audio
cpu:
type: object
@@ -96,8 +100,6 @@ required:
- cpu
- codec
- audio-routing
- - mic-bias-supply
- - submic-bias-supply
allOf:
- $ref: sound-card-common.yaml#
@@ -125,6 +127,28 @@ allOf:
required:
- samsung,headset-button-threshold-microvolt
+ - if:
+ properties:
+ compatible:
+ const: samsung,midas-audio
+
+ then:
+ required:
+ - mic-bias-supply
+ - submic-bias-supply
+
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: samsung,tab3-audio
+
+ then:
+ required:
+ - headset-mic-bias-supply
+ - headset-detect-gpios
+ - headset-key-gpios
+
unevaluatedProperties: false
examples:
--
2.45.2
^ permalink raw reply [flat|nested] 8+ messages in thread* [PATCH v2 3/6] ARM: dts: samsung: exynos4212-tab3: Fix headset mic, add jack detection
2024-07-25 10:40 [PATCH v2 0/6] ASoC: samsung: midas_wm1811: Separate compatible for tab3 + fixes Artur Weber
2024-07-25 10:40 ` [PATCH v2 1/6] ASoC: dt-bindings: midas-audio: Declare required properties for GPIO jack det Artur Weber
2024-07-25 10:40 ` [PATCH v2 2/6] ASoC: dt-bindings: midas-audio: Add separate compatible for tab3 audio Artur Weber
@ 2024-07-25 10:40 ` Artur Weber
2024-07-25 10:40 ` [PATCH v2 4/6] ARM: dts: samsung: exynos4212-tab3: Add MCLK2 clock to WM1811 codec config Artur Weber
` (2 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Artur Weber @ 2024-07-25 10:40 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Alim Akhtar
Cc: devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel,
linux-sound, ~postmarketos/upstreaming, Artur Weber
Set up headset mic bias regulator and add the necessary properties to
the samsung,midas-audio node to allow for headset jack detection.
Signed-off-by: Artur Weber <aweber.kernel@gmail.com>
---
Changes in v2:
- Move headset-mic-bias-supply property next to other headset properties
---
arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi b/arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi
index 9bc05961577d..bbafd4ece5f7 100644
--- a/arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi
+++ b/arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi
@@ -300,12 +300,31 @@ submic_bias_reg: voltage-regulator-5 {
regulator-max-microvolt = <2800000>;
};
+ earmic_bias_reg: voltage-regulator-6 {
+ compatible = "regulator-fixed";
+ regulator-name = "EAR_MICBIAS_LDO_2.8V";
+ regulator-min-microvolt = <2800000>;
+ regulator-max-microvolt = <2800000>;
+ gpio = <&gpm0 0 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ };
+
sound: sound {
compatible = "samsung,midas-audio";
model = "TAB3";
mic-bias-supply = <&mic_bias_reg>;
submic-bias-supply = <&submic_bias_reg>;
+ lineout-sel-gpios = <&gpj1 2 GPIO_ACTIVE_HIGH>;
+
+ headset-mic-bias-supply = <&earmic_bias_reg>;
+ headset-detect-gpios = <&gpx0 4 GPIO_ACTIVE_LOW>;
+ headset-key-gpios = <&gpx3 6 GPIO_ACTIVE_LOW>;
+ samsung,headset-4pole-threshold-microvolt = <710 2000>;
+ samsung,headset-button-threshold-microvolt = <0 130 260>;
+ io-channel-names = "headset-detect";
+ io-channels = <&adc 0>;
+
audio-routing = "HP", "HPOUT1L",
"HP", "HPOUT1R",
@@ -351,6 +370,11 @@ wlan_pwrseq: sdhci3-pwrseq {
};
};
+&adc {
+ vdd-supply = <&ldo3_reg>;
+ status = "okay";
+};
+
&bus_acp {
devfreq = <&bus_dmc>;
status = "okay";
--
2.45.2
^ permalink raw reply [flat|nested] 8+ messages in thread* [PATCH v2 4/6] ARM: dts: samsung: exynos4212-tab3: Add MCLK2 clock to WM1811 codec config
2024-07-25 10:40 [PATCH v2 0/6] ASoC: samsung: midas_wm1811: Separate compatible for tab3 + fixes Artur Weber
` (2 preceding siblings ...)
2024-07-25 10:40 ` [PATCH v2 3/6] ARM: dts: samsung: exynos4212-tab3: Fix headset mic, add jack detection Artur Weber
@ 2024-07-25 10:40 ` Artur Weber
2024-07-25 10:40 ` [PATCH v2 5/6] ARM: dts: samsung: exynos4212-tab3: Drop interrupt from WM1811 codec Artur Weber
2024-07-25 10:40 ` [PATCH v2 6/6] ARM: dts: samsung: exynos4212-tab3: Drop dummy mic bias regulators Artur Weber
5 siblings, 0 replies; 8+ messages in thread
From: Artur Weber @ 2024-07-25 10:40 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Alim Akhtar
Cc: devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel,
linux-sound, ~postmarketos/upstreaming, Artur Weber
In the schematics, the MCLK2 pin is shown as connected to CODEC_CLK32K,
which is derived from the same 32KHZ_PMIC clock as Bluetooth/WiFi and
GPS clocks. 32KHZ_PMIC is connected to the BTCLK pin, represented in
mainline as S2MPS11_CLK_BT.
Add the MCLK2 clock to the WM1811 codec clock property to properly
describe the hardware.
Signed-off-by: Artur Weber <aweber.kernel@gmail.com>
---
arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi b/arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi
index bbafd4ece5f7..5106bb752b7d 100644
--- a/arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi
+++ b/arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi
@@ -535,8 +535,9 @@ &i2c_4 {
wm1811: audio-codec@1a {
compatible = "wlf,wm1811";
reg = <0x1a>;
- clocks = <&pmu_system_controller 0>;
- clock-names = "MCLK1";
+ clocks = <&pmu_system_controller 0>,
+ <&s5m8767_osc S2MPS11_CLK_BT>;
+ clock-names = "MCLK1", "MCLK2";
interrupt-controller;
#interrupt-cells = <2>;
interrupt-parent = <&gpx3>;
--
2.45.2
^ permalink raw reply [flat|nested] 8+ messages in thread* [PATCH v2 5/6] ARM: dts: samsung: exynos4212-tab3: Drop interrupt from WM1811 codec
2024-07-25 10:40 [PATCH v2 0/6] ASoC: samsung: midas_wm1811: Separate compatible for tab3 + fixes Artur Weber
` (3 preceding siblings ...)
2024-07-25 10:40 ` [PATCH v2 4/6] ARM: dts: samsung: exynos4212-tab3: Add MCLK2 clock to WM1811 codec config Artur Weber
@ 2024-07-25 10:40 ` Artur Weber
2024-07-25 10:40 ` [PATCH v2 6/6] ARM: dts: samsung: exynos4212-tab3: Drop dummy mic bias regulators Artur Weber
5 siblings, 0 replies; 8+ messages in thread
From: Artur Weber @ 2024-07-25 10:40 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Alim Akhtar
Cc: devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel,
linux-sound, ~postmarketos/upstreaming, Artur Weber
This was initially copied from the Midas DTSI, but there is no
proof that the same interrupt is also used on the Tab 3. The pin
listed as the interrupt here is GPIO_HDMI_CEC on the Midas,
but for the Tab 3 it is the headset button GPIO - GPIO_EAR_SEND_END.
Drop the interrupt, since there is no proof that it is used.
Signed-off-by: Artur Weber <aweber.kernel@gmail.com>
---
arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi | 2 --
1 file changed, 2 deletions(-)
diff --git a/arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi b/arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi
index 5106bb752b7d..70e3091062f9 100644
--- a/arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi
+++ b/arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi
@@ -540,8 +540,6 @@ wm1811: audio-codec@1a {
clock-names = "MCLK1", "MCLK2";
interrupt-controller;
#interrupt-cells = <2>;
- interrupt-parent = <&gpx3>;
- interrupts = <6 IRQ_TYPE_LEVEL_HIGH>;
gpio-controller;
#gpio-cells = <2>;
--
2.45.2
^ permalink raw reply [flat|nested] 8+ messages in thread* [PATCH v2 6/6] ARM: dts: samsung: exynos4212-tab3: Drop dummy mic bias regulators
2024-07-25 10:40 [PATCH v2 0/6] ASoC: samsung: midas_wm1811: Separate compatible for tab3 + fixes Artur Weber
` (4 preceding siblings ...)
2024-07-25 10:40 ` [PATCH v2 5/6] ARM: dts: samsung: exynos4212-tab3: Drop interrupt from WM1811 codec Artur Weber
@ 2024-07-25 10:40 ` Artur Weber
5 siblings, 0 replies; 8+ messages in thread
From: Artur Weber @ 2024-07-25 10:40 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Alim Akhtar
Cc: devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel,
linux-sound, ~postmarketos/upstreaming, Artur Weber
Add the samsung,tab3-audio compatible that makes mic bias regulators
non-required, and drop the dummy main/sub mic bias regulators that
don't exist in hardware.
Signed-off-by: Artur Weber <aweber.kernel@gmail.com>
---
Changes in v2:
- Rename earmic bias reg node to voltage-regulator-4
---
arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi | 20 ++------------------
1 file changed, 2 insertions(+), 18 deletions(-)
diff --git a/arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi b/arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi
index 70e3091062f9..553ddc3d42da 100644
--- a/arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi
+++ b/arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi
@@ -286,21 +286,7 @@ display_3v3_supply: voltage-regulator-3 {
enable-active-high;
};
- mic_bias_reg: voltage-regulator-4 {
- compatible = "regulator-fixed";
- regulator-name = "MICBIAS_LDO_2.8V";
- regulator-min-microvolt = <2800000>;
- regulator-max-microvolt = <2800000>;
- };
-
- submic_bias_reg: voltage-regulator-5 {
- compatible = "regulator-fixed";
- regulator-name = "SUB_MICBIAS_LDO_2.8V";
- regulator-min-microvolt = <2800000>;
- regulator-max-microvolt = <2800000>;
- };
-
- earmic_bias_reg: voltage-regulator-6 {
+ earmic_bias_reg: voltage-regulator-4 {
compatible = "regulator-fixed";
regulator-name = "EAR_MICBIAS_LDO_2.8V";
regulator-min-microvolt = <2800000>;
@@ -310,10 +296,8 @@ earmic_bias_reg: voltage-regulator-6 {
};
sound: sound {
- compatible = "samsung,midas-audio";
+ compatible = "samsung,tab3-audio", "samsung,midas-audio";
model = "TAB3";
- mic-bias-supply = <&mic_bias_reg>;
- submic-bias-supply = <&submic_bias_reg>;
lineout-sel-gpios = <&gpj1 2 GPIO_ACTIVE_HIGH>;
--
2.45.2
^ permalink raw reply [flat|nested] 8+ messages in thread