From: Xuyang Dong <dongxuyang@eswincomputing.com>
Introduce device-tree binding documentation for ESWIN EIC7700 pwm
controller.
Signed-off-by: Xiang Xu <xuxiang@eswincomputing.com>
Signed-off-by: Guosheng Wang <wangguosheng@eswincomputing.com>
Signed-off-by: Xuyang Dong <dongxuyang@eswincomputing.com>
---
.../bindings/pwm/eswin,eic7700-pwm.yaml | 73 +++++++++++++++++++
1 file changed, 73 insertions(+)
create mode 100644 Documentation/devicetree/bindings/pwm/eswin,eic7700-pwm.yaml
diff --git a/Documentation/devicetree/bindings/pwm/eswin,eic7700-pwm.yaml b/Documentation/devicetree/bindings/pwm/eswin,eic7700-pwm.yaml
new file mode 100644
index 000000000000..8b7dc7d4dffe
--- /dev/null
+++ b/Documentation/devicetree/bindings/pwm/eswin,eic7700-pwm.yaml
@@ -0,0 +1,73 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pwm/eswin,eic7700-pwm.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: ESWIN EIC7700 PWM controller
+
+maintainers:
+ - Xiang Xu <xuxiang@eswincomputing.com>
+ - Guosheng Wang <wangguosheng@eswincomputing.com>
+ - Xuyang Dong <dongxuyang@eswincomputing.com>
+
+description: |
+ The EIC7700 PWM used the DesignWare APB timers module. The PWM driver
+ supports a duty cycle range from 0% to 100%, with explicit support for
+ both 0% and 100% duty cycles.
+
+allOf:
+ - $ref: pwm.yaml#
+
+properties:
+ compatible:
+ const: eswin,eic7700-pwm
+
+ reg:
+ maxItems: 1
+
+ clocks:
+ maxItems: 1
+
+ resets:
+ maxItems: 1
+
+ "#pwm-cells":
+ const: 3
+
+ pinctrl-0: true
+ pinctrl-1: true
+
+ pinctrl-names:
+ minItems: 1
+ items:
+ - const: default
+ - const: sleep
+
+ snps,pwm-full-range-enable:
+ type: boolean
+ description: |
+ Enable support for 0% and 100% duty cycle.
+ When present, the PWM controller can output 0% and 100% duty cycles.
+
+required:
+ - compatible
+ - reg
+ - clocks
+ - resets
+ - snps,pwm-full-range-enable
+
+additionalProperties: false
+
+examples:
+ - |
+ pwm@50818000 {
+ compatible = "eswin,eic7700-pwm";
+ reg = <0x50818000 0x4000>;
+ clocks = <&clock 242>;
+ resets = <&reset 136>;
+ #pwm-cells = <3>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&fan_pwm>;
+ snps,pwm-full-range-enable;
+ };
--
2.34.1
On Fri, Dec 05, 2025 at 05:04:50PM +0800, dongxuyang@eswincomputing.com wrote: > diff --git a/Documentation/devicetree/bindings/pwm/eswin,eic7700-pwm.yaml b/Documentation/devicetree/bindings/pwm/eswin,eic7700-pwm.yaml > new file mode 100644 > index 000000000000..8b7dc7d4dffe > --- /dev/null > +++ b/Documentation/devicetree/bindings/pwm/eswin,eic7700-pwm.yaml > @@ -0,0 +1,73 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/pwm/eswin,eic7700-pwm.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: ESWIN EIC7700 PWM controller > + > +maintainers: > + - Xiang Xu <xuxiang@eswincomputing.com> > + - Guosheng Wang <wangguosheng@eswincomputing.com> > + - Xuyang Dong <dongxuyang@eswincomputing.com> > + > +description: | Do not need '|' unless you need to preserve formatting. > + The EIC7700 PWM used the DesignWare APB timers module. The PWM driver > + supports a duty cycle range from 0% to 100%, with explicit support for Driver is irrelevant here. Describe hardware. > + both 0% and 100% duty cycles. > + > +allOf: > + - $ref: pwm.yaml# > + > +properties: > + compatible: > + const: eswin,eic7700-pwm > + > + reg: > + maxItems: 1 > + > + clocks: > + maxItems: 1 > + > + resets: > + maxItems: 1 > + > + "#pwm-cells": > + const: 3 > + > + pinctrl-0: true > + pinctrl-1: true > + > + pinctrl-names: > + minItems: 1 > + items: > + - const: default > + - const: sleep > + > + snps,pwm-full-range-enable: 1. Wrong vendor prefix, thats eswin, not snps. 2. Why is this a hardware property? I really do not see that. You described the desired Linux feature or behavior, not the actual hardware. The bindings are about the latter, so instead you need to rephrase the property and its description to match actual hardware capabilities/features/configuration etc. Best regards, Krzysztof
> > diff --git a/Documentation/devicetree/bindings/pwm/eswin,eic7700-pwm.yaml b/Documentation/devicetree/bindings/pwm/eswin,eic7700-pwm.yaml > > new file mode 100644 > > index 000000000000..8b7dc7d4dffe > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/pwm/eswin,eic7700-pwm.yaml > > @@ -0,0 +1,73 @@ > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > > +%YAML 1.2 > > +--- > > +$id: http://devicetree.org/schemas/pwm/eswin,eic7700-pwm.yaml# > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > + > > +title: ESWIN EIC7700 PWM controller > > + > > +maintainers: > > + - Xiang Xu <xuxiang@eswincomputing.com> > > + - Guosheng Wang <wangguosheng@eswincomputing.com> > > + - Xuyang Dong <dongxuyang@eswincomputing.com> > > + > > +description: | > > Do not need '|' unless you need to preserve formatting. > > > + The EIC7700 PWM used the DesignWare APB timers module. The PWM driver > > + supports a duty cycle range from 0% to 100%, with explicit support for > > Driver is irrelevant here. Describe hardware. > > > + both 0% and 100% duty cycles. > > + > > +allOf: > > + - $ref: pwm.yaml# > > + > > +properties: > > + compatible: > > + const: eswin,eic7700-pwm > > + > > + reg: > > + maxItems: 1 > > + > > + clocks: > > + maxItems: 1 > > + > > + resets: > > + maxItems: 1 > > + > > + "#pwm-cells": > > + const: 3 > > + > > + pinctrl-0: true > > + pinctrl-1: true > > + > > + pinctrl-names: > > + minItems: 1 > > + items: > > + - const: default > > + - const: sleep > > + > > + snps,pwm-full-range-enable: > > 1. Wrong vendor prefix, thats eswin, not snps. > 2. Why is this a hardware property? I really do not see that. You > described the desired Linux feature or behavior, not the actual > hardware. The bindings are about the latter, so instead you need to > rephrase the property and its description to match actual hardware > capabilities/features/configuration etc. > Hi Krzysztof and Ben, There is a patch [1] submmitted by Ben Dook a few years ago. The intention of this patch is to make DWC pwm controller can be used as platform driver. This is what we are currently working on. It seems that it would be more reasonable to continue improving this patch and make the DWC PWM driver universal, rather than creating a separate ESWIN PWM driver. The DWC pwm 2.13a version supports "Pulse Width Modulation with 0% and 100% Duty Cycle" by programming TIMER_0N100PWM_EN bit field. We also want to support this new hardware feature. So, adding a new property, like snps,timer-0n100pwm-en, in pwm/snps,dw-apb-timers-pwm2.yaml would be better? Krzysztof and Ben, do you think the above approach is reasonable and acceptable? [1] https://lore.kernel.org/lkml/20230907161242.67190-7-ben.dooks@codethink.co.uk/ Regards, Xuyang Dong
On 09/12/2025 11:20, Xuyang Dong wrote: >>> + >>> + pinctrl-0: true >>> + pinctrl-1: true >>> + >>> + pinctrl-names: >>> + minItems: 1 >>> + items: >>> + - const: default >>> + - const: sleep >>> + >>> + snps,pwm-full-range-enable: >> >> 1. Wrong vendor prefix, thats eswin, not snps. >> 2. Why is this a hardware property? I really do not see that. You >> described the desired Linux feature or behavior, not the actual >> hardware. The bindings are about the latter, so instead you need to >> rephrase the property and its description to match actual hardware >> capabilities/features/configuration etc. >> > Hi Krzysztof and Ben, > > There is a patch [1] submmitted by Ben Dook a few years ago. The > intention of this patch is to make DWC pwm controller can be used as > platform driver. This is what we are currently working on. > It seems that it would be more reasonable to continue improving this > patch and make the DWC PWM driver universal, rather than creating a > separate ESWIN PWM driver. > > The DWC pwm 2.13a version supports "Pulse Width Modulation with 0% and > 100% Duty Cycle" by programming TIMER_0N100PWM_EN bit field. We also > want to support this new hardware feature. So, adding a new property, > like snps,timer-0n100pwm-en, in pwm/snps,dw-apb-timers-pwm2.yaml > would be better? > > Krzysztof and Ben, do you think the above approach is reasonable and acceptable? How any of this is related to the binding? We talk here about hardware and binding, but you ask me about driver.... I don't care. Best regards, Krzysztof
© 2016 - 2025 Red Hat, Inc.