Add a DT schema for describing FourSemi FS2104/5S
audio amplifiers which support both I2S and I2C interface.
Signed-off-by: Nick Li <nick.li@foursemi.com>
---
.../bindings/sound/foursemi,fs2105s.yaml | 100 ++++++++++++++++++
1 file changed, 100 insertions(+)
create mode 100644 Documentation/devicetree/bindings/sound/foursemi,fs2105s.yaml
diff --git a/Documentation/devicetree/bindings/sound/foursemi,fs2105s.yaml b/Documentation/devicetree/bindings/sound/foursemi,fs2105s.yaml
new file mode 100644
index 000000000..5211f9fe1
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/foursemi,fs2105s.yaml
@@ -0,0 +1,100 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/foursemi,fs2105s.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: FourSemi FS2104/5S Digital Audio Amplifier
+
+maintainers:
+ - Nick Li <nick.li@foursemi.com>
+
+description:
+ The FS2104 is a 15W Inductor-Less, Stereo, Closed-Loop,
+ Digital Input Class-D Power Amplifier with Enhanced Signal Processing.
+ The FS2105S is a 30W Inductor-Less, Stereo, Closed-Loop,
+ Digital Input Class-D Power Amplifier with Enhanced Signal Processing.
+
+properties:
+ compatible:
+ oneOf:
+ - items:
+ - enum:
+ - foursemi,fs2104
+ - const: foursemi,fs2105s
+ - enum:
+ - foursemi,fs2105s
+
+ reg:
+ maxItems: 1
+ description:
+ I2C address of the device. Refer to datasheet for possible values
+
+ clocks:
+ description: The clock of I2S BCLK
+
+ clock-names:
+ items:
+ - const: bclk
+
+ interrupts:
+ maxItems: 1
+
+ '#sound-dai-cells':
+ const: 0
+
+ pvdd-supply:
+ description:
+ Regulator for power supply(PVDD in datasheet).
+
+ dvdd-supply:
+ description:
+ Regulator for digital supply(DVDD in datasheet).
+
+ reset-gpios:
+ maxItems: 1
+ description:
+ It's the SDZ pin in datasheet, the pin is active low,
+ it will power down and reset the chip to shut down state.
+
+ firmware-name:
+ maxItems: 1
+ description: |
+ The firmware(*.bin) contains:
+ a. Register initialization settings
+ b. DSP effect parameters
+ c. Multi-scene sound effect configurations(optional)
+ It's gernerated by FourSemi's tuning tool.
+
+required:
+ - compatible
+ - reg
+ - reset-gpios
+ - firmware-name
+ - '#sound-dai-cells'
+
+allOf:
+ - $ref: dai-common.yaml#
+
+unevaluatedProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/gpio/gpio.h>
+ i2c {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ audio-codec@68 {
+ compatible = "foursemi,fs2105s";
+ reg = <0x68>;
+ pvdd-supply = <&pvdd_supply>;
+ dvdd-supply = <&dvdd_supply>;
+ reset-gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
+ firmware-name = "fs2105s-btl-2p0-0s.bin";
+ pinctrl-names = "default";
+ pinctrl-0 = <&fs210x_pins_default>;
+ clocks = <&clocks 18>;
+ clock-names = "bclk";
+ #sound-dai-cells = <0>;
+ };
+ };
--
2.17.1
On Tue, Jul 08, 2025 at 07:28:59PM +0800, Nick Li wrote: > Add a DT schema for describing FourSemi FS2104/5S > audio amplifiers which support both I2S and I2C interface. > Another unexpected change from v1: subject: why did you add "schema"? I asked to drop it and gave you reference explaining this. Did you read it? So again, same template: A nit, subject: drop second/last, redundant "schema for". The "dt-bindings" prefix is already stating that these are bindings in schema format, because they cannot be anything else. See also: https://elixir.bootlin.com/linux/v6.7-rc8/source/Documentation/devicetree/bindings/submitting-patches.rst#L18 Best regards, Krzysztof
On Wed, Jul 09, 2025 at 12:42:35PM +0200, Krzysztof Kozlowski wrote: > On Tue, Jul 08, 2025 at 07:28:59PM +0800, Nick Li wrote: > > Add a DT schema for describing FourSemi FS2104/5S > > audio amplifiers which support both I2S and I2C interface. > > > > Another unexpected change from v1: subject: why did you add "schema"? > > I asked to drop it and gave you reference explaining this. Did you read > it? > > So again, same template: > > A nit, subject: drop second/last, redundant "schema for". The > "dt-bindings" prefix is already stating that these are bindings in > schema format, because they cannot be anything else. > See also: > https://elixir.bootlin.com/linux/v6.7-rc8/source/Documentation/devicetree/bindings/submitting-patches.rst#L18 > Sorry, I misunderstood, I will fix it by dropping "schema for ". Best regards, Nick > Best regards, > Krzysztof > >
On Tue, Jul 08, 2025 at 07:28:59PM +0800, Nick Li wrote: > +description: > + The FS2104 is a 15W Inductor-Less, Stereo, Closed-Loop, > + Digital Input Class-D Power Amplifier with Enhanced Signal Processing. > + The FS2105S is a 30W Inductor-Less, Stereo, Closed-Loop, > + Digital Input Class-D Power Amplifier with Enhanced Signal Processing. > + > +properties: > + compatible: > + oneOf: > + - items: > + - enum: > + - foursemi,fs2104 > + - const: foursemi,fs2105s > + - enum: > + - foursemi,fs2105s > + > + reg: > + maxItems: 1 > + description: > + I2C address of the device. Refer to datasheet for possible values Now the description is entirely redundant, brings no value. Drop. > + > + clocks: > + description: The clock of I2S BCLK This was different... Previous code was correct, this is not correct. And nothing in changelog explains this. Do not make random changes after review. > + > + clock-names: > + items: > + - const: bclk > + > + interrupts: > + maxItems: 1 > + > + '#sound-dai-cells': > + const: 0 > + > + pvdd-supply: > + description: > + Regulator for power supply(PVDD in datasheet). > + > + dvdd-supply: > + description: > + Regulator for digital supply(DVDD in datasheet). > + > + reset-gpios: > + maxItems: 1 > + description: > + It's the SDZ pin in datasheet, the pin is active low, > + it will power down and reset the chip to shut down state. > + > + firmware-name: > + maxItems: 1 > + description: | > + The firmware(*.bin) contains: > + a. Register initialization settings > + b. DSP effect parameters > + c. Multi-scene sound effect configurations(optional) > + It's gernerated by FourSemi's tuning tool. > + > +required: > + - compatible > + - reg > + - reset-gpios > + - firmware-name > + - '#sound-dai-cells' Keep the same order as in list of properties. OTOH, missing supplies. > + > +allOf: > + - $ref: dai-common.yaml# > + > +unevaluatedProperties: false Best regards, Krzysztof
On Wed, Jul 09, 2025 at 12:40:33PM +0200, Krzysztof Kozlowski wrote: > On Tue, Jul 08, 2025 at 07:28:59PM +0800, Nick Li wrote: > > +description: > > + The FS2104 is a 15W Inductor-Less, Stereo, Closed-Loop, > > + Digital Input Class-D Power Amplifier with Enhanced Signal Processing. > > + The FS2105S is a 30W Inductor-Less, Stereo, Closed-Loop, > > + Digital Input Class-D Power Amplifier with Enhanced Signal Processing. > > + > > +properties: > > + compatible: > > + oneOf: > > + - items: > > + - enum: > > + - foursemi,fs2104 > > + - const: foursemi,fs2105s > > + - enum: > > + - foursemi,fs2105s > > + > > + reg: > > + maxItems: 1 > > + description: > > + I2C address of the device. Refer to datasheet for possible values > > Now the description is entirely redundant, brings no value. Drop. OK. > > > + > > + clocks: > > + description: The clock of I2S BCLK > > This was different... Previous code was correct, this is not correct. > And nothing in changelog explains this. Do not make random changes after > review. > OK, I will recover it to version v1. > > + > > + clock-names: > > + items: > > + - const: bclk > > + > > + interrupts: > > + maxItems: 1 > > + > > + '#sound-dai-cells': > > + const: 0 > > + > > + pvdd-supply: > > + description: > > + Regulator for power supply(PVDD in datasheet). > > + > > + dvdd-supply: > > + description: > > + Regulator for digital supply(DVDD in datasheet). > > + > > + reset-gpios: > > + maxItems: 1 > > + description: > > + It's the SDZ pin in datasheet, the pin is active low, > > + it will power down and reset the chip to shut down state. > > + > > + firmware-name: > > + maxItems: 1 > > + description: | > > + The firmware(*.bin) contains: > > + a. Register initialization settings > > + b. DSP effect parameters > > + c. Multi-scene sound effect configurations(optional) > > + It's gernerated by FourSemi's tuning tool. > > + > > +required: > > + - compatible > > + - reg > > + - reset-gpios > > + - firmware-name > > + - '#sound-dai-cells' > > Keep the same order as in list of properties. OTOH, missing supplies. OK, we will fix the order, but the supplies may not be used as regulator, we mark them as required, is it OK? Best regards, Nick > > > + > > +allOf: > > + - $ref: dai-common.yaml# > > + > > +unevaluatedProperties: false > > Best regards, > Krzysztof > >
On 10/07/2025 10:11, Nick Li wrote: >>> + >>> +required: >>> + - compatible >>> + - reg >>> + - reset-gpios >>> + - firmware-name >>> + - '#sound-dai-cells' >> >> Keep the same order as in list of properties. OTOH, missing supplies. > > OK, we will fix the order, but the supplies may not be used as regulator, Hm? What does it mean in terms of hardware? > we mark them as required, is it OK? How codec driver can work without power? Best regards, Krzysztof
On Thu, Jul 10, 2025 at 10:27:59AM +0200, Krzysztof Kozlowski wrote: > On 10/07/2025 10:11, Nick Li wrote: > >>> + > >>> +required: > >>> + - compatible > >>> + - reg > >>> + - reset-gpios > >>> + - firmware-name > >>> + - '#sound-dai-cells' > >> > >> Keep the same order as in list of properties. OTOH, missing supplies. > > > > OK, we will fix the order, but the supplies may not be used as regulator, > > Hm? What does it mean in terms of hardware? > > > we mark them as required, is it OK? > > How codec driver can work without power? The power may be connected to the baterry/adapter directly, it may not be under the control of the software, in this case, the supplies are use as dummy regulators? Best regards, Nick > > > Best regards, > Krzysztof >
© 2016 - 2025 Red Hat, Inc.