Commit a5d51e02 authored by Uwe Kleine-König's avatar Uwe Kleine-König
Browse files

Merge branch 'pwm/th1520' into pwm/for-next

parents 0a47e5e8 9075ceea
Loading
Loading
Loading
Loading
+48 −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/thead,th1520-pwm.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: T-HEAD TH1520 PWM controller

maintainers:
  - Michal Wilczynski <m.wilczynski@samsung.com>

allOf:
  - $ref: pwm.yaml#

properties:
  compatible:
    const: thead,th1520-pwm

  reg:
    maxItems: 1

  clocks:
    items:
      - description: SoC PWM clock

  "#pwm-cells":
    const: 3

required:
  - compatible
  - reg
  - clocks

unevaluatedProperties: false

examples:
  - |
    #include <dt-bindings/clock/thead,th1520-clk-ap.h>
    soc {
      #address-cells = <2>;
      #size-cells = <2>;
      pwm@ffec01c000 {
          compatible = "thead,th1520-pwm";
          reg = <0xff 0xec01c000 0x0 0x4000>;
          clocks = <&clk CLK_PWM>;
          #pwm-cells = <3>;
      };
    };
+10 −0
Original line number Diff line number Diff line
@@ -20763,6 +20763,14 @@ F: include/linux/pwm.h
F:	include/linux/pwm_backlight.h
K:	pwm_(config|apply_might_sleep|apply_atomic|ops)
PWM SUBSYSTEM BINDINGS [RUST]
M:	Michal Wilczynski <m.wilczynski@samsung.com>
L:	linux-pwm@vger.kernel.org
L:	rust-for-linux@vger.kernel.org
S:	Maintained
F:	rust/helpers/pwm.c
F:	rust/kernel/pwm.rs
PXA GPIO DRIVER
M:	Robert Jarzmik <robert.jarzmik@free.fr>
L:	linux-gpio@vger.kernel.org
@@ -22171,6 +22179,7 @@ F: Documentation/devicetree/bindings/firmware/thead,th1520-aon.yaml
F:	Documentation/devicetree/bindings/mailbox/thead,th1520-mbox.yaml
F:	Documentation/devicetree/bindings/net/thead,th1520-gmac.yaml
F:	Documentation/devicetree/bindings/pinctrl/thead,th1520-pinctrl.yaml
F:	Documentation/devicetree/bindings/pwm/thead,th1520-pwm.yaml
F:	Documentation/devicetree/bindings/reset/thead,th1520-reset.yaml
F:	arch/riscv/boot/dts/thead/
F:	drivers/clk/thead/clk-th1520-ap.c
@@ -22181,6 +22190,7 @@ F: drivers/pinctrl/pinctrl-th1520.c
F:	drivers/pmdomain/thead/
F:	drivers/power/reset/th1520-aon-reboot.c
F:	drivers/power/sequencing/pwrseq-thead-gpu.c
F:	drivers/pwm/pwm_th1520.rs
F:	drivers/reset/reset-th1520.c
F:	include/dt-bindings/clock/thead,th1520-clk-ap.h
F:	include/dt-bindings/power/thead,th1520-power.h
+23 −0
Original line number Diff line number Diff line
@@ -758,6 +758,17 @@ config PWM_TEGRA
	  To compile this driver as a module, choose M here: the module
	  will be called pwm-tegra.

config PWM_TH1520
	tristate "TH1520 PWM support"
	depends on RUST
	select RUST_PWM_ABSTRACTIONS
	help
	  This option enables the driver for the PWM controller found on the
	  T-HEAD TH1520 SoC.

	  To compile this driver as a module, choose M here; the module
	  will be called pwm-th1520. If you are unsure, say N.

config PWM_TIECAP
	tristate "ECAP PWM support"
	depends on ARCH_OMAP2PLUS || ARCH_DAVINCI_DA8XX || ARCH_KEYSTONE || ARCH_K3 || COMPILE_TEST
@@ -829,4 +840,16 @@ config PWM_XILINX
	  To compile this driver as a module, choose M here: the module
	  will be called pwm-xilinx.

 config RUST_PWM_ABSTRACTIONS
	bool
	depends on RUST
	help
	  This option enables the safe Rust abstraction layer for the PWM
	  subsystem. It provides idiomatic wrappers and traits necessary for
	  writing PWM controller drivers in Rust.

	  The abstractions handle resource management (like memory and reference
	  counting) and provide safe interfaces to the underlying C core,
	  allowing driver logic to be written in safe Rust.

endif
+1 −0
Original line number Diff line number Diff line
@@ -69,6 +69,7 @@ obj-$(CONFIG_PWM_STMPE) += pwm-stmpe.o
obj-$(CONFIG_PWM_SUN4I)		+= pwm-sun4i.o
obj-$(CONFIG_PWM_SUNPLUS)	+= pwm-sunplus.o
obj-$(CONFIG_PWM_TEGRA)		+= pwm-tegra.o
obj-$(CONFIG_PWM_TH1520)	+= pwm_th1520.o
obj-$(CONFIG_PWM_TIECAP)	+= pwm-tiecap.o
obj-$(CONFIG_PWM_TIEHRPWM)	+= pwm-tiehrpwm.o
obj-$(CONFIG_PWM_TWL)		+= pwm-twl.o
+2 −1
Original line number Diff line number Diff line
@@ -1608,12 +1608,13 @@ void pwmchip_put(struct pwm_chip *chip)
}
EXPORT_SYMBOL_GPL(pwmchip_put);

static void pwmchip_release(struct device *pwmchip_dev)
void pwmchip_release(struct device *pwmchip_dev)
{
	struct pwm_chip *chip = pwmchip_from_dev(pwmchip_dev);

	kfree(chip);
}
EXPORT_SYMBOL_GPL(pwmchip_release);

struct pwm_chip *pwmchip_alloc(struct device *parent, unsigned int npwm, size_t sizeof_priv)
{
Loading