Back to home page

OSCL-LXR

 
 

    


0001 # SPDX-License-Identifier: GPL-2.0
0002 %YAML 1.2
0003 ---
0004 $id: http://devicetree.org/schemas/pwm/allwinner,sun4i-a10-pwm.yaml#
0005 $schema: http://devicetree.org/meta-schemas/core.yaml#
0006 
0007 title: Allwinner A10 PWM Device Tree Bindings
0008 
0009 maintainers:
0010   - Chen-Yu Tsai <wens@csie.org>
0011   - Maxime Ripard <mripard@kernel.org>
0012 
0013 properties:
0014   "#pwm-cells":
0015     const: 3
0016 
0017   compatible:
0018     oneOf:
0019       - const: allwinner,sun4i-a10-pwm
0020       - const: allwinner,sun5i-a10s-pwm
0021       - const: allwinner,sun5i-a13-pwm
0022       - const: allwinner,sun7i-a20-pwm
0023       - const: allwinner,sun8i-h3-pwm
0024       - items:
0025           - const: allwinner,sun8i-a83t-pwm
0026           - const: allwinner,sun8i-h3-pwm
0027       - items:
0028           - const: allwinner,sun8i-v3s-pwm
0029           - const: allwinner,sun7i-a20-pwm
0030       - items:
0031           - const: allwinner,sun50i-a64-pwm
0032           - const: allwinner,sun5i-a13-pwm
0033       - items:
0034           - const: allwinner,sun50i-h5-pwm
0035           - const: allwinner,sun5i-a13-pwm
0036       - const: allwinner,sun50i-h6-pwm
0037 
0038   reg:
0039     maxItems: 1
0040 
0041   clocks:
0042     minItems: 1
0043     items:
0044       - description: Module Clock
0045       - description: Bus Clock
0046 
0047   # Even though it only applies to subschemas under the conditionals,
0048   # not listing them here will trigger a warning because of the
0049   # additionalsProperties set to false.
0050   clock-names: true
0051 
0052   resets:
0053     maxItems: 1
0054 
0055 
0056 allOf:
0057   - $ref: pwm.yaml#
0058 
0059   - if:
0060       properties:
0061         compatible:
0062           contains:
0063             const: allwinner,sun50i-h6-pwm
0064 
0065     then:
0066       properties:
0067         clocks:
0068           maxItems: 2
0069 
0070         clock-names:
0071           items:
0072             - const: mod
0073             - const: bus
0074 
0075       required:
0076         - clock-names
0077         - resets
0078 
0079     else:
0080       properties:
0081         clocks:
0082           maxItems: 1
0083 
0084 required:
0085   - compatible
0086   - reg
0087   - clocks
0088 
0089 additionalProperties: false
0090 
0091 examples:
0092   - |
0093     pwm: pwm@1c20e00 {
0094         compatible = "allwinner,sun7i-a20-pwm";
0095         reg = <0x01c20e00 0xc>;
0096         clocks = <&osc24M>;
0097         #pwm-cells = <3>;
0098     };
0099 
0100   - |
0101     #include <dt-bindings/clock/sun50i-h6-ccu.h>
0102     #include <dt-bindings/reset/sun50i-h6-ccu.h>
0103 
0104     pwm@300a000 {
0105       compatible = "allwinner,sun50i-h6-pwm";
0106       reg = <0x0300a000 0x400>;
0107       clocks = <&osc24M>, <&ccu CLK_BUS_PWM>;
0108       clock-names = "mod", "bus";
0109       resets = <&ccu RST_BUS_PWM>;
0110       #pwm-cells = <3>;
0111     };
0112 
0113 ...