Skip to content

Commit e9b988a

Browse files
authored
Merge pull request #148 from xuyan213/pwm
Phytium PWM support
2 parents 3bc2239 + fc6d903 commit e9b988a

File tree

5 files changed

+669
-1
lines changed

5 files changed

+669
-1
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/pwm/phytium,pwm.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Phytium PWM controller
8+
9+
maintainers:
10+
- Chen Baozi <[email protected]>
11+
12+
allOf:
13+
- $ref: pwm.yaml#
14+
15+
properties:
16+
compatible:
17+
const: phytium,pwm
18+
19+
reg:
20+
maxItems: 1
21+
22+
clocks:
23+
description: Clock specifiers for both ipg and per clocks.
24+
25+
interrupts:
26+
maxItems: 1
27+
28+
phytium,db:
29+
description: |
30+
One or two <cntmod dutymod div updbcly dbpolarity> to describe dead-band configurations.
31+
"cntmod" indicates the counter mode (0 for modulo, 1 for up-and-down).
32+
"dutymod" indicdates which duty to compare with (0 for PMW_CCR, 1 for FIFO).
33+
"div" selects the clock divider value, from 0 to 1023.
34+
"updbcly" selects the rising edge delay cycles.
35+
"dbpolarity" selects the polarity for dead-band.
36+
$ref: /schemas/types.yaml#/definitions/uint32-array
37+
uniqueItems: true
38+
items:
39+
minimum: 1
40+
maximum: 2
41+
42+
43+
required:
44+
- compatible
45+
- reg
46+
- clocks
47+
- interrupts
48+
- phytium,db
49+
50+
additionalProperties: false
51+
52+
examples:
53+
- |
54+
pwm0: pwm@2804a000 {
55+
compatible = "phytium,pwm";
56+
reg= <0x0 0x2804a000 0x0 0x1000>;
57+
interrupts = <GIC_SPI 173 IRQ_TYPE_LEVEL_HIGH>;
58+
clocks = <&sysclk_48mhz>;
59+
phytium,db = <0 0 0 1000 0>;
60+
};

drivers/pwm/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,16 @@ config PWM_PCA9685
454454
To compile this driver as a module, choose M here: the module
455455
will be called pwm-pca9685.
456456

457+
config PWM_PHYTIUM
458+
tristate "Phytium PWM support"
459+
depends on ARCH_PHYTIUM
460+
help
461+
Generic PWM framework driver for the PWM controller found on
462+
Phytium SoCs.
463+
464+
To compile this driver as a module, choose M here: the module
465+
will be called pwm-phytium.
466+
457467
config PWM_PXA
458468
tristate "PXA PWM support"
459469
depends on ARCH_PXA || ARCH_MMP || COMPILE_TEST

drivers/pwm/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ obj-$(CONFIG_PWM_MXS) += pwm-mxs.o
4141
obj-$(CONFIG_PWM_NTXEC) += pwm-ntxec.o
4242
obj-$(CONFIG_PWM_OMAP_DMTIMER) += pwm-omap-dmtimer.o
4343
obj-$(CONFIG_PWM_PCA9685) += pwm-pca9685.o
44+
obj-$(CONFIG_PWM_PHYTIUM) += pwm-phytium.o
4445
obj-$(CONFIG_PWM_PXA) += pwm-pxa.o
4546
obj-$(CONFIG_PWM_RASPBERRYPI_POE) += pwm-raspberrypi-poe.o
4647
obj-$(CONFIG_PWM_RCAR) += pwm-rcar.o

0 commit comments

Comments
 (0)