# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/pwm/pwm-lp3943.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: TI/National Semiconductor LP3943 PWM controller

maintainers:
  - Chaosheng Qu <quchaosheng000406@163.com>

description:
  LP3943 has two internal PWM channels. Each channel can be routed to one or
  more of the 16 outputs of the device.

  Note that the hardware limits the period length to the range 6250~1600000.

allOf:
  - $ref: pwm.yaml#

properties:
  compatible:
    const: ti,lp3943-pwm

  "#pwm-cells":
    const: 2

  ti,pwm0:
    description: Output pin number(s) for PWM channel 0.
    $ref: /schemas/types.yaml#/definitions/uint32-array
    minItems: 1
    maxItems: 16
    items:
      minimum: 0
      maximum: 15

  ti,pwm1:
    description: Output pin number(s) for PWM channel 1.
    $ref: /schemas/types.yaml#/definitions/uint32-array
    minItems: 1
    maxItems: 16
    items:
      minimum: 0
      maximum: 15

anyOf:
  - required:
      - ti,pwm0
  - required:
      - ti,pwm1

required:
  - compatible
  - "#pwm-cells"

unevaluatedProperties: false

examples:
  - |
    i2c {
        #address-cells = <1>;
        #size-cells = <0>;

        gpio@60 {
            compatible = "ti,lp3943";
            reg = <0x60>;

            /*
             * PWM 0 : output 8, 9 and 10
             * PWM 1 : output 15
             */
            pwm {
                compatible = "ti,lp3943-pwm";
                #pwm-cells = <2>;
                ti,pwm0 = <8 9 10>;
                ti,pwm1 = <15>;
            };
        };
    };
...