Skip to contentSkip to conversation

ASoC: cs4234: Add dtschema binding document

PATCH Superseded Richard Fitzgerald 2 participants 5 messages Sep 25, 2020

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Richard Fitzgerald

author maintainer
#0 lore raw

PATCH 1/3 ASoC: cs4234: Add dtschema binding document

From: Charles Keepax <[email protected]>

Document the bindings for the CS4234 ASoC codec driver.

---
 .../bindings/sound/cirrus,cs4234.yaml         | 74 +++++++++++++++++++
 1 file changed, 74 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/cirrus,cs4234.yaml
Documentation/devicetree/bindings/sound/cirrus,cs4234.yaml new file +74 -0
new file mode 100644
index 000000000000..156560b2a980
@@ -0,0 +1,74 @@
+# SPDX-License-Identifier: (GPL-2.0+ OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/cirrus,cs4234.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Cirrus Logic cs4234 audio CODEC
+
+maintainers:
+  - [email protected]
+
+description:
+  The CS4234 is a highly versatile CODEC that combines 4 channels of
+  high performance analog to digital conversion, 4 channels of high
+  performance digital to analog conversion for audio, and 1 channel of
+  digital to analog conversion to provide a nondelayed audio reference
+  signal to an external Class H tracking power supply. If not used to
+  drive a tracking power supply, the 5th DAC can instead be used as a
+  standard audio grade DAC, with performance specifications identical
+  to that of the 4 DACs in the audio path. Additionally, the CS4234
+  includes tunable group delay for each of the 4 audio DAC paths to
+  provide lead time for the external switch-mode power supply, and a
+  nondelayed path into the DAC outputs for input signals requiring a
+  low-latency path to the outputs.
+
+properties:
+  compatible:
+    enum:
+      - cirrus,cs4234
+
+  reg:
+    description:
+      The 7-bit I2C address depends on the state of the ADx pins, in
+      binary given by [0 0 1 0 AD2 AD1 AD0 0].
+    items:
+      minimum: 0x10
+      maximum: 0x17
+
+  VA-supply:
+    description:
+      Analogue power supply.
+
+  VL-supply:
+    description:
+      Interface power supply.
+
+  reset-gpios:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - VA-supply
+  - VL-supply
+
+additionalProperties: false
+
+examples:
+  - |
+    i2c@e0004000 {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        reg = <0xe0004000 0x1000>;
+
+        cs4234: codec@11 {
+            compatible = "cirrus,cs4234";
+            reg = <0x11>;
+
+            VA-supply = <&vdd3v3>;
+            VL-supply = <&vdd3v3>;
+
+            reset-gpios = <&gpio 0>;
+        };
+    };
Signature · 1 line
2.20.1
author maintainer
#1 lore raw

PATCH 2/3 ASoC: cs4234: Add support for Cirrus Logic CS4234 codec

From: Lucas Tanure <[email protected]>

The CS4234 is a highly versatile CODEC that combines 4 channels of high performance analog to digital conversion, 4 channels of high performance digital to analog conversion for audio, and 1 channel of digital to analog conversion to provide a nondelayed audio reference signal to an external Class H tracking power supply.

DAC5 is only supported as a 5th audio channel. Tracking Power Supply mode is not currently supported by the driver.

In DSP_A mode the slots for DAC1-4 and optionally DAC5 can be set. The codec always claims 4 slots for DAC1-4 and these must be in the same nibble of the mask. The codec has a fixed mapping for ADC slots.

In I2S/LJ modes the codec has a fixed mapping for DAC1-4 and ADC1-4. DAC5 is not available in these modes.

The MCLK source must be preset to a valid frequency before probe() because it must be running all the time the codec is out of reset.

The VA_SEL bit will be set automatically to 3.3v or 5v during probe() based on the reported voltage of the regulator supplying VA.

---
 sound/soc/codecs/Kconfig  |   7 +-
 sound/soc/codecs/Makefile |   2 +
 sound/soc/codecs/cs4234.c | 916 ++++++++++++++++++++++++++++++++++++++
 sound/soc/codecs/cs4234.h | 287 ++++++++++++
 4 files changed, 1211 insertions(+), 1 deletion(-)
 create mode 100644 sound/soc/codecs/cs4234.c
 create mode 100644 sound/soc/codecs/cs4234.h
sound/soc/codecs/Kconfig +6 -1
index af3b93cdb6c9..e1ea7d19a077 100644
@@ -64,6 +64,7 @@ config SND_SOC_ALL_CODECS
 	imply SND_SOC_CS42L52
 	imply SND_SOC_CS42L56
 	imply SND_SOC_CS42L73
+	imply SND_SOC_CS4234
 	imply SND_SOC_CS4265
 	imply SND_SOC_CS4270
 	imply SND_SOC_CS4271_I2C
@@ -282,7 +283,6 @@ config SND_SOC_ALL_CODECS
 	  uses them is also built since they are only usable with a machine
 	  driver.  Selecting this option will allow these drivers to be built
 	  without an explicit machine driver for test and development purposes.
-
 	  Support for the bus types used to access the codecs to be built must
 	  be selected separately.
 
@@ -592,6 +592,11 @@ config SND_SOC_CS42L73
 	tristate "Cirrus Logic CS42L73 CODEC"
 	depends on I2C
 
+config SND_SOC_CS4234
+	tristate "Cirrus Logic CS4234 CODEC"
+	depends on I2C
+	select REGMAP_I2C
+
 config SND_SOC_CS4265
 	tristate "Cirrus Logic CS4265 CODEC"
 	depends on I2C
sound/soc/codecs/Makefile +2 -0
index 2e5a79b55102..0404bc1ddcfb 100644
@@ -57,6 +57,7 @@ snd-soc-cs42l51-i2c-objs := cs42l51-i2c.o
 snd-soc-cs42l52-objs := cs42l52.o
 snd-soc-cs42l56-objs := cs42l56.o
 snd-soc-cs42l73-objs := cs42l73.o
+snd-soc-cs4234-objs := cs4234.o
 snd-soc-cs4265-objs := cs4265.o
 snd-soc-cs4270-objs := cs4270.o
 snd-soc-cs4271-objs := cs4271.o
@@ -364,6 +365,7 @@ obj-$(CONFIG_SND_SOC_CS42L51_I2C)	+= snd-soc-cs42l51-i2c.o
 obj-$(CONFIG_SND_SOC_CS42L52)	+= snd-soc-cs42l52.o
 obj-$(CONFIG_SND_SOC_CS42L56)	+= snd-soc-cs42l56.o
 obj-$(CONFIG_SND_SOC_CS42L73)	+= snd-soc-cs42l73.o
+obj-$(CONFIG_SND_SOC_CS4234)	+= snd-soc-cs4234.o
 obj-$(CONFIG_SND_SOC_CS4265)	+= snd-soc-cs4265.o
 obj-$(CONFIG_SND_SOC_CS4270)	+= snd-soc-cs4270.o
 obj-$(CONFIG_SND_SOC_CS4271)	+= snd-soc-cs4271.o
sound/soc/codecs/cs4234.c new file +916 -0

916 lines not on this page · raw message

sound/soc/codecs/cs4234.h new file +287 -0

287 lines not on this page · raw message

Signature · 1 line
2.20.1
maintainer
#2 lore raw

Re: [PATCH 2/3] ASoC: cs4234: Add support for Cirrus Logic CS4234 codec

On Fri, Sep 25, 2020 at 11:59:07AM +0100, Richard Fitzgerald wrote:

This looks very good, a couple of small nits below which should be easy to address:

sound/soc/codecs/Kconfig config SND_SOC_ALL_CODECS · line 288

Quoted 8 lines
sound/soc/codecs/Kconfig +0 -1
@@ -282,7 +283,6 @@ config SND_SOC_ALL_CODECS
 	  uses them is also built since they are only usable with a machine
 	  driver.  Selecting this option will allow these drivers to be built
 	  without an explicit machine driver for test and development purposes.
-
 	  Support for the bus types used to access the codecs to be built must
 	  be selected separately.
 

Unrelated whitespace change.

sound/soc/codecs/cs4234.c line 858

Quoted 6 lines
sound/soc/codecs/cs4234.c new file +6 -0
+static int cs4234_i2c_remove(struct i2c_client *i2c_client)
+{
+	struct cs4234 *cs4234 = i2c_get_clientdata(i2c_client);
+
+	pm_runtime_disable(&i2c_client->dev);
+	cs4234_shutdown(cs4234);

You used devm_snd_soc_register_component() which means that you won't unregister utill after this force powered down the device which isn't great - you should use snd_soc_register_component() and manually unregister here before force powering the device down.

author maintainer
#3 lore raw

PATCH 3/3 MAINTAINERS: Update Cirrus Logic Codecs maintainers

In reply to Richard Fitzgerald

Add [email protected] to the main group of Cirrus Logic ASoC codec drivers.

---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)
MAINTAINERS +1 -0
index d746519253c3..1d9a57d3992f 100644
@@ -4170,6 +4170,7 @@ CIRRUS LOGIC AUDIO CODEC DRIVERS
 M:	James Schulman <[email protected]>
 M:	David Rhodes <[email protected]>
 L:	[email protected] (moderated for non-subscribers)
+L:	[email protected]
 S:	Maintained
 F:	sound/soc/codecs/cs*
 
Signature · 1 line
2.20.1
maintainer
#4 lore raw
In reply to Richard Fitzgerald
Quoted 1 line · Richard Fitzgerald

Document the bindings for the CS4234 ASoC codec driver.

Applied to

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

Thanks!

[1/1] MAINTAINERS: Update Cirrus Logic Codecs maintainers

      commit: 6bf28e8a05fda0547658fd51d0acc83dcac6c703

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