linux-samsung-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] ASoC: dt-bindings: wlf,wm8960: Convert to dtschema
@ 2023-02-17 15:06 Krzysztof Kozlowski
  2023-02-17 15:06 ` [PATCH 2/3] arm64: dts: imx8mm-nitrogen-r2: fix WM8960 clock name Krzysztof Kozlowski
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Krzysztof Kozlowski @ 2023-02-17 15:06 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Rob Herring, Krzysztof Kozlowski,
	Alim Akhtar, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, -,
	Adrien Grassein, Randy Li, alsa-devel, devicetree, linux-kernel,
	linux-arm-kernel, linux-samsung-soc
  Cc: Krzysztof Kozlowski

Convert the Wolfson WM8960 audio codecs bindings to DT schema.

Changes against original binding:
1. Document clocks and clock-names - already present in DTS and used
   by Linux driver.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

---

One DTS warning still remains:
  uniphier-pxs2-gentil.dtb: wm8960@1a: Unevaluated properties are not allowed ('port@0' was unexpected)

I am not sure if this is correct usage of endpoints. I would assume the
codec should be used only as DAI.
---
 .../devicetree/bindings/sound/wlf,wm8960.yaml | 88 +++++++++++++++++++
 .../devicetree/bindings/sound/wm8960.txt      | 42 ---------
 2 files changed, 88 insertions(+), 42 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/sound/wlf,wm8960.yaml
 delete mode 100644 Documentation/devicetree/bindings/sound/wm8960.txt

diff --git a/Documentation/devicetree/bindings/sound/wlf,wm8960.yaml b/Documentation/devicetree/bindings/sound/wlf,wm8960.yaml
new file mode 100644
index 000000000000..ee8eba7f0104
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/wlf,wm8960.yaml
@@ -0,0 +1,88 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/wlf,wm8960.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Wolfson WM8960 audio codec
+
+maintainers:
+  - patches@opensource.cirrus.com
+
+properties:
+  compatible:
+    const: wlf,wm8960
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+
+  clock-names:
+    items:
+      - const: mclk
+
+  '#sound-dai-cells':
+    const: 0
+
+  wlf,capless:
+    type: boolean
+    description:
+      If present, OUT3 pin will be enabled and disabled together with HP_L and
+      HP_R pins in response to jack detect events.
+
+  wlf,gpio-cfg:
+    $ref: /schemas/types.yaml#/definitions/uint32-array
+    maxItems: 2
+    description: |
+      A list of GPIO configuration register values.
+       - gpio-cfg[0]: ALRCGPIO of R9 (Audio interface)
+       - gpio-cfg[1]: {GPIOPOL:GPIOSEL[2:0]} of R48 (Additional Control 4).
+
+  wlf,hp-cfg:
+    $ref: /schemas/types.yaml#/definitions/uint32-array
+    maxItems: 3
+    description: |
+      A list of headphone jack detect configuration register values:
+       - hp-cfg[0]: HPSEL[1:0] of R48 (Additional Control 4).
+       - hp-cfg[1]: {HPSWEN:HPSWPOL} of R24 (Additional Control 2).
+       - hp-cfg[2]: {TOCLKSEL:TOEN} of R23 (Additional Control 1).
+
+  wlf,shared-lrclk:
+    type: boolean
+    description:
+      If present, the LRCM bit of R24 (Additional control 2) gets set,
+      indicating that ADCLRC and DACLRC pins will be disabled only when ADC
+      (Left and Right) and DAC (Left and Right) are disabled.
+      When WM8960 works on synchronize mode and DACLRC pin is used to supply
+      frame clock, it will no frame clock for captrue unless enable DAC to
+      enable DACLRC pin. If shared-lrclk is present, no need to enable DAC for
+      captrue.
+
+required:
+  - compatible
+  - reg
+
+allOf:
+  - $ref: dai-common.yaml#
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        audio-codec@1a {
+            compatible = "wlf,wm8960";
+            reg = <0x1a>;
+            clocks = <&clks 0>;
+            clock-names = "mclk";
+            #sound-dai-cells = <0>;
+            wlf,hp-cfg = <3 2 3>;
+            wlf,gpio-cfg = <1 3>;
+            wlf,shared-lrclk;
+        };
+    };
diff --git a/Documentation/devicetree/bindings/sound/wm8960.txt b/Documentation/devicetree/bindings/sound/wm8960.txt
deleted file mode 100644
index 85d3b287108c..000000000000
--- a/Documentation/devicetree/bindings/sound/wm8960.txt
+++ /dev/null
@@ -1,42 +0,0 @@
-WM8960 audio CODEC
-
-This device supports I2C only.
-
-Required properties:
-
-  - compatible : "wlf,wm8960"
-
-  - reg : the I2C address of the device.
-
-Optional properties:
-  - wlf,shared-lrclk: This is a boolean property. If present, the LRCM bit of
-	R24 (Additional control 2) gets set, indicating that ADCLRC and DACLRC pins
-	will be disabled only when ADC (Left and Right) and DAC (Left and Right)
-	are disabled.
-	When wm8960 works on synchronize mode and DACLRC pin is used to supply
-	frame clock, it will no frame clock for captrue unless enable DAC to enable
-	DACLRC pin. If shared-lrclk is present, no need to enable DAC for captrue.
-
-  - wlf,capless: This is a boolean property. If present, OUT3 pin will be
-	enabled and disabled together with HP_L and HP_R pins in response to jack
-	detect events.
-
-  - wlf,hp-cfg: A list of headphone jack detect configuration register values.
-		The list must be 3 entries long.
-		hp-cfg[0]: HPSEL[1:0] of R48 (Additional Control 4).
-		hp-cfg[1]: {HPSWEN:HPSWPOL} of R24 (Additional Control 2).
-		hp-cfg[2]: {TOCLKSEL:TOEN} of R23 (Additional Control 1).
-
-  - wlf,gpio-cfg: A list of GPIO configuration register values.
-		  The list must be 2 entries long.
-		  gpio-cfg[0]: ALRCGPIO of R9 (Audio interface)
-		  gpio-cfg[1]: {GPIOPOL:GPIOSEL[2:0]} of R48 (Additional Control 4).
-
-Example:
-
-wm8960: codec@1a {
-	compatible = "wlf,wm8960";
-	reg = <0x1a>;
-
-	wlf,shared-lrclk;
-};
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/3] arm64: dts: imx8mm-nitrogen-r2: fix WM8960 clock name
  2023-02-17 15:06 [PATCH 1/3] ASoC: dt-bindings: wlf,wm8960: Convert to dtschema Krzysztof Kozlowski
@ 2023-02-17 15:06 ` Krzysztof Kozlowski
  2023-03-14  1:37   ` Shawn Guo
  2023-02-17 15:06 ` [PATCH 3/3] ARM: dts: exynos: fix WM8960 clock name in Itop Elite Krzysztof Kozlowski
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 8+ messages in thread
From: Krzysztof Kozlowski @ 2023-02-17 15:06 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Rob Herring, Krzysztof Kozlowski,
	Alim Akhtar, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, -,
	Adrien Grassein, Randy Li, alsa-devel, devicetree, linux-kernel,
	linux-arm-kernel, linux-samsung-soc
  Cc: Krzysztof Kozlowski, stable

The WM8960 Linux driver expects the clock to be named "mclk".  Otherwise
the clock will be ignored and not prepared/enabled by the driver.

Fixes: 40ba2eda0a7b ("arm64: dts: imx8mm-nitrogen-r2: add audio")
Cc: <stable@vger.kernel.org>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 arch/arm64/boot/dts/freescale/imx8mm-nitrogen-r2.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/freescale/imx8mm-nitrogen-r2.dts b/arch/arm64/boot/dts/freescale/imx8mm-nitrogen-r2.dts
index 6357078185ed..0e8f0d7161ad 100644
--- a/arch/arm64/boot/dts/freescale/imx8mm-nitrogen-r2.dts
+++ b/arch/arm64/boot/dts/freescale/imx8mm-nitrogen-r2.dts
@@ -247,7 +247,7 @@ wm8960: codec@1a {
 		compatible = "wlf,wm8960";
 		reg = <0x1a>;
 		clocks = <&clk IMX8MM_CLK_SAI1_ROOT>;
-		clock-names = "mclk1";
+		clock-names = "mclk";
 		wlf,shared-lrclk;
 		#sound-dai-cells = <0>;
 	};
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3/3] ARM: dts: exynos: fix WM8960 clock name in Itop Elite
  2023-02-17 15:06 [PATCH 1/3] ASoC: dt-bindings: wlf,wm8960: Convert to dtschema Krzysztof Kozlowski
  2023-02-17 15:06 ` [PATCH 2/3] arm64: dts: imx8mm-nitrogen-r2: fix WM8960 clock name Krzysztof Kozlowski
@ 2023-02-17 15:06 ` Krzysztof Kozlowski
  2023-03-06 11:39   ` (subset) " Krzysztof Kozlowski
  2023-02-20 10:17 ` [PATCH 1/3] ASoC: dt-bindings: wlf,wm8960: Convert to dtschema Charles Keepax
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 8+ messages in thread
From: Krzysztof Kozlowski @ 2023-02-17 15:06 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Rob Herring, Krzysztof Kozlowski,
	Alim Akhtar, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, -,
	Adrien Grassein, Randy Li, alsa-devel, devicetree, linux-kernel,
	linux-arm-kernel, linux-samsung-soc
  Cc: Krzysztof Kozlowski, stable

The WM8960 Linux driver expects the clock to be named "mclk".  Otherwise
the clock will be ignored and not prepared/enabled by the driver.

Cc: <stable@vger.kernel.org>
Fixes: 339b2fb36a67 ("ARM: dts: exynos: Add TOPEET itop elite based board")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 arch/arm/boot/dts/exynos4412-itop-elite.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/exynos4412-itop-elite.dts b/arch/arm/boot/dts/exynos4412-itop-elite.dts
index b596e997e451..6260da187e92 100644
--- a/arch/arm/boot/dts/exynos4412-itop-elite.dts
+++ b/arch/arm/boot/dts/exynos4412-itop-elite.dts
@@ -182,7 +182,7 @@ codec: audio-codec@1a {
 		compatible = "wlf,wm8960";
 		reg = <0x1a>;
 		clocks = <&pmu_system_controller 0>;
-		clock-names = "MCLK1";
+		clock-names = "mclk";
 		wlf,shared-lrclk;
 		#sound-dai-cells = <0>;
 	};
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/3] ASoC: dt-bindings: wlf,wm8960: Convert to dtschema
  2023-02-17 15:06 [PATCH 1/3] ASoC: dt-bindings: wlf,wm8960: Convert to dtschema Krzysztof Kozlowski
  2023-02-17 15:06 ` [PATCH 2/3] arm64: dts: imx8mm-nitrogen-r2: fix WM8960 clock name Krzysztof Kozlowski
  2023-02-17 15:06 ` [PATCH 3/3] ARM: dts: exynos: fix WM8960 clock name in Itop Elite Krzysztof Kozlowski
@ 2023-02-20 10:17 ` Charles Keepax
  2023-02-21 15:38 ` Rob Herring
  2023-03-06 13:31 ` (subset) " Mark Brown
  4 siblings, 0 replies; 8+ messages in thread
From: Charles Keepax @ 2023-02-20 10:17 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Liam Girdwood, Mark Brown, Rob Herring, Krzysztof Kozlowski,
	Alim Akhtar, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, -,
	Adrien Grassein, Randy Li, alsa-devel, devicetree, linux-kernel,
	linux-arm-kernel, linux-samsung-soc

On Fri, Feb 17, 2023 at 04:06:25PM +0100, Krzysztof Kozlowski wrote:
> Convert the Wolfson WM8960 audio codecs bindings to DT schema.
> 
> Changes against original binding:
> 1. Document clocks and clock-names - already present in DTS and used
>    by Linux driver.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> 
> ---

Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>

Thanks,
Charles

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/3] ASoC: dt-bindings: wlf,wm8960: Convert to dtschema
  2023-02-17 15:06 [PATCH 1/3] ASoC: dt-bindings: wlf,wm8960: Convert to dtschema Krzysztof Kozlowski
                   ` (2 preceding siblings ...)
  2023-02-20 10:17 ` [PATCH 1/3] ASoC: dt-bindings: wlf,wm8960: Convert to dtschema Charles Keepax
@ 2023-02-21 15:38 ` Rob Herring
  2023-03-06 13:31 ` (subset) " Mark Brown
  4 siblings, 0 replies; 8+ messages in thread
From: Rob Herring @ 2023-02-21 15:38 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Mark Brown, alsa-devel, Pengutronix Kernel Team, Randy Li,
	Shawn Guo, Fabio Estevam, Alim Akhtar, linux-kernel,
	Liam Girdwood, Rob Herring, linux-arm-kernel, Sascha Hauer,
	devicetree, linux-samsung-soc, NXP Linux Team,
	Krzysztof Kozlowski, Adrien Grassein, -


On Fri, 17 Feb 2023 16:06:25 +0100, Krzysztof Kozlowski wrote:
> Convert the Wolfson WM8960 audio codecs bindings to DT schema.
> 
> Changes against original binding:
> 1. Document clocks and clock-names - already present in DTS and used
>    by Linux driver.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> 
> ---
> 
> One DTS warning still remains:
>   uniphier-pxs2-gentil.dtb: wm8960@1a: Unevaluated properties are not allowed ('port@0' was unexpected)
> 
> I am not sure if this is correct usage of endpoints. I would assume the
> codec should be used only as DAI.
> ---
>  .../devicetree/bindings/sound/wlf,wm8960.yaml | 88 +++++++++++++++++++
>  .../devicetree/bindings/sound/wm8960.txt      | 42 ---------
>  2 files changed, 88 insertions(+), 42 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/sound/wlf,wm8960.yaml
>  delete mode 100644 Documentation/devicetree/bindings/sound/wm8960.txt
> 

Reviewed-by: Rob Herring <robh@kernel.org>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: (subset) [PATCH 3/3] ARM: dts: exynos: fix WM8960 clock name in Itop Elite
  2023-02-17 15:06 ` [PATCH 3/3] ARM: dts: exynos: fix WM8960 clock name in Itop Elite Krzysztof Kozlowski
@ 2023-03-06 11:39   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 8+ messages in thread
From: Krzysztof Kozlowski @ 2023-03-06 11:39 UTC (permalink / raw)
  To: devicetree, Fabio Estevam, Randy Li, linux-kernel,
	Krzysztof Kozlowski, Pengutronix Kernel Team, -,
	Adrien Grassein, Shawn Guo, Liam Girdwood, Mark Brown,
	NXP Linux Team, linux-arm-kernel, Krzysztof Kozlowski,
	Sascha Hauer, linux-samsung-soc, Rob Herring, Alim Akhtar,
	alsa-devel
  Cc: stable

On Fri, 17 Feb 2023 16:06:27 +0100, Krzysztof Kozlowski wrote:
> The WM8960 Linux driver expects the clock to be named "mclk".  Otherwise
> the clock will be ignored and not prepared/enabled by the driver.
> 
> 

Applied, thanks!

[3/3] ARM: dts: exynos: fix WM8960 clock name in Itop Elite
      https://git.kernel.org/krzk/linux/c/6c950c20da38debf1ed531e0b972bd8b53d1c11f

Best regards,
-- 
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: (subset) [PATCH 1/3] ASoC: dt-bindings: wlf,wm8960: Convert to dtschema
  2023-02-17 15:06 [PATCH 1/3] ASoC: dt-bindings: wlf,wm8960: Convert to dtschema Krzysztof Kozlowski
                   ` (3 preceding siblings ...)
  2023-02-21 15:38 ` Rob Herring
@ 2023-03-06 13:31 ` Mark Brown
  4 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2023-03-06 13:31 UTC (permalink / raw)
  To: Liam Girdwood, Rob Herring, Krzysztof Kozlowski, Alim Akhtar,
	Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, -,
	Adrien Grassein, Randy Li, alsa-devel, devicetree, linux-kernel,
	linux-arm-kernel, linux-samsung-soc, Krzysztof Kozlowski

On Fri, 17 Feb 2023 16:06:25 +0100, Krzysztof Kozlowski wrote:
> Convert the Wolfson WM8960 audio codecs bindings to DT schema.
> 
> Changes against original binding:
> 1. Document clocks and clock-names - already present in DTS and used
>    by Linux driver.
> 
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/3] ASoC: dt-bindings: wlf,wm8960: Convert to dtschema
      commit: af5932fc58d351d3908d0a732ccabaef088311a0

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/3] arm64: dts: imx8mm-nitrogen-r2: fix WM8960 clock name
  2023-02-17 15:06 ` [PATCH 2/3] arm64: dts: imx8mm-nitrogen-r2: fix WM8960 clock name Krzysztof Kozlowski
@ 2023-03-14  1:37   ` Shawn Guo
  0 siblings, 0 replies; 8+ messages in thread
From: Shawn Guo @ 2023-03-14  1:37 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Liam Girdwood, Mark Brown, Rob Herring, Krzysztof Kozlowski,
	Alim Akhtar, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, -,
	Adrien Grassein, Randy Li, alsa-devel, devicetree, linux-kernel,
	linux-arm-kernel, linux-samsung-soc, stable

On Fri, Feb 17, 2023 at 04:06:26PM +0100, Krzysztof Kozlowski wrote:
> The WM8960 Linux driver expects the clock to be named "mclk".  Otherwise
> the clock will be ignored and not prepared/enabled by the driver.
> 
> Fixes: 40ba2eda0a7b ("arm64: dts: imx8mm-nitrogen-r2: add audio")
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Applied, thanks!

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-03-14  1:38 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-17 15:06 [PATCH 1/3] ASoC: dt-bindings: wlf,wm8960: Convert to dtschema Krzysztof Kozlowski
2023-02-17 15:06 ` [PATCH 2/3] arm64: dts: imx8mm-nitrogen-r2: fix WM8960 clock name Krzysztof Kozlowski
2023-03-14  1:37   ` Shawn Guo
2023-02-17 15:06 ` [PATCH 3/3] ARM: dts: exynos: fix WM8960 clock name in Itop Elite Krzysztof Kozlowski
2023-03-06 11:39   ` (subset) " Krzysztof Kozlowski
2023-02-20 10:17 ` [PATCH 1/3] ASoC: dt-bindings: wlf,wm8960: Convert to dtschema Charles Keepax
2023-02-21 15:38 ` Rob Herring
2023-03-06 13:31 ` (subset) " Mark Brown

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 NNTP newsgroup(s).