Commit aeb15291 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull pwm updates from Uwe Kleine-König:
 "This contains the usual amount of driver and device tree changes.
  Additionally there is a big rework of how pwm lowlevel drivers are
  registered to prepare adding character device support.

  Thanks to Dharma Balasubiramani, Dong Aisheng, Duje Mihanović, Jerome
  Brunet, Raag Jadav and Rafał Miłecki for their contributions. And
  sorry for those who still need some patience because I didn't manage
  to empty my review queue"

* tag 'pwm/for-6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux: (185 commits)
  pwm: imx-tpm: fix probe crash due to access registers without clock
  pwm: meson: generalize 4 inputs clock on meson8 pwm type
  dt-bindings: pwm: amlogic: Add a new binding for meson8 pwm types
  dt-bindings: pwm: amlogic: fix s4 bindings
  pwm: dwc: simplify error handling
  pwm: dwc: Add 16 channel support for Intel Elkhart Lake
  pwm: dwc: drop redundant error check
  staging: greybus: pwm: Make use of devm_pwmchip_alloc() function
  staging: greybus: pwm: Rework how the number of PWM lines is determined
  staging: greybus: pwm: Drop unused gb_connection_set_data()
  staging: greybus: pwm: Rely on pwm framework to pass a valid hwpwm
  staging: greybus: pwm: Make use of pwmchip_parent() accessor
  staging: greybus: pwm: Change prototype of helpers to prepare further changes
  leds: qcom-lpg: Make use of devm_pwmchip_alloc() function
  drm/bridge: ti-sn65dsi86: Make use of devm_pwmchip_alloc() function
  drm/bridge: ti-sn65dsi86: Make use of pwmchip_parent() accessor
  gpio: mvebu: Make use of devm_pwmchip_alloc() function
  pwm: xilinx: Make use of devm_pwmchip_alloc() function
  pwm: xilinx: Prepare removing pwm_chip from driver data
  pwm: vt8500: Make use of devm_pwmchip_alloc() function
  ...
parents aa7d6513 dd6c6d57
Loading
Loading
Loading
Loading
+35 −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/atmel,hlcdc-pwm.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Atmel's HLCDC's PWM controller

maintainers:
  - Nicolas Ferre <nicolas.ferre@microchip.com>
  - Alexandre Belloni <alexandre.belloni@bootlin.com>
  - Claudiu Beznea <claudiu.beznea@tuxon.dev>

description:
  The LCDC integrates a Pulse Width Modulation (PWM) Controller. This block
  generates the LCD contrast control signal (LCD_PWM) that controls the
  display's contrast by software. LCDC_PWM is an 8-bit PWM signal that can be
  converted to an analog voltage with a simple passive filter. LCD display
  panels have different backlight specifications in terms of minimum/maximum
  values for PWM frequency. If the LCDC PWM frequency range does not match the
  LCD display panel, it is possible to use the standalone PWM Controller to
  drive the backlight.

properties:
  compatible:
    const: atmel,hlcdc-pwm

  "#pwm-cells":
    const: 3

required:
  - compatible
  - "#pwm-cells"

additionalProperties: false
+0 −29
Original line number Diff line number Diff line
Device-Tree bindings for Atmel's HLCDC (High-end LCD Controller) PWM driver

The Atmel HLCDC PWM is subdevice of the HLCDC MFD device.
See ../mfd/atmel-hlcdc.txt for more details.

Required properties:
 - compatible: value should be one of the following:
   "atmel,hlcdc-pwm"
 - pinctr-names: the pin control state names. Should contain "default".
 - pinctrl-0: should contain the pinctrl states described by pinctrl
   default.
 - #pwm-cells: should be set to 3. This PWM chip use the default 3 cells
   bindings defined in pwm.yaml in this directory.

Example:

	hlcdc: hlcdc@f0030000 {
		compatible = "atmel,sama5d3-hlcdc";
		reg = <0xf0030000 0x2000>;
		clocks = <&lcdc_clk>, <&lcdck>, <&clk32k>;
		clock-names = "periph_clk","sys_clk", "slow_clk";

		hlcdc_pwm: hlcdc-pwm {
			compatible = "atmel,hlcdc-pwm";
			pinctrl-names = "default";
			pinctrl-0 = <&pinctrl_lcd_pwm>;
			#pwm-cells = <3>;
		};
	};
+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/marvell,pxa-pwm.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Marvell PXA PWM

maintainers:
  - Duje Mihanović <duje.mihanovic@skole.hr>

allOf:
  - $ref: pwm.yaml#

properties:
  compatible:
    enum:
      - marvell,pxa250-pwm
      - marvell,pxa270-pwm
      - marvell,pxa168-pwm
      - marvell,pxa910-pwm

  reg:
    # Length should be 0x10
    maxItems: 1

  "#pwm-cells":
    # Used for specifying the period length in nanoseconds
    const: 1

  clocks:
    maxItems: 1

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

additionalProperties: false

examples:
  - |
    #include <dt-bindings/clock/pxa-clock.h>

    pwm0: pwm@40b00000 {
      compatible = "marvell,pxa250-pwm";
      reg = <0x40b00000 0x10>;
      #pwm-cells = <1>;
      clocks = <&clks CLK_PWM0>;
    };
+1 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ properties:
          - mediatek,mt7629-pwm
          - mediatek,mt7981-pwm
          - mediatek,mt7986-pwm
          - mediatek,mt7988-pwm
          - mediatek,mt8183-pwm
          - mediatek,mt8365-pwm
          - mediatek,mt8516-pwm
+104 −11
Original line number Diff line number Diff line
@@ -9,9 +9,6 @@ title: Amlogic PWM
maintainers:
  - Heiner Kallweit <hkallweit1@gmail.com>

allOf:
  - $ref: pwm.yaml#

properties:
  compatible:
    oneOf:
@@ -24,24 +21,74 @@ properties:
          - amlogic,meson-g12a-ee-pwm
          - amlogic,meson-g12a-ao-pwm-ab
          - amlogic,meson-g12a-ao-pwm-cd
          - amlogic,meson-s4-pwm
        deprecated: true
      - items:
          - const: amlogic,meson-gx-pwm
          - const: amlogic,meson-gxbb-pwm
        deprecated: true
      - items:
          - const: amlogic,meson-gx-ao-pwm
          - const: amlogic,meson-gxbb-ao-pwm
        deprecated: true
      - items:
          - const: amlogic,meson8-pwm
          - const: amlogic,meson8b-pwm
        deprecated: true
      - enum:
          - amlogic,meson8-pwm-v2
          - amlogic,meson-s4-pwm
      - items:
          - enum:
              - amlogic,meson8b-pwm-v2
              - amlogic,meson-gxbb-pwm-v2
              - amlogic,meson-axg-pwm-v2
              - amlogic,meson-g12-pwm-v2
          - const: amlogic,meson8-pwm-v2

  reg:
    maxItems: 1

  clocks:
    minItems: 1
    maxItems: 4

  clock-names:
    minItems: 1
    maxItems: 2

  "#pwm-cells":
    const: 3

required:
  - compatible
  - reg

allOf:
  - $ref: pwm.yaml#

  - if:
      properties:
        compatible:
          contains:
            enum:
              - amlogic,meson8-pwm
              - 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
    then:
      # Obsolete historic bindings tied to the driver implementation
      # The clocks provided here are meant to be matched with the input
      # known (hard-coded) in the driver and used to select pwm clock
      # source. Currently, the linux driver ignores this.
      # This is kept to maintain ABI backward compatibility.
      properties:
        clocks:
          maxItems: 2
        clock-names:
          oneOf:
            - items:
@@ -50,12 +97,44 @@ properties:
                - const: clkin0
                - const: clkin1

  "#pwm-cells":
    const: 3
  # Newer binding where clock describe the actual clock inputs of the pwm
  # block. These are necessary but some inputs may be grounded.
  - if:
      properties:
        compatible:
          contains:
            enum:
              - amlogic,meson8-pwm-v2
    then:
      properties:
        clocks:
          minItems: 1
          items:
            - description: input clock 0 of the pwm block
            - description: input clock 1 of the pwm block
            - description: input clock 2 of the pwm block
            - description: input clock 3 of the pwm block
        clock-names: false
      required:
        - clocks

  # Newer IP block take a single input per channel, instead of 4 inputs
  # for both channels
  - if:
      properties:
        compatible:
          contains:
            enum:
              - amlogic,meson-s4-pwm
    then:
      properties:
        clocks:
          items:
            - description: input clock of PWM channel A
            - description: input clock of PWM channel B
        clock-names: false
      required:
  - compatible
  - reg
        - clocks

additionalProperties: false

@@ -68,3 +147,17 @@ examples:
      clock-names = "clkin0", "clkin1";
      #pwm-cells = <3>;
    };
  - |
    pwm@2000 {
      compatible = "amlogic,meson8-pwm-v2";
      reg = <0x1000 0x10>;
      clocks = <&xtal>, <0>, <&fdiv4>, <&fdiv5>;
      #pwm-cells = <3>;
    };
  - |
    pwm@1000 {
      compatible = "amlogic,meson-s4-pwm";
      reg = <0x1000 0x10>;
      clocks = <&pwm_src_a>, <&pwm_src_b>;
      #pwm-cells = <3>;
    };
Loading