Commit 89b7fd5d authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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

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

Pull pwm updates from Thierry Reding:
 "The bulk of this is trivial conversions to the new .remove_new()
  callback for drivers as part of Uwe's effort to clean that up.

  Other than that a driver is added for Apple devices and various small
  fixes are included for existing drivers.

  Last but not least, this finally gets rid of the old pwm_request() and
  pwm_free() APIs are removed since the last user was dropped in v6.3"

* tag 'pwm/for-6.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm: (44 commits)
  pwm: Remove unused radix tree
  pwm: Delete deprecated functions pwm_request() and pwm_free()
  pwm: meson: Fix g12a ao clk81 name
  pwm: meson: Fix axg ao mux parents
  pwm: stm32: Enforce settings for PWM capture
  MAINTAINERS: Add entries for Apple PWM driver
  pwm: Add Apple PWM controller
  dt-bindings: pwm: Add Apple PWM controller
  pwm: mtk-disp: Configure double buffering before reading in .get_state()
  pwm: mtk-disp: Disable shadow registers before setting backlight values
  pwm: stm32-lp: Drop of_match_ptr for ID table
  pwm: rcar: Drop of_match_ptr for ID table
  dt-bindings: pwm: Convert Amlogic Meson PWM binding
  dt-bindings: pwm: mediatek: Add mediatek,mt7986 compatible
  pwm: xilinx: Convert to platform remove callback returning void
  pwm: vt8500: Convert to platform remove callback returning void
  pwm: tiehrpwm: Convert to platform remove callback returning void
  pwm: tiecap: Convert to platform remove callback returning void
  pwm: tegra: Convert to platform remove callback returning void
  pwm: sun4i: Convert to platform remove callback returning void
  ...
parents 4c9818d8 247ee6c7
Loading
Loading
Loading
Loading
+51 −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/apple,s5l-fpwm.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Apple FPWM controller

maintainers:
  - asahi@lists.linux.dev
  - Sasha Finkelstein <fnkl.kernel@gmail.com>

description: PWM controller used for keyboard backlight on ARM Macs

properties:
  compatible:
    items:
      - enum:
          - apple,t8103-fpwm
          - apple,t6000-fpwm
          - apple,t8112-fpwm
      - const: apple,s5l-fpwm

  reg:
    maxItems: 1

  clocks:
    maxItems: 1

  power-domains:
    maxItems: 1

  "#pwm-cells":
    const: 2

required:
  - compatible
  - reg
  - clocks

additionalProperties: false

examples:
  - |
    pwm@235044000 {
      compatible = "apple,t8103-fpwm", "apple,s5l-fpwm";
      reg = <0x35044000 0x4000>;
      power-domains = <&ps_fpwm1>;
      clocks = <&clkref>;
      #pwm-cells = <2>;
    };
+1 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ properties:
          - mediatek,mt7623-pwm
          - mediatek,mt7628-pwm
          - mediatek,mt7629-pwm
          - mediatek,mt7986-pwm
          - mediatek,mt8183-pwm
          - mediatek,mt8365-pwm
          - mediatek,mt8516-pwm
+70 −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-amlogic.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Amlogic PWM

maintainers:
  - Heiner Kallweit <hkallweit1@gmail.com>

allOf:
  - $ref: pwm.yaml#

properties:
  compatible:
    oneOf:
      - enum:
          - amlogic,meson8b-pwm
          - amlogic,meson-gxbb-pwm
          - amlogic,meson-gxbb-ao-pwm
          - amlogic,meson-axg-ee-pwm
          - amlogic,meson-axg-ao-pwm
          - amlogic,meson-g12a-ee-pwm
          - amlogic,meson-g12a-ao-pwm-ab
          - amlogic,meson-g12a-ao-pwm-cd
          - amlogic,meson-s4-pwm
      - items:
          - const: amlogic,meson-gx-pwm
          - const: amlogic,meson-gxbb-pwm
      - items:
          - const: amlogic,meson-gx-ao-pwm
          - const: amlogic,meson-gxbb-ao-pwm
      - items:
          - const: amlogic,meson8-pwm
          - const: amlogic,meson8b-pwm

  reg:
    maxItems: 1

  clocks:
    minItems: 1
    maxItems: 2

  clock-names:
    oneOf:
      - items:
          - enum: [clkin0, clkin1]
      - items:
          - const: clkin0
          - const: clkin1

  "#pwm-cells":
    const: 3

required:
  - compatible
  - reg

additionalProperties: false

examples:
  - |
    pwm@8550 {
      compatible = "amlogic,meson-gxbb-pwm";
      reg = <0x08550 0x10>;
      clocks = <&xtal>, <&xtal>;
      clock-names = "clkin0", "clkin1";
      #pwm-cells = <3>;
    };
+0 −29
Original line number Diff line number Diff line
Amlogic Meson PWM Controller
============================

Required properties:
- compatible: Shall contain "amlogic,meson8b-pwm"
                         or "amlogic,meson-gxbb-pwm"
                         or "amlogic,meson-gxbb-ao-pwm"
                         or "amlogic,meson-axg-ee-pwm"
                         or "amlogic,meson-axg-ao-pwm"
                         or "amlogic,meson-g12a-ee-pwm"
                         or "amlogic,meson-g12a-ao-pwm-ab"
                         or "amlogic,meson-g12a-ao-pwm-cd"
- #pwm-cells: Should be 3. See pwm.yaml in this directory for a description of
  the cells format.

Optional properties:
- clocks: Could contain one or two parents clocks phandle for each of the two
  PWM channels.
- clock-names: Could contain at least the "clkin0" and/or "clkin1" names.

Example:

	pwm_ab: pwm@8550 {
		compatible = "amlogic,meson-gxbb-pwm";
		reg = <0x0 0x08550 0x0 0x10>;
		#pwm-cells = <3>;
		clocks = <&xtal>, <&xtal>;
		clock-names = "clkin0", "clkin1";
	}
+5 −8
Original line number Diff line number Diff line
@@ -35,12 +35,9 @@ consumers to providers, as given in the following example::
Using PWMs
----------

Legacy users can request a PWM device using pwm_request() and free it
after usage with pwm_free().

New users should use the pwm_get() function and pass to it the consumer
device or a consumer name. pwm_put() is used to free the PWM device. Managed
variants of the getter, devm_pwm_get() and devm_fwnode_pwm_get(), also exist.
Consumers use the pwm_get() function and pass to it the consumer device or a
consumer name. pwm_put() is used to free the PWM device. Managed variants of
the getter, devm_pwm_get() and devm_fwnode_pwm_get(), also exist.

After being requested, a PWM has to be configured using::

@@ -165,8 +162,8 @@ consumers should implement it as described in the "Using PWMs" section.
Locking
-------

The PWM core list manipulations are protected by a mutex, so pwm_request()
and pwm_free() may not be called from an atomic context. Currently the
The PWM core list manipulations are protected by a mutex, so pwm_get()
and pwm_put() may not be called from an atomic context. Currently the
PWM core does not enforce any locking to pwm_enable(), pwm_disable() and
pwm_config(), so the calling context is currently driver specific. This
is an issue derived from the former barebone API and should be fixed soon.
Loading