~postmarketos/upstreaming

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
7 2

[PATCH v2 0/6] ASoC: samsung: midas_wm1811: Separate compatible for tab3 + fixes

Details
Message ID
<20240725-midas-audio-tab3-v2-0-dbc055c27879@gmail.com>
DKIM signature
pass
Download raw message
This is a follow-up to "ASoC: samsung: midas-audio: Add GPIO-based
headset jack detection"[1]; it appears to have been silently merged
except for the DTS parts, this patchset is a resend of the DTS patches.

Besides the DTS changes necessary to enable headset jack detection
for the Samsung Galaxy Tab 3 8.0, it also adds a new compatible for
the Tab 3 (samsung,tab3-audio). This is done so that we can set up
different requirements in DT binding (Tab 3 does not have main/sub
bias regulators), and drop the main/sub mic bias dummy regulators
from the Tab 3 DTSI.

[1] https://lore.kernel.org/all/20240525-midas-wm1811-gpio-jack-v4-0-f488e03bd8c7@gmail.com/

Signed-off-by: Artur Weber <aweber.kernel@gmail.com>
---
Changes in v2:
- Addressed review comments from Krzysztof (anyOf instead of oneOf in
  if: statement, fixed earmic_bias_reg node name to correct number,
  reorganized patches to move headset-mic-bias-supply property next to
  other headset properties in DTS)
- Link to v1: https://lore.kernel.org/r/20240716-midas-audio-tab3-v1-0-a53ea075af5a@gmail.com

---
Artur Weber (6):
      ASoC: dt-bindings: midas-audio: Declare required properties for GPIO jack det
      ASoC: dt-bindings: midas-audio: Add separate compatible for tab3 audio
      ARM: dts: samsung: exynos4212-tab3: Fix headset mic, add jack detection
      ARM: dts: samsung: exynos4212-tab3: Add MCLK2 clock to WM1811 codec config
      ARM: dts: samsung: exynos4212-tab3: Drop interrupt from WM1811 codec
      ARM: dts: samsung: exynos4212-tab3: Drop dummy mic bias regulators

 .../bindings/sound/samsung,midas-audio.yaml        | 59 +++++++++++++++++++---
 arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi     | 39 ++++++++------
 2 files changed, 76 insertions(+), 22 deletions(-)
---
base-commit: 91e3b24eb7d297d9d99030800ed96944b8652eaf
change-id: 20240715-midas-audio-tab3-174716e45618

Best regards,
-- 
Artur Weber <aweber.kernel@gmail.com>

[PATCH v2 1/6] ASoC: dt-bindings: midas-audio: Declare required properties for GPIO jack det

Details
Message ID
<20240725-midas-audio-tab3-v2-1-dbc055c27879@gmail.com>
In-Reply-To
<20240725-midas-audio-tab3-v2-0-dbc055c27879@gmail.com> (view parent)
DKIM signature
pass
Download raw message
Patch: +26 -3
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

[PATCH v2 2/6] ASoC: dt-bindings: midas-audio: Add separate compatible for tab3 audio

Details
Message ID
<20240725-midas-audio-tab3-v2-2-dbc055c27879@gmail.com>
In-Reply-To
<20240725-midas-audio-tab3-v2-0-dbc055c27879@gmail.com> (view parent)
DKIM signature
pass
Download raw message
Patch: +27 -3
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

[PATCH v2 3/6] ARM: dts: samsung: exynos4212-tab3: Fix headset mic, add jack detection

Details
Message ID
<20240725-midas-audio-tab3-v2-3-dbc055c27879@gmail.com>
In-Reply-To
<20240725-midas-audio-tab3-v2-0-dbc055c27879@gmail.com> (view parent)
DKIM signature
pass
Download raw message
Patch: +24 -0
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

[PATCH v2 4/6] ARM: dts: samsung: exynos4212-tab3: Add MCLK2 clock to WM1811 codec config

Details
Message ID
<20240725-midas-audio-tab3-v2-4-dbc055c27879@gmail.com>
In-Reply-To
<20240725-midas-audio-tab3-v2-0-dbc055c27879@gmail.com> (view parent)
DKIM signature
pass
Download raw message
Patch: +3 -2
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

[PATCH v2 5/6] ARM: dts: samsung: exynos4212-tab3: Drop interrupt from WM1811 codec

Details
Message ID
<20240725-midas-audio-tab3-v2-5-dbc055c27879@gmail.com>
In-Reply-To
<20240725-midas-audio-tab3-v2-0-dbc055c27879@gmail.com> (view parent)
DKIM signature
pass
Download raw message
Patch: +0 -2
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

[PATCH v2 6/6] ARM: dts: samsung: exynos4212-tab3: Drop dummy mic bias regulators

Details
Message ID
<20240725-midas-audio-tab3-v2-6-dbc055c27879@gmail.com>
In-Reply-To
<20240725-midas-audio-tab3-v2-0-dbc055c27879@gmail.com> (view parent)
DKIM signature
pass
Download raw message
Patch: +2 -18
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

Re: [PATCH v2 1/6] ASoC: dt-bindings: midas-audio: Declare required properties for GPIO jack det

Rob Herring (Arm) <robh@kernel.org>
Details
Message ID
<172235554875.1349313.9208770866983277057.robh@kernel.org>
In-Reply-To
<20240725-midas-audio-tab3-v2-1-dbc055c27879@gmail.com> (view parent)
DKIM signature
pass
Download raw message
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>
Reply to thread Export thread (mbox)