Skip to contentSkip to conversation

ASoC: Add Richtek rt9123 and rt9123p support

PATCH In review [email protected] 3 participants 8 messages Apr 10, 2025 – Apr 14, 2025

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v2 cover ASoC: Add Richtek rt9123 and rt9123p support

From: ChiYuan Huang <[email protected]>

This patch series adds Richtek rt9123 and rt9123p support. It's a 3.2W mono Class-D audio amplifier.

Since v2
[PATCH 2/4]
- include bitfield header file to fix kernel test robot issue
https://lore.kernel.org/oe-kbuild-all/[email protected]/
- Use #ifdef CONFIG_PM to only inlucde 'runtime_resume' and 'runtime_suspend', this will fix kernel test robot issue
https://lore.kernel.org/oe-kbuild-all/[email protected]/
- Check vendor-id before triggering SW_RST
- Fix 'SW_RST' write date non swap issue and add the wait delay for sw_reset
- Rename control name from 'SPK Gain Volume' to 'Speaker Volume'
- Change regmap cache type to _MAPLE
- Since ID check run once, to speed up regmap cache init, modify num_reg_defaults_raw from 0xf2 'COMBOID' to 0x36 'ANAFLAG'
- Add comments to describe why use pm runtime for RG special handling [PATCH 3/4]
- Modify the property name from 'enable-delay' to 'enable-delay-ms' to make the time unit more specific
[PATCH 4/4]
- Update the property parsing from 'enable-delay' to 'enable-delay-ms'

ChiYuan Huang (4):
ASoC: dt-bindings: Add bindings for Richtek rt9123
ASoC: codecs: Add support for Richtek rt9123
ASoC: dt-bindings: Add bindings for Richtek rt9123p
ASoC: codecs: Add support for Richtek rt9123p

 .../bindings/sound/richtek,rt9123.yaml        |  56 ++
 .../bindings/sound/richtek,rt9123p.yaml       |  48 ++
 sound/soc/codecs/Kconfig                      |  15 +
 sound/soc/codecs/Makefile                     |   4 +
 sound/soc/codecs/rt9123.c                     | 503 ++++++++++++++++++
 sound/soc/codecs/rt9123p.c                    | 171 ++++++
 6 files changed, 797 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/richtek,rt9123.yaml
 create mode 100644 Documentation/devicetree/bindings/sound/richtek,rt9123p.yaml
 create mode 100644 sound/soc/codecs/rt9123.c
 create mode 100644 sound/soc/codecs/rt9123p.c

base-commit: 0af2f6be1b4281385b618cb86ad946eded089ac8

Signature · 1 line
2.34.1
#1 lore raw

PATCH v2 1/4 ASoC: dt-bindings: Add bindings for Richtek rt9123

From: ChiYuan Huang <[email protected]>

Document the ASoC Richtek rt9123.

---
 .../bindings/sound/richtek,rt9123.yaml        | 56 +++++++++++++++++++
 1 file changed, 56 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/richtek,rt9123.yaml
Documentation/devicetree/bindings/sound/richtek,rt9123.yaml new file +56 -0
new file mode 100644
index 000000000000..5acb05cdfefd
@@ -0,0 +1,56 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/richtek,rt9123.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Richtek RT9123 Audio Amplifier
+
+maintainers:
+  - ChiYuan Huang <[email protected]>
+
+description:
+  RT9123 is a 3.2W mono Class-D audio amplifier that features high efficiency
+  and performance with ultra-low quiescent current. The digital audio interface
+  support various formats, including I2S, left-justified, right-justified, and
+  TDM formats.
+
+allOf:
+  - $ref: dai-common.yaml#
+
+properties:
+  compatible:
+    enum:
+      - richtek,rt9123
+
+  reg:
+    maxItems: 1
+
+  '#sound-dai-cells':
+    const: 0
+
+  enable-gpios:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - '#sound-dai-cells'
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        amplifier@5e {
+            compatible = "richtek,rt9123";
+            reg = <0x5e>;
+            enable-gpios = <&gpio 26 GPIO_ACTIVE_HIGH>;
+            #sound-dai-cells = <0>;
+        };
+    };
Signature · 1 line
2.34.1
maintainer Reviewed-by on v2 1/4
#2 lore raw

Re: [PATCH v2 1/4] ASoC: dt-bindings: Add bindings for Richtek rt9123

Quoted 9 lines · On Thu, Apr 10, 2025 at 08:58:10AM +0800, [email protected] wrote:

From: ChiYuan Huang <[email protected]>

Document the ASoC Richtek rt9123.

---
 .../bindings/sound/richtek,rt9123.yaml        | 56 +++++++++++++++++++
 1 file changed, 56 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/richtek,rt9123.yaml

If you re-spin, drop 'bindings for ' in the subject of both patches. No need to say 'bindings' twice.

#3 lore raw

PATCH v2 2/4 ASoC: codecs: Add support for Richtek rt9123

In reply to [email protected]

From: ChiYuan Huang <[email protected]>

Add codec driver for Richtek rt9123.

---
v2
- include bitfield header file to fix kernel test robot issue
https://lore.kernel.org/oe-kbuild-all/[email protected]/
- Use #ifdef CONFIG_PM to only inlucde 'runtime_resume' and 'runtime_suspend', this will fix kernel test robot issue
https://lore.kernel.org/oe-kbuild-all/[email protected]/
- Check vendor-id before triggering SW_RST
- Fix 'SW_RST' write date non swap issue and add the wait delay for sw_reset
- Rename control name from 'SPK Gain Volume' to 'Speaker Volume'
- Change regmap cache type to _MAPLE
- Since ID check run once, to speed up regmap cache init, modify num_reg_defaults_raw from 0xf2 'COMBOID' to 0x36 'ANAFLAG'
- Add comments to describe why use pm runtime for RG special handling

---
 sound/soc/codecs/Kconfig  |   9 +
 sound/soc/codecs/Makefile |   2 +
 sound/soc/codecs/rt9123.c | 503 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 514 insertions(+)
 create mode 100644 sound/soc/codecs/rt9123.c
sound/soc/codecs/Kconfig +9 -0
index 40bb7a1d44bc..c61b2d3cf284 100644
@@ -234,6 +234,7 @@ config SND_SOC_ALL_CODECS
 	imply SND_SOC_RT1318_SDW
 	imply SND_SOC_RT1320_SDW
 	imply SND_SOC_RT9120
+	imply SND_SOC_RT9123
 	imply SND_SOC_RTQ9128
 	imply SND_SOC_SDW_MOCKUP
 	imply SND_SOC_SGTL5000
@@ -1823,6 +1824,14 @@ config SND_SOC_RT9120
 	  Enable support for Richtek RT9120 20W, stereo, inductor-less,
 	  high-efficiency Class-D audio amplifier.
 
+config SND_SOC_RT9123
+	tristate "Richtek RT9123 Mono Class-D Amplifier"
+	depends on I2C
+	select REGMAP_I2C
+	help
+	  Enable support for the I2C control mode of Richtek RT9123 3.2W mono
+	  Class-D audio amplifier.
+
 config SND_SOC_RTQ9128
 	tristate "Richtek RTQ9128 45W Digital Input Amplifier"
 	depends on I2C
sound/soc/codecs/Makefile +2 -0
index 10f726066b6c..d8d0bc367af8 100644
@@ -270,6 +270,7 @@ snd-soc-rt715-sdca-y := rt715-sdca.o rt715-sdca-sdw.o
 snd-soc-rt721-sdca-y := rt721-sdca.o rt721-sdca-sdw.o
 snd-soc-rt722-sdca-y := rt722-sdca.o rt722-sdca-sdw.o
 snd-soc-rt9120-y := rt9120.o
+snd-soc-rt9123-y := rt9123.o
 snd-soc-rtq9128-y := rtq9128.o
 snd-soc-sdw-mockup-y := sdw-mockup.o
 snd-soc-sgtl5000-y := sgtl5000.o
@@ -684,6 +685,7 @@ obj-$(CONFIG_SND_SOC_RT715_SDCA_SDW)     += snd-soc-rt715-sdca.o
 obj-$(CONFIG_SND_SOC_RT721_SDCA_SDW)     += snd-soc-rt721-sdca.o
 obj-$(CONFIG_SND_SOC_RT722_SDCA_SDW)     += snd-soc-rt722-sdca.o
 obj-$(CONFIG_SND_SOC_RT9120)	+= snd-soc-rt9120.o
+obj-$(CONFIG_SND_SOC_RT9123)	+= snd-soc-rt9123.o
 obj-$(CONFIG_SND_SOC_RTQ9128)	+= snd-soc-rtq9128.o
 obj-$(CONFIG_SND_SOC_SDW_MOCKUP)     += snd-soc-sdw-mockup.o
 obj-$(CONFIG_SND_SOC_SGTL5000)  += snd-soc-sgtl5000.o
sound/soc/codecs/rt9123.c new file +503 -0

503 lines not on this page · raw message

Signature · 1 line
2.34.1
#4 lore raw

PATCH v2 3/4 ASoC: dt-bindings: Add bindings for Richtek rt9123p

In reply to [email protected]

From: ChiYuan Huang <[email protected]>

Document the ASoC Richtek rt9123p.

---
v2
- Modify the property name from 'enable-delay' to 'enable-delay-ms' to make the time unit more specific

---
 .../bindings/sound/richtek,rt9123p.yaml       | 48 +++++++++++++++++++
 1 file changed, 48 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/richtek,rt9123p.yaml
Documentation/devicetree/bindings/sound/richtek,rt9123p.yaml new file +48 -0
new file mode 100644
index 000000000000..693511dfdda4
@@ -0,0 +1,48 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/richtek,rt9123p.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Richtek RT9123P Audio Amplifier
+
+maintainers:
+  - ChiYuan Huang <[email protected]>
+
+description:
+  RT9123P is a RT9123 variant which does not support I2C control.
+
+allOf:
+  - $ref: dai-common.yaml#
+
+properties:
+  compatible:
+    enum:
+      - richtek,rt9123p
+
+  '#sound-dai-cells':
+    const: 0
+
+  enable-gpios:
+    maxItems: 1
+
+  enable-delay-ms:
+    description:
+      Delay time for 'ENABLE' pin changes intended to make I2S clocks ready to
+      prevent speaker pop noise. The unit is in millisecond.
+
+required:
+  - compatible
+  - '#sound-dai-cells'
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+
+    amplifier {
+        compatible = "richtek,rt9123p";
+        enable-gpios = <&gpio 26 GPIO_ACTIVE_HIGH>;
+        #sound-dai-cells = <0>;
+    };
Signature · 1 line
2.34.1
maintainer Reviewed-by on v2 3/4
#5 lore raw

Re: [PATCH v2 3/4] ASoC: dt-bindings: Add bindings for Richtek rt9123p

Quoted 5 lines · On Thu, 10 Apr 2025 08:58:12 +0800, [email protected] wrote:

From: ChiYuan Huang <[email protected]>

Document the ASoC Richtek rt9123p.

Quoted 9 lines

---
v2
- Modify the property name from 'enable-delay' to 'enable-delay-ms' to make the time unit more specific

---
 .../bindings/sound/richtek,rt9123p.yaml       | 48 +++++++++++++++++++
 1 file changed, 48 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/richtek,rt9123p.yaml
#6 lore raw

PATCH v2 4/4 ASoC: codecs: Add support for Richtek rt9123p

In reply to [email protected]

From: ChiYuan Huang <[email protected]>

Add codec driver for Richtek rt9123p.

---
v2
- Update the property parsing from 'enable-delay' to 'enable-delay-ms'

---
 sound/soc/codecs/Kconfig   |   6 ++
 sound/soc/codecs/Makefile  |   2 +
 sound/soc/codecs/rt9123p.c | 171 +++++++++++++++++++++++++++++++++++++
 3 files changed, 179 insertions(+)
 create mode 100644 sound/soc/codecs/rt9123p.c
sound/soc/codecs/Kconfig +6 -0
index c61b2d3cf284..b0fa935846c0 100644
@@ -1832,6 +1832,12 @@ config SND_SOC_RT9123
 	  Enable support for the I2C control mode of Richtek RT9123 3.2W mono
 	  Class-D audio amplifier.
 
+config SND_SOC_RT9123P
+	tristate "Richtek RT9123P Mono Class-D Amplifier"
+	help
+	  Enable support for the HW control mode of Richtek RT9123P 3.2W mono
+	  Class-D audio amplifier.
+
 config SND_SOC_RTQ9128
 	tristate "Richtek RTQ9128 45W Digital Input Amplifier"
 	depends on I2C
sound/soc/codecs/Makefile +2 -0
index d8d0bc367af8..fba699701804 100644
@@ -271,6 +271,7 @@ snd-soc-rt721-sdca-y := rt721-sdca.o rt721-sdca-sdw.o
 snd-soc-rt722-sdca-y := rt722-sdca.o rt722-sdca-sdw.o
 snd-soc-rt9120-y := rt9120.o
 snd-soc-rt9123-y := rt9123.o
+snd-soc-rt9123p-y := rt9123p.o
 snd-soc-rtq9128-y := rtq9128.o
 snd-soc-sdw-mockup-y := sdw-mockup.o
 snd-soc-sgtl5000-y := sgtl5000.o
@@ -686,6 +687,7 @@ obj-$(CONFIG_SND_SOC_RT721_SDCA_SDW)     += snd-soc-rt721-sdca.o
 obj-$(CONFIG_SND_SOC_RT722_SDCA_SDW)     += snd-soc-rt722-sdca.o
 obj-$(CONFIG_SND_SOC_RT9120)	+= snd-soc-rt9120.o
 obj-$(CONFIG_SND_SOC_RT9123)	+= snd-soc-rt9123.o
+obj-$(CONFIG_SND_SOC_RT9123P)	+= snd-soc-rt9123p.o
 obj-$(CONFIG_SND_SOC_RTQ9128)	+= snd-soc-rtq9128.o
 obj-$(CONFIG_SND_SOC_SDW_MOCKUP)     += snd-soc-sdw-mockup.o
 obj-$(CONFIG_SND_SOC_SGTL5000)  += snd-soc-sgtl5000.o
sound/soc/codecs/rt9123p.c new file +171 -0

171 lines not on this page · raw message

Signature · 1 line
2.34.1
maintainer
#7 lore raw
In reply to [email protected]
Quoted 23 lines · On Thu, 10 Apr 2025 08:58:09 +0800, [email protected] wrote:

This patch series adds Richtek rt9123 and rt9123p support. It's a 3.2W mono Class-D audio amplifier.

Since v2
[PATCH 2/4]
- include bitfield header file to fix kernel test robot issue
https://lore.kernel.org/oe-kbuild-all/[email protected]/
- Use #ifdef CONFIG_PM to only inlucde 'runtime_resume' and 'runtime_suspend', this will fix kernel test robot issue
https://lore.kernel.org/oe-kbuild-all/[email protected]/
- Check vendor-id before triggering SW_RST
- Fix 'SW_RST' write date non swap issue and add the wait delay for sw_reset
- Rename control name from 'SPK Gain Volume' to 'Speaker Volume'
- Change regmap cache type to _MAPLE
- Since ID check run once, to speed up regmap cache init, modify num_reg_defaults_raw from 0xf2 'COMBOID' to 0x36 'ANAFLAG'
- Add comments to describe why use pm runtime for RG special handling [PATCH 3/4]
- Modify the property name from 'enable-delay' to 'enable-delay-ms' to make the time unit more specific
[PATCH 4/4]
- Update the property parsing from 'enable-delay' to 'enable-delay-ms'

Quoted 1 line

[...]

Applied to

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

Thanks!

[1/4] ASoC: dt-bindings: Add bindings for Richtek rt9123

      commit: 667ebcc13dd63f59e2a1132e0f54d2f3067597db
[2/4] ASoC: codecs: Add support for Richtek rt9123
      commit: 8bffd24e45618b6c3d6ce11947193c6d8ba846a7
[3/4] ASoC: dt-bindings: Add bindings for Richtek rt9123p
      commit: 4a046b67d2d267daf884798ee8509a502abe7a58
[4/4] ASoC: codecs: Add support for Richtek rt9123p
      commit: 38c2585c7439cc678ae105dd826f10321db29552

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