Skip to content

Commit

Permalink
Phytium PWM support
Browse files Browse the repository at this point in the history
Generic PWM framework driver for the PWM controller found on
Phytium SoCs.

Signed-off-by: xu yan <[email protected]>
Signed-off-by: Chen Zhenhua <[email protected]>
Signed-off-by: Wang Yinfeng <[email protected]>
Signed-off-by: lanhengyu1395 <[email protected]>
  • Loading branch information
xu yan committed May 15, 2024
1 parent ecf00ab commit 84cbdb1
Show file tree
Hide file tree
Showing 5 changed files with 662 additions and 1 deletion.
60 changes: 60 additions & 0 deletions Documentation/devicetree/bindings/pwm/phytium,pwm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/pwm/phytium,pwm.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Phytium PWM controller

maintainers:
- Chen Baozi <[email protected]>

allOf:
- $ref: pwm.yaml#

properties:
compatible:
const: phytium,pwm

reg:
maxItems: 1

clocks:
description: Clock specifiers for both ipg and per clocks.

interrupts:
maxItems: 1

phytium,db:
description: |
One or two <cntmod dutymod div updbcly dbpolarity> to describe dead-band configurations.
"cntmod" indicates the counter mode (0 for modulo, 1 for up-and-down).
"dutymod" indicdates which duty to compare with (0 for PMW_CCR, 1 for FIFO).
"div" selects the clock divider value, from 0 to 1023.
"updbcly" selects the rising edge delay cycles.
"dbpolarity" selects the polarity for dead-band.
$ref: /schemas/types.yaml#/definitions/uint32-array
uniqueItems: true
items:
minimum: 1
maximum: 2


required:
- compatible
- reg
- clocks
- interrupts
- phytium,db

additionalProperties: false

examples:
- |
pwm0: pwm@2804a000 {
compatible = "phytium,pwm";
reg= <0x0 0x2804a000 0x0 0x1000>;
interrupts = <GIC_SPI 173 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&sysclk_48mhz>;
phytium,db = <0 0 0 1000 0>;
};
10 changes: 10 additions & 0 deletions drivers/pwm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,16 @@ config PWM_PCA9685
To compile this driver as a module, choose M here: the module
will be called pwm-pca9685.

config PWM_PHYTIUM
tristate "Phytium PWM support"
depends on ARCH_PHYTIUM
help
Generic PWM framework driver for the PWM controller found on
Phytium SoCs.

To compile this driver as a module, choose M here: the module
will be called pwm-phytium.

config PWM_PXA
tristate "PXA PWM support"
depends on ARCH_PXA || ARCH_MMP || COMPILE_TEST
Expand Down
1 change: 1 addition & 0 deletions drivers/pwm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ obj-$(CONFIG_PWM_MXS) += pwm-mxs.o
obj-$(CONFIG_PWM_NTXEC) += pwm-ntxec.o
obj-$(CONFIG_PWM_OMAP_DMTIMER) += pwm-omap-dmtimer.o
obj-$(CONFIG_PWM_PCA9685) += pwm-pca9685.o
obj-$(CONFIG_PWM_PHYTIUM) += pwm-phytium.o
obj-$(CONFIG_PWM_PXA) += pwm-pxa.o
obj-$(CONFIG_PWM_RASPBERRYPI_POE) += pwm-raspberrypi-poe.o
obj-$(CONFIG_PWM_RCAR) += pwm-rcar.o
Expand Down
Loading

0 comments on commit 84cbdb1

Please sign in to comment.