ASoC: codecs: Add support for Fortemedia FM34NE DSP
Subsystems (3)
cover ASoC: codecs: Add support for Fortemedia FM34NE DSP
The Fortemedia FM34NE is digital sound processing chip used for active noise suppression mainly on ASUS Transformers.
Resending since previous attempt seems to be malformed.
Svyatoslav Ryhel (2):
ASoC: dt-bindings: Document FM34NE DSP
ASoC: codecs: Add support for Fortemedia FM34NE DSP
.../bindings/sound/asus,tf201-dsp.yaml | 80 ++ sound/soc/codecs/Kconfig | 12 + sound/soc/codecs/Makefile | 2 + sound/soc/codecs/fm34ne-dsp.c | 388 +++++++ sound/soc/codecs/fm34ne-dsp.h | 1030 +++++++++++++++++ 5 files changed, 1512 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/asus,tf201-dsp.yaml create mode 100644 sound/soc/codecs/fm34ne-dsp.c create mode 100644 sound/soc/codecs/fm34ne-dsp.h
Signature · 1 line
2.53.0
PATCH RESEND 1/2 ASoC: dt-bindings: Document FM34NE DSP
Document the FM34NE DSP based voice processor used in the ASUS Transformer devices.
--- .../bindings/sound/asus,tf201-dsp.yaml | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/asus,tf201-dsp.yaml
Documentation/devicetree/bindings/sound/asus,tf201-dsp.yaml new file +80 -0
@@ -0,0 +1,80 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/asus,tf201-dsp.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Fortemedia FM34NE based voice processor + +description: + Fortemedia FM34NE is a hardware voice processor (DSP — Digital Signal + Processor) designed by Fortemedia. It specializes in real-time audio + processing, focusing on noise suppression and echo cancellation. + +maintainers: + - Svyatoslav Ryhel <[email protected]> + +allOf: + - $ref: dai-common.yaml# + +properties: + compatible: + enum: + - asus,sl101-dsp + - asus,tf101-dsp + - asus,tf201-dsp + - asus,tf300t-dsp + - asus,tf700t-dsp + - pegatron,chagall-dsp + + reg: + maxItems: 1 + + clocks: + items: + - description: Master clock to the DSP + + reset-gpios: + maxItems: 1 + + bypass-gpios: + maxItems: 1 + description: Signal that switches DSP into programming mode. + + vdd-supply: true + + ports: + $ref: /schemas/graph.yaml#/properties/ports + + port: + $ref: audio-graph-port.yaml# + unevaluatedProperties: false + +required: + - compatible + - reg + - bypass-gpios + +unevaluatedProperties: false + +examples: + - | + #include <dt-bindings/gpio/gpio.h> + + i2c { + #address-cells = <1>; + #size-cells = <0>; + + codec@60 { + compatible = "asus,tf201-dsp"; + reg = <0x60>; + + clocks = <&fn34ne_clk>; + + bypass-gpios = <&gpio 222 GPIO_ACTIVE_HIGH>; + reset-gpios = <&gpio 115 GPIO_ACTIVE_LOW>; + + vdd-supply = <&vdd_1v8_dsp>; + }; + }; +...
Signature · 1 line
2.53.0
[email protected]
AI reviewRe: [PATCH v1 1/2 RESEND] ASoC: dt-bindings: Document FM34NE DSP
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: - [Low] dt-bindings: typo in example clock phandle fn34ne_clk - [Low] dt-bindings: missing audio-graph-port…
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Low] dt-bindings: typo in example clock phandle fn34ne_clk
- [Low] dt-bindings: missing audio-graph-port validation on nested ports children --
commit 7ea62b580d59721cf9be3722ba0f59686684d184
Author: Svyatoslav Ryhel <[email protected]>
ASoC: dt-bindings: Document FM34NE DSP
Document the FM34NE DSP based voice processor used in the ASUS Transformer devices.
Quoted 9 lines
Documentation/devicetree/bindings/sound/asus,tf201-dsp.yaml new file +3
-0@@ -0,0 +1,80 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +---
[ ... ]
Documentation/devicetree/bindings/sound/asus,tf201-dsp.yaml line 47
Quoted 8 lines
Documentation/devicetree/bindings/sound/asus,tf201-dsp.yaml new file +8
-0+ bypass-gpios: + maxItems: 1 + description: Signal that switches DSP into programming mode. + + vdd-supply: true + + ports: + $ref: /schemas/graph.yaml#/properties/ports
[Severity: Low]
Does this node lack audio-graph-port validation for its nested port children?
When a device tree configuration uses the ports container node, any properties inside its nested port@X children will only be validated against the generic graph.yaml schema, not audio-graph-port.yaml#. As a result, invalid or misspelled audio-specific properties will silently pass schema validation.
Should this explicitly apply patternProperties with a reference to audio-graph-port.yaml# for the children?
Quoted 4 lines
Documentation/devicetree/bindings/sound/asus,tf201-dsp.yaml new file +4
-0+ + port: + $ref: audio-graph-port.yaml# + unevaluatedProperties: false
[ ... ]
Documentation/devicetree/bindings/sound/asus,tf201-dsp.yaml line 72
Quoted 13 lines
Documentation/devicetree/bindings/sound/asus,tf201-dsp.yaml new file +13
-0+examples: + - | + #include <dt-bindings/gpio/gpio.h> + + i2c { + #address-cells = <1>; + #size-cells = <0>; + + codec@60 { + compatible = "asus,tf201-dsp"; + reg = <0x60>; + + clocks = <&fn34ne_clk>;
[Severity: Low]
This isn't a bug, but should this phandle name be &fm34ne_clk to match the FM34NE chip name?
Quoted 8 lines
Documentation/devicetree/bindings/sound/asus,tf201-dsp.yaml new file +8
-0+ + bypass-gpios = <&gpio 222 GPIO_ACTIVE_HIGH>; + reset-gpios = <&gpio 115 GPIO_ACTIVE_LOW>; + + vdd-supply = <&vdd_1v8_dsp>; + }; + }; +...
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
PATCH RESEND 2/2 ASoC: codecs: Add support for Fortemedia FM34NE DSP
In reply to Svyatoslav RyhelFM34NE is digital sound processing chip used for active noise suppression mainly on ASUS Transformers.
--- sound/soc/codecs/Kconfig | 12 + sound/soc/codecs/Makefile | 2 + sound/soc/codecs/fm34ne-dsp.c | 388 +++++++++++++ sound/soc/codecs/fm34ne-dsp.h | 1030 +++++++++++++++++++++++++++++++++ 4 files changed, 1432 insertions(+) create mode 100644 sound/soc/codecs/fm34ne-dsp.c create mode 100644 sound/soc/codecs/fm34ne-dsp.h
sound/soc/codecs/Kconfig +12 -0
@@ -127,6 +127,7 @@ config SND_SOC_ALL_CODECS imply SND_SOC_ES9356 imply SND_SOC_ES7134 imply SND_SOC_ES7241 + imply SND_SOC_FM34NE_DSP imply SND_SOC_FRAMER imply SND_SOC_FS210X imply SND_SOC_GTM601
@@ -1338,6 +1339,17 @@ config SND_SOC_ES9356 select REGMAP_SOUNDWIRE select REGMAP_SOUNDWIRE_MBQ +config SND_SOC_FM34NE_DSP + tristate "DSP FM34NE driver" + depends on I2C && GPIOLIB + help + Say Y here if you want to add support for Fortemedia FM34NE DSP + mainly used in ASUS T20/T30 Transformers for input noise + processing. + + To compile this driver as a module, choose M here: the module + will be called snd-soc-fm34ne-dsp. + config SND_SOC_FRAMER tristate "Framer codec" depends on GENERIC_FRAMER
sound/soc/codecs/Makefile +2 -0
@@ -142,6 +142,7 @@ snd-soc-es8375-y := es8375.o snd-soc-es8389-y := es8389.o snd-soc-es9039q2m-y := es9039q2m.o snd-soc-es9356-y := es9356.o +snd-soc-fm34ne-dsp-y := fm34ne-dsp.o snd-soc-framer-y := framer-codec.o snd-soc-fs-amp-lib-y := fs-amp-lib.o snd-soc-fs210x-y := fs210x.o
@@ -590,6 +591,7 @@ obj-$(CONFIG_SND_SOC_ES8375) += snd-soc-es8375.o obj-$(CONFIG_SND_SOC_ES8389) += snd-soc-es8389.o obj-$(CONFIG_SND_SOC_ES9039Q2M) += snd-soc-es9039q2m.o obj-$(CONFIG_SND_SOC_ES9356) += snd-soc-es9356.o +obj-$(CONFIG_SND_SOC_FM34NE_DSP) += snd-soc-fm34ne-dsp.o obj-$(CONFIG_SND_SOC_FRAMER) += snd-soc-framer.o obj-$(CONFIG_SND_SOC_FS_AMP_LIB)+= snd-soc-fs-amp-lib.o obj-$(CONFIG_SND_SOC_FS210X) += snd-soc-fs210x.o
sound/soc/codecs/fm34ne-dsp.c new file +388 -0
388 lines not on this page · raw message
sound/soc/codecs/fm34ne-dsp.h new file +1030 -0
1,030 lines not on this page · raw message
Signature · 1 line
2.53.0
[email protected]
AI reviewThank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: - [Medium] asoc: fm34ne-dsp: I2C transfer errors are silently masked by unconditional return 0 - [Low]…
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] asoc: fm34ne-dsp: I2C transfer errors are silently masked by unconditional return 0
- [Low] asoc: fm34ne-dsp: mixing goto-based cleanup with guard() scope-based locking --
commit c702ef2250bbc5a4eaf5b40b9bb43fc3e069825a
Author: Svyatoslav Ryhel <[email protected]>
ASoC: codecs: Add support for Fortemedia FM34NE DSP
This commit introduces a new I2C-based ALSA SoC codec driver for the Fortemedia FM34NE DSP. This chip is primarily used for active noise suppression on devices like the ASUS Transformers.
Quoted 6 lines
sound/soc/codecs/fm34ne-dsp.c new file +0
-0@@ -0,0 +1,388 @@
[ ... ]
Quoted 7 lines
sound/soc/codecs/fm34ne-dsp.c new file +7
-0+static int fm34ne_dsp_set_config (struct fm34ne_dsp *dsp,enum dsp_state state) +{ +struct device *dev = &dsp->client->dev; +int ret; + +guard (mutex)(&dsp->lock); +
sound/soc/codecs/fm34ne-dsp.c line 46
Quoted 10 lines
sound/soc/codecs/fm34ne-dsp.c new file +10
-0+gpiod_set_value_cansleep (dsp->bypass_gpio,1 ); +msleep (20 ); + +switch (state) { +case FM34NE_NS_ENABLE : + ret =i2c_master_send (dsp->client, dsp->info->enable_parameter, + dsp->info->enable_parameter_length); +if (ret <0 ) { +dev_err (dev,"Failed to set DSP enable %d\n" , ret); + goto exit;
[Severity: Low]
Does this mix goto-based error cleanup with scope-based locking?
According to the kernel's cleanup helpers documentation, the expectation is that the usage of goto labels and scope-based cleanup helpers (like guard) should not be mixed in the same function. This is to avoid confusing ownership and lock release semantics. Could this be converted entirely to scope-based cleanup, or stick to traditional locking?
Quoted 10 lines
sound/soc/codecs/fm34ne-dsp.c new file +10
-0+ } + + ret =i2c_master_send (dsp->client, dsp->info->enable_noise_suppression, + dsp->info->enable_ns_length); +if (ret <0 ) { +dev_err (dev,"Failed to enable DSP noise suppression %d\n" , ret); + goto exit; + } + +break ;
[ ... ]
sound/soc/codecs/fm34ne-dsp.c line 89
Quoted 4 lines
sound/soc/codecs/fm34ne-dsp.c new file +4
-0+exit: +gpiod_set_value_cansleep (dsp->bypass_gpio,0 ); + +return 0 ;
[Severity: Medium]
Does this unconditionally discard the error code returned by i2c_master_send on the failure paths?
By returning 0 here after jumping to the exit label, callers like fm34ne_dsp_probe will assume the hardware was successfully configured even if the underlying I2C transfer failed. Should this propagate the negative error code stored in ret instead?
Quoted 1 line
+}
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
Hello,
sound/soc/codecs/fm34ne-dsp.c line 7
Quoted 2 lines · Svyatoslav Ryhel
sound/soc/codecs/fm34ne-dsp.c new file +2
-0+#include <linux/i2c.h> +#include <linux/mod_devicetable.h>
i2c_device_id is already provided by <linux/i2c.h> and <linux/mod_devicetable.h> depends on a lot of subsystems that are not used in this driver. So please drop the latter.
Best regards
Uwe
чт, 15 жовт. 2026 р. о 09:34 Uwe Kleine-König
<[email protected]> пише:
Quoted 11 lines
Hello,
sound/soc/codecs/fm34ne-dsp.c line 7
Quoted 2 lines · Svyatoslav Ryhel
sound/soc/codecs/fm34ne-dsp.c new file +2
-0+#include <linux/i2c.h> +#include <linux/mod_devicetable.h>
i2c_device_idis already provided by <linux/i2c.h> and <linux/mod_devicetable.h> depends on a lot of subsystems that are not used in this driver. So please drop the latter.
I must have overseen this. Thank you, I will drop it.
Quoted 2 lines
Best regards
Uwe
Mark Brown
maintainerQuoted 4 lines · Svyatoslav Ryhel
The Fortemedia FM34NE is digital sound processing chip used for active noise suppression mainly on ASUS Transformers.
Resending since previous attempt seems to be malformed.
Please send a new version if you have rebased, tooling gets very confused about which v1 it's talking about.
вт, 13 жовт. 2026 р. о 21:49 Mark Brown <[email protected]> пише:
Quoted 9 lines · Svyatoslav Ryhel
Quoted 4 lines
The Fortemedia FM34NE is digital sound processing chip used for active noise suppression mainly on ASUS Transformers.
Resending since previous attempt seems to be malformed.
Please send a new version if you have rebased, tooling gets very confused about which v1 it's talking about.
I have not rebased, it seems that format-patch malformed first iteration. Both patchsets are made from the same commits with same hash.
Mark Brown
maintainerQuoted 6 lines · Svyatoslav Ryhel
вт, 13 жовт. 2026 р. о 21:49 Mark Brown <[email protected]> пише:
Quoted 4 lines · Svyatoslav Ryhel
Quoted 3 lines
The Fortemedia FM34NE is digital sound processing chip used for active noise suppression mainly on ASUS Transformers.
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
Resending since previous attempt seems to be malformed.
Please send a new version if you have rebased, tooling gets very confused about which v1 it's talking about.
I have not rebased, it seems that format-patch malformed first iteration. Both patchsets are made from the same commits with same hash.
That sounds like a rebase to me, and in any case the same issue is going to apply - if you are not sending *identical* patches the tooling will get confused about what version it's looking at.
вт, 13 жовт. 2026 р. о 21:55 Mark Brown <[email protected]> пише:
Quoted 13 lines · Svyatoslav Ryhel
Quoted 10 lines
вт, 13 жовт. 2026 р. о 21:49 Mark Brown <[email protected]> пише:
Quoted 9 lines · Svyatoslav Ryhel
Quoted 5 lines
The Fortemedia FM34NE is digital sound processing chip used for active noise suppression mainly on ASUS Transformers.
Resending since previous attempt seems to be malformed.
Please send a new version if you have rebased, tooling gets very confused about which v1 it's talking about.
Quoted 7 lines
Quoted 3 lines
I have not rebased, it seems that format-patch malformed first iteration. Both patchsets are made from the same commits with same hash.
That sounds like a rebase to me, and in any case the same issue is going to apply - if you are not sending *identical* patches the tooling will get confused about what version it's looking at.
Noted, thanks.