Skip to contentSkip to conversation

ASoC: add devicetree support for WM8961 codec

PATCH In review Doug Brown 4 participants 9 messages Oct 3, 2022 – Oct 18, 2022

Subsystems (4)
lore
Share & tools
lore

Doug Brown

author
#0 lore raw

v2 cover ASoC: add devicetree support for WM8961 codec

This series adds devicetree support for the Wolfson WM8961 codec. The first patch adds a schema, the second patch hooks it up in the code, and the third patch allows it to be selected in Kconfig.

Changes since v1:
- Fix ordering of property lists and example in schema
- Fix wording of commit message
- Fix unused variable warning
- Split Kconfig change to separate commit

Doug Brown (3):
ASoC: dt-bindings: add schema for WM8961
ASoC: wm8961: add support for devicetree
ASoC: codecs: allow WM8961 to be selected by the user

 .../devicetree/bindings/sound/wlf,wm8961.yaml | 40 +++++++++++++++++++
 sound/soc/codecs/Kconfig                      |  2 +-
 sound/soc/codecs/wm8961.c                     |  7 ++++
 3 files changed, 48 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/sound/wlf,wm8961.yaml
Signature · 1 line
2.34.1
author
#1 lore raw

PATCH v2 1/3 ASoC: dt-bindings: add schema for WM8961

Create a simple DT schema for the existing Wolfson WM8961 driver so that DT support can be added to the driver.

---
 .../devicetree/bindings/sound/wlf,wm8961.yaml | 40 +++++++++++++++++++
 1 file changed, 40 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/wlf,wm8961.yaml
Documentation/devicetree/bindings/sound/wlf,wm8961.yaml new file +40 -0
new file mode 100644
index 000000000000..795d34e1e97a
@@ -0,0 +1,40 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/wlf,wm8961.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Wolfson WM8961 Ultra-Low Power Stereo CODEC
+
+maintainers:
+  - [email protected]
+
+properties:
+  compatible:
+    const: wlf,wm8961
+
+  reg:
+    maxItems: 1
+
+  '#sound-dai-cells':
+    const: 0
+
+required:
+  - compatible
+  - reg
+  - '#sound-dai-cells'
+
+additionalProperties: false
+
+examples:
+  - |
+    i2c {
+          #address-cells = <1>;
+          #size-cells = <0>;
+
+          wm8961: codec@4a {
+                  compatible = "wlf,wm8961";
+                  reg = <0x4a>;
+                  #sound-dai-cells = <0>;
+          };
+    };
Signature · 1 line
2.34.1
author
#4 lore raw

PATCH v2 2/3 ASoC: wm8961: add support for devicetree

In reply to Doug Brown

Add support for devicetree to the WM8961 driver so it can be used with modern DT-based kernels.

---
 sound/soc/codecs/wm8961.c | 7 +++++++
 1 file changed, 7 insertions(+)
sound/soc/codecs/wm8961.c +7 -0
index 7dc6aaf65576..a4857024711d 100644
@@ -971,9 +971,16 @@ static const struct i2c_device_id wm8961_i2c_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, wm8961_i2c_id);
 
+static const struct of_device_id wm8961_of_match[] __maybe_unused = {
+	{ .compatible = "wlf,wm8961", },
+	{ }
+};
+MODULE_DEVICE_TABLE(of, wm8961_of_match);
+
 static struct i2c_driver wm8961_i2c_driver = {
 	.driver = {
 		.name = "wm8961",
+		.of_match_table = of_match_ptr(wm8961_of_match),
 	},
 	.probe_new = wm8961_i2c_probe,
 	.id_table = wm8961_i2c_id,
Signature · 1 line
2.34.1
author
#6 lore raw

PATCH v2 3/3 ASoC: codecs: allow WM8961 to be selected by the user

In reply to Doug Brown

Allow the WM8961 driver to be enabled independently now that it is usable with devicetree.

---
 sound/soc/codecs/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/Kconfig +1 -1
index e3b90c425faf..2b5787ee8d31 100644
@@ -1929,7 +1929,7 @@ config SND_SOC_WM8960
 	depends on I2C
 
 config SND_SOC_WM8961
-	tristate
+	tristate "Wolfson Microelectronics WM8961 CODEC"
 	depends on I2C
 
 config SND_SOC_WM8962
Signature · 1 line
2.34.1
maintainer
#8 lore raw
In reply to Doug Brown
Quoted 11 lines · Doug Brown

This series adds devicetree support for the Wolfson WM8961 codec. The first patch adds a schema, the second patch hooks it up in the code, and the third patch allows it to be selected in Kconfig.

Changes since v1:
- Fix ordering of property lists and example in schema
- Fix wording of commit message
- Fix unused variable warning
- Split Kconfig change to separate commit

[...]

Applied to

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

Thanks!

[1/3] ASoC: dt-bindings: add schema for WM8961

      commit: b9b0d88d87e5565e8d12bcf22ec601e8b4658dc6
[2/3] ASoC: wm8961: add support for devicetree
      commit: c96851ee8195c820b765c6a7effcec79c81eb9c6
[3/3] ASoC: codecs: allow WM8961 to be selected by the user
      commit: 74a6a948c8fc28c8937e24178739979b3cd2ce14

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