Commit 8c1bfd74 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'pwm/for-5.14-rc1' of...

Merge tag 'pwm/for-5.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm

Pull pwm updates from Thierry Reding:
 "This contains mostly various fixes, cleanups and some conversions to
  the atomic API. One noteworthy change is that PWM consumers can now
  pass a hint to the PWM core about the PWM usage, enabling PWM
  providers to implement various optimizations.

  There's also a fair bit of simplification here with the addition of
  some device-managed helpers as well as unification between the DT and
  ACPI firmware interfaces"

* tag 'pwm/for-5.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm: (50 commits)
  pwm: Remove redundant assignment to pointer pwm
  pwm: ep93xx: Fix read of uninitialized variable ret
  pwm: ep93xx: Prepare clock before using it
  pwm: ep93xx: Unfold legacy callbacks into ep93xx_pwm_apply()
  pwm: ep93xx: Implement .apply callback
  pwm: vt8500: Only unprepare the clock after the pwmchip was removed
  pwm: vt8500: Drop if with an always false condition
  pwm: tegra: Assert reset only after the PWM was unregistered
  pwm: tegra: Don't needlessly enable and disable the clock in .remove()
  pwm: tegra: Don't modify HW state in .remove callback
  pwm: tegra: Drop an if block with an always false condition
  pwm: core: Simplify some devm_*pwm*() functions
  pwm: core: Remove unused devm_pwm_put()
  pwm: core: Unify fwnode checks in the module
  pwm: core: Reuse fwnode_to_pwmchip() in ACPI case
  pwm: core: Convert to use fwnode for matching
  docs: firmware-guide: ACPI: Add a PWM example
  dt-bindings: pwm: pwm-tiecap: Add compatible string for AM64 SoC
  dt-bindings: pwm: pwm-tiecap: Convert to json schema
  pwm: sprd: Don't check the return code of pwmchip_remove()
  ...
parents b0dfd9af bebedf2b
Loading
Loading
Loading
Loading
+0 −51
Original line number Diff line number Diff line
TI SOC ECAP based APWM controller

Required properties:
- compatible: Must be "ti,<soc>-ecap".
  for am33xx - compatible = "ti,am3352-ecap", "ti,am33xx-ecap";
  for am4372 - compatible = "ti,am4372-ecap", "ti,am3352-ecap", "ti,am33xx-ecap";
  for da850  - compatible = "ti,da850-ecap", "ti,am3352-ecap", "ti,am33xx-ecap";
  for dra746 - compatible = "ti,dra746-ecap", "ti,am3352-ecap";
  for 66ak2g - compatible = "ti,k2g-ecap", "ti,am3352-ecap";
  for am654  - compatible = "ti,am654-ecap", "ti,am3352-ecap";
- #pwm-cells: should be 3. See pwm.yaml in this directory for a description of
  the cells format. The PWM channel index ranges from 0 to 4. The only third
  cell flag supported by this binding is PWM_POLARITY_INVERTED.
- reg: physical base address and size of the registers map.

Optional properties:
- clocks: Handle to the ECAP's functional clock.
- clock-names: Must be set to "fck".

Example:

ecap0: ecap@48300100 { /* ECAP on am33xx */
	compatible = "ti,am3352-ecap", "ti,am33xx-ecap";
	#pwm-cells = <3>;
	reg = <0x48300100 0x80>;
	clocks = <&l4ls_gclk>;
	clock-names = "fck";
};

ecap0: ecap@48300100 { /* ECAP on am4372 */
	compatible = "ti,am4372-ecap", "ti,am3352-ecap", "ti,am33xx-ecap";
	#pwm-cells = <3>;
	reg = <0x48300100 0x80>;
	ti,hwmods = "ecap0";
	clocks = <&l4ls_gclk>;
	clock-names = "fck";
};

ecap0: ecap@1f06000 { /* ECAP on da850 */
	compatible = "ti,da850-ecap", "ti,am3352-ecap", "ti,am33xx-ecap";
	#pwm-cells = <3>;
	reg = <0x1f06000 0x80>;
};

ecap0: ecap@4843e100 {
	compatible = "ti,dra746-ecap", "ti,am3352-ecap";
	#pwm-cells = <3>;
	reg = <0x4843e100 0x80>;
	clocks = <&l4_root_clk_div>;
	clock-names = "fck";
};
+64 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/pwm/pwm-tiecap.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: TI SOC ECAP based APWM controller

maintainers:
  - Vignesh R <vigneshr@ti.com>

allOf:
  - $ref: pwm.yaml#

properties:
  compatible:
    oneOf:
      - const: ti,am3352-ecap
      - items:
          - enum:
              - ti,da850-ecap
              - ti,am4372-ecap
              - ti,dra746-ecap
              - ti,k2g-ecap
              - ti,am654-ecap
              - ti,am64-ecap
          - const: ti,am3352-ecap

  reg:
    maxItems: 1

  "#pwm-cells":
    const: 3
    description: |
      See pwm.yaml in this directory for a description of the cells format.
      The only third cell flag supported by this binding is PWM_POLARITY_INVERTED.

  clock-names:
    const: fck

  clocks:
    maxItems: 1

  power-domains:
    maxItems: 1

required:
  - compatible
  - reg
  - "#pwm-cells"
  - clocks
  - clock-names

additionalProperties: false

examples:
  - |
    ecap0: pwm@48300100 { /* ECAP on am33xx */
        compatible = "ti,am3352-ecap";
        #pwm-cells = <3>;
        reg = <0x48300100 0x80>;
        clocks = <&l4ls_gclk>;
        clock-names = "fck";
    };
+0 −50
Original line number Diff line number Diff line
TI SOC EHRPWM based PWM controller

Required properties:
- compatible: Must be "ti,<soc>-ehrpwm".
  for am33xx  - compatible = "ti,am3352-ehrpwm", "ti,am33xx-ehrpwm";
  for am4372  - compatible = "ti,am4372-ehrpwm", "ti-am3352-ehrpwm", "ti,am33xx-ehrpwm";
  for am654   - compatible = "ti,am654-ehrpwm", "ti-am3352-ehrpwm";
  for da850   - compatible = "ti,da850-ehrpwm", "ti-am3352-ehrpwm", "ti,am33xx-ehrpwm";
  for dra746 - compatible = "ti,dra746-ehrpwm", "ti-am3352-ehrpwm";
- #pwm-cells: should be 3. See pwm.yaml in this directory for a description of
  the cells format. The only third cell flag supported by this binding is
  PWM_POLARITY_INVERTED.
- reg: physical base address and size of the registers map.

Optional properties:
- clocks: Handle to the PWM's time-base and functional clock.
- clock-names: Must be set to "tbclk" and "fck".

Example:

ehrpwm0: pwm@48300200 { /* EHRPWM on am33xx */
	compatible = "ti,am3352-ehrpwm", "ti,am33xx-ehrpwm";
	#pwm-cells = <3>;
	reg = <0x48300200 0x100>;
	clocks = <&ehrpwm0_tbclk>, <&l4ls_gclk>;
	clock-names = "tbclk", "fck";
};

ehrpwm0: pwm@48300200 { /* EHRPWM on am4372 */
	compatible = "ti,am4372-ehrpwm", "ti,am3352-ehrpwm", "ti,am33xx-ehrpwm";
	#pwm-cells = <3>;
	reg = <0x48300200 0x80>;
	clocks = <&ehrpwm0_tbclk>, <&l4ls_gclk>;
	clock-names = "tbclk", "fck";
	ti,hwmods = "ehrpwm0";
};

ehrpwm0: pwm@1f00000 { /* EHRPWM on da850 */
	compatible = "ti,da850-ehrpwm", "ti,am3352-ehrpwm", "ti,am33xx-ehrpwm";
	#pwm-cells = <3>;
	reg = <0x1f00000 0x2000>;
};

ehrpwm0: pwm@4843e200 { /* EHRPWM on dra746 */
	compatible = "ti,dra746-ehrpwm", "ti,am3352-ehrpwm";
	#pwm-cells = <3>;
	reg = <0x4843e200 0x80>;
	clocks = <&ehrpwm0_tbclk>, <&l4_root_clk_div>;
	clock-names = "tbclk", "fck";
};
+65 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/pwm/pwm-tiehrpwm.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: TI SOC EHRPWM based PWM controller

maintainers:
  - Vignesh R <vigneshr@ti.com>

allOf:
  - $ref: pwm.yaml#

properties:
  compatible:
    oneOf:
      - const: ti,am3352-ehrpwm
      - items:
          - enum:
              - ti,da850-ehrpwm
              - ti,am4372-ehrpwm
              - ti,dra746-ehrpwm
              - ti,am654-ehrpwm
              - ti,am64-epwm
          - const: ti,am3352-ehrpwm

  reg:
    maxItems: 1

  "#pwm-cells":
    const: 3
    description: |
      See pwm.yaml in this directory for a description of the cells format.
      The only third cell flag supported by this binding is PWM_POLARITY_INVERTED.

  clock-names:
    items:
      - const: tbclk
      - const: fck

  clocks:
    maxItems: 2

  power-domains:
    maxItems: 1

required:
  - compatible
  - reg
  - "#pwm-cells"
  - clocks
  - clock-names

additionalProperties: false

examples:
  - |
    ehrpwm0: pwm@48300200 { /* EHRPWM on am33xx */
        compatible = "ti,am3352-ehrpwm";
        #pwm-cells = <3>;
        reg = <0x48300200 0x100>;
        clocks = <&ehrpwm0_tbclk>, <&l4ls_gclk>;
        clock-names = "tbclk", "fck";
    };
+2 −1
Original line number Diff line number Diff line
@@ -400,7 +400,8 @@ POWER

PWM
  devm_pwm_get()
  devm_pwm_put()
  devm_of_pwm_get()
  devm_fwnode_pwm_get()

REGULATOR
  devm_regulator_bulk_get()
Loading