Skip to contentSkip to conversation

Add the Renesas IDT821034 codec support

PATCH In review Herve Codina 2 participants 5 messages Jan 26, 2023 – Jan 31, 2023

Subsystems (5)
Device tree bindings Sound ASoC GPIO +1 more subsystems
lore
Share & tools
lore

Herve Codina

author maintainer
#0 lore raw

v3 cover Add the Renesas IDT821034 codec support

Hi,

The Renesas IDT821034 codec is four channel PCM codec with on-chip filters and programmable gain setting.
It also provides SLIC (Subscriber Line Interface Circuit) signals as GPIOs.

Based on previous iteration,
https://lore.kernel.org/linux-kernel/[email protected]/
this v3 series mainly:
- Fixes _put() methods
- Introduces and uses idt821034_2x8bit_write()
- Removes the '#if IS_ENABLED(CONFIG_GPIOLIB)' conditional

Best regards,
Herve Codina

Changes v2 -> v3:
- Patch 1
Fix the example node name.
Add 'Reviewed-by: Krzysztof Kozlowski <[email protected]>'

- Patch 2
Fix _put() methods return code.
Remove 'select REGMAP_SPI' from Kconfig Introduce and use idt821034_2x8bit_write() Remove the '#if IS_ENABLED(CONFIG_GPIOLIB)' conditional Fix comments and other minor code simplifications

Changes v1 -> v2:
- All patches
Reformat commit log

- Patch 1
Remove '$ref: /schemas/gpio/gpio.yaml#'
Use 'unevaluatedProperties: false'
Update the node name and remove the sound node in the example

- Patch 2
Change the file header comment format
Rework in order to remove the regmap virtual registers

Herve Codina (3):
dt-bindings: sound: Add Renesas IDT821034 codec
ASoC: codecs: Add support for the Renesas IDT821034 codec
MAINTAINERS: add the Renesas IDT821034 codec entry

 .../bindings/sound/renesas,idt821034.yaml     |   75 ++
 MAINTAINERS                                   |    7 +
 sound/soc/codecs/Kconfig                      |   11 +
 sound/soc/codecs/Makefile                     |    2 +
 sound/soc/codecs/idt821034.c                  | 1180 +++++++++++++++++
 5 files changed, 1275 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/renesas,idt821034.yaml
 create mode 100644 sound/soc/codecs/idt821034.c
Signature · 1 line
2.39.0
author maintainer
#1 lore raw

PATCH v3 1/3 dt-bindings: sound: Add Renesas IDT821034 codec

The Renesas IDT821034 codec is a quad PCM codec with programmable gain.

---
 .../bindings/sound/renesas,idt821034.yaml     | 75 +++++++++++++++++++
 1 file changed, 75 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/renesas,idt821034.yaml
Documentation/devicetree/bindings/sound/renesas,idt821034.yaml new file +75 -0
new file mode 100644
index 000000000000..a2b92dba5529
@@ -0,0 +1,75 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/renesas,idt821034.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Renesas IDT821034 codec device
+
+maintainers:
+  - Herve Codina <[email protected]>
+
+description: |
+  The IDT821034 codec is a four channel PCM codec with onchip filters and
+  programmable gain setting.
+
+  The time-slots used by the codec must be set and so, the properties
+  'dai-tdm-slot-num', 'dai-tdm-slot-width', 'dai-tdm-slot-tx-mask' and
+  'dai-tdm-slot-rx-mask' must be present in the ALSA sound card node for
+  sub-nodes that involve the codec. The codec uses one 8bit time-slot per
+  channel.
+  'dai-tdm-tdm-slot-with' must be set to 8.
+
+  The IDT821034 codec also supports 5 gpios (SLIC signals) per channel.
+
+allOf:
+  - $ref: /schemas/spi/spi-peripheral-props.yaml#
+  - $ref: dai-common.yaml#
+
+properties:
+  compatible:
+    const: renesas,idt821034
+
+  reg:
+    description:
+      SPI device address.
+    maxItems: 1
+
+  spi-max-frequency:
+    maximum: 8192000
+
+  spi-cpha: true
+
+  '#sound-dai-cells':
+    const: 0
+
+  '#gpio-cells':
+    const: 2
+
+  gpio-controller: true
+
+required:
+  - compatible
+  - reg
+  - spi-cpha
+  - '#sound-dai-cells'
+  - gpio-controller
+  - '#gpio-cells'
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    spi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        audio-codec@0 {
+            compatible = "renesas,idt821034";
+            reg = <0>;
+            spi-max-frequency = <8192000>;
+            spi-cpha;
+            #sound-dai-cells = <0>;
+            gpio-controller;
+            #gpio-cells = <2>;
+        };
+    };
Signature · 1 line
2.39.0
author maintainer
#2 lore raw

PATCH v3 2/3 ASoC: codecs: Add support for the Renesas IDT821034 codec

In reply to Herve Codina

The Renesas IDT821034 codec is four channel PCM codec with on-chip filters and programmable gain setting.
It also provides SLIC (Subscriber Line Interface Circuit) signals as GPIOs.

---
 sound/soc/codecs/Kconfig     |   11 +
 sound/soc/codecs/Makefile    |    2 +
 sound/soc/codecs/idt821034.c | 1180 ++++++++++++++++++++++++++++++++++
 3 files changed, 1193 insertions(+)
 create mode 100644 sound/soc/codecs/idt821034.c
sound/soc/codecs/Kconfig +11 -0
index 0f9d71490075..5531bf8d4b3f 100644
@@ -107,6 +107,7 @@ config SND_SOC_ALL_CODECS
 	imply SND_SOC_HDAC_HDMI
 	imply SND_SOC_HDAC_HDA
 	imply SND_SOC_ICS43432
+	imply SND_SOC_IDT821034
 	imply SND_SOC_INNO_RK3036
 	imply SND_SOC_ISABELLE
 	imply SND_SOC_JZ4740_CODEC
@@ -972,6 +973,16 @@ config SND_SOC_HDA
 config SND_SOC_ICS43432
 	tristate "ICS43423 and compatible i2s microphones"
 
+config SND_SOC_IDT821034
+	tristate "Renesas IDT821034 quad PCM codec"
+	depends on SPI
+	help
+	  Enable support for the Renesas IDT821034 quad PCM with
+	  programmable gain codec.
+
+	  To compile this driver as a module, choose M here: the module
+	  will be called snd-soc-idt821034.
+
 config SND_SOC_INNO_RK3036
 	tristate "Inno codec driver for RK3036 SoC"
 	select REGMAP_MMIO
sound/soc/codecs/Makefile +2 -0
index 71d3ce5867e4..bcf95de654fd 100644
@@ -111,6 +111,7 @@ snd-soc-hdac-hdmi-objs := hdac_hdmi.o
 snd-soc-hdac-hda-objs := hdac_hda.o
 snd-soc-hda-codec-objs := hda.o hda-dai.o
 snd-soc-ics43432-objs := ics43432.o
+snd-soc-idt821034-objs := idt821034.o
 snd-soc-inno-rk3036-objs := inno_rk3036.o
 snd-soc-isabelle-objs := isabelle.o
 snd-soc-jz4740-codec-objs := jz4740.o
@@ -472,6 +473,7 @@ obj-$(CONFIG_SND_SOC_HDAC_HDMI) += snd-soc-hdac-hdmi.o
 obj-$(CONFIG_SND_SOC_HDAC_HDA) += snd-soc-hdac-hda.o
 obj-$(CONFIG_SND_SOC_HDA) += snd-soc-hda-codec.o
 obj-$(CONFIG_SND_SOC_ICS43432)	+= snd-soc-ics43432.o
+obj-$(CONFIG_SND_SOC_IDT821034)	+= snd-soc-idt821034.o
 obj-$(CONFIG_SND_SOC_INNO_RK3036)	+= snd-soc-inno-rk3036.o
 obj-$(CONFIG_SND_SOC_ISABELLE)	+= snd-soc-isabelle.o
 obj-$(CONFIG_SND_SOC_JZ4740_CODEC)	+= snd-soc-jz4740-codec.o
sound/soc/codecs/idt821034.c new file +1180 -0

1,180 lines not on this page · raw message

Signature · 1 line
2.39.0
author maintainer
#3 lore raw

PATCH v3 3/3 MAINTAINERS: add the Renesas IDT821034 codec entry

In reply to Herve Codina

After contributing the driver, add myself as the maintainer for the Renesas IDT821034 codec.

---
 MAINTAINERS | 7 +++++++
 1 file changed, 7 insertions(+)
MAINTAINERS +7 -0
index 9dcfadec5aa3..31115a7e01c1 100644
@@ -17809,6 +17809,13 @@ F:	Documentation/devicetree/bindings/net/renesas,*.yaml
 F:	drivers/net/ethernet/renesas/
 F:	include/linux/sh_eth.h
 
+RENESAS IDT821034 ASoC CODEC
+M:	Herve Codina <[email protected]>
+L:	[email protected] (moderated for non-subscribers)
+S:	Maintained
+F:	Documentation/devicetree/bindings/sound/renesas,idt821034.yaml
+F:	sound/soc/codecs/idt821034.c
+
 RENESAS R-CAR GYROADC DRIVER
 M:	Marek Vasut <[email protected]>
 L:	[email protected]
Signature · 1 line
2.39.0
maintainer
#4 lore raw
In reply to Herve Codina
Quoted 5 lines · Herve Codina

The Renesas IDT821034 codec is four channel PCM codec with on-chip filters and programmable gain setting.
It also provides SLIC (Subscriber Line Interface Circuit) signals as GPIOs.

Quoted 8 lines

Based on previous iteration,
https://lore.kernel.org/linux-kernel/[email protected]/
this v3 series mainly:
- Fixes _put() methods
- Introduces and uses idt821034_2x8bit_write()
- Removes the '#if IS_ENABLED(CONFIG_GPIOLIB)' conditional

[...]

Applied to

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

Thanks!

[1/3] dt-bindings: sound: Add Renesas IDT821034 codec

      commit: 545679837eef1819aee3868fbb9dfced9a56de02
[2/3] ASoC: codecs: Add support for the Renesas IDT821034 codec
      commit: e51166990e81754d2cd30593558c3ff47fa49f15
[3/3] MAINTAINERS: add the Renesas IDT821034 codec entry
      commit: e60259f77c46a6b4733b20f1fb44547d67302c67

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