Skip to content

Commit 7b9df26

Browse files
committed
Merge tag 'pwm/for-5.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm
Pull pwm updates from Thierry Reding: "This adds support for the PWM controller found on Toshiba Visconti SoCs and converts a couple of drivers to the atomic API. There's also a bunch of cleanups and minor fixes across the board" * tag 'pwm/for-5.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm: (35 commits) pwm: Reword docs about pwm_apply_state() pwm: atmel: Improve duty cycle calculation in .apply() pwm: atmel: Fix duty cycle calculation in .get_state() pwm: visconti: Add Toshiba Visconti SoC PWM support dt-bindings: pwm: Add bindings for Toshiba Visconti PWM Controller arm64: dts: rockchip: Remove clock-names from PWM nodes ARM: dts: rockchip: Remove clock-names from PWM nodes dt-bindings: pwm: rockchip: Add more compatible strings dt-bindings: pwm: Convert pwm-rockchip.txt to YAML pwm: mediatek: Remove unused function pwm: pca9685: Improve runtime PM behavior pwm: pca9685: Support hardware readout pwm: pca9685: Switch to atomic API pwm: lpss: Don't modify HW state in .remove callback pwm: sti: Free resources only after pwmchip_remove() pwm: sti: Don't modify HW state in .remove callback pwm: lpc3200: Don't modify HW state in .remove callback pwm: lpc18xx-sct: Free resources only after pwmchip_remove() pwm: bcm-kona: Don't modify HW state in .remove callback pwm: bcm2835: Free resources only after pwmchip_remove() ...
2 parents 583f2bc + a6efb35 commit 7b9df26

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+619
-395
lines changed

Documentation/devicetree/bindings/pwm/pwm-rockchip.txt

Lines changed: 0 additions & 27 deletions
This file was deleted.
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/pwm/pwm-rockchip.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Rockchip PWM controller
8+
9+
maintainers:
10+
- Heiko Stuebner <[email protected]>
11+
12+
properties:
13+
compatible:
14+
oneOf:
15+
- const: rockchip,rk2928-pwm
16+
- const: rockchip,rk3288-pwm
17+
- const: rockchip,rk3328-pwm
18+
- const: rockchip,vop-pwm
19+
- items:
20+
- const: rockchip,rk3036-pwm
21+
- const: rockchip,rk2928-pwm
22+
- items:
23+
- enum:
24+
- rockchip,rk3368-pwm
25+
- rockchip,rk3399-pwm
26+
- rockchip,rv1108-pwm
27+
- const: rockchip,rk3288-pwm
28+
- items:
29+
- enum:
30+
- rockchip,px30-pwm
31+
- rockchip,rk3308-pwm
32+
- const: rockchip,rk3328-pwm
33+
34+
reg:
35+
maxItems: 1
36+
37+
clocks:
38+
minItems: 1
39+
maxItems: 2
40+
41+
clock-names:
42+
maxItems: 2
43+
44+
"#pwm-cells":
45+
enum: [2, 3]
46+
description:
47+
Must be 2 (rk2928) or 3 (rk3288 and later).
48+
See pwm.yaml for a description of the cell format.
49+
50+
required:
51+
- compatible
52+
- reg
53+
- "#pwm-cells"
54+
55+
if:
56+
properties:
57+
compatible:
58+
contains:
59+
enum:
60+
- rockchip,rk3328-pwm
61+
- rockchip,rv1108-pwm
62+
63+
then:
64+
properties:
65+
clocks:
66+
items:
67+
- description: Used to derive the functional clock for the device.
68+
- description: Used as the APB bus clock.
69+
70+
clock-names:
71+
items:
72+
- const: pwm
73+
- const: pclk
74+
75+
required:
76+
- clocks
77+
- clock-names
78+
79+
else:
80+
properties:
81+
clocks:
82+
maxItems: 1
83+
description:
84+
Used both to derive the functional clock
85+
for the device and as the bus clock.
86+
87+
required:
88+
- clocks
89+
90+
additionalProperties: false
91+
92+
examples:
93+
- |
94+
#include <dt-bindings/clock/rk3188-cru-common.h>
95+
pwm0: pwm@20030000 {
96+
compatible = "rockchip,rk2928-pwm";
97+
reg = <0x20030000 0x10>;
98+
clocks = <&cru PCLK_PWM01>;
99+
#pwm-cells = <2>;
100+
};
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/pwm/toshiba,pwm-visconti.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Toshiba Visconti PWM Controller
8+
9+
maintainers:
10+
- Nobuhiro Iwamatsu <[email protected]>
11+
12+
properties:
13+
compatible:
14+
items:
15+
- const: toshiba,visconti-pwm
16+
17+
reg:
18+
maxItems: 1
19+
20+
'#pwm-cells':
21+
const: 2
22+
23+
required:
24+
- compatible
25+
- reg
26+
- '#pwm-cells'
27+
28+
additionalProperties: false
29+
30+
examples:
31+
- |
32+
soc {
33+
#address-cells = <2>;
34+
#size-cells = <2>;
35+
36+
pwm: pwm@241c0000 {
37+
compatible = "toshiba,visconti-pwm";
38+
reg = <0 0x241c0000 0 0x1000>;
39+
pinctrl-names = "default";
40+
pinctrl-0 = <&pwm_mux>;
41+
#pwm-cells = <2>;
42+
};
43+
};

Documentation/driver-api/pwm.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,11 @@ several parameter at once. For example, if you see pwm_config() and
5555
pwm_{enable,disable}() calls in the same function, this probably means you
5656
should switch to pwm_apply_state().
5757

58-
The PWM user API also allows one to query the PWM state with pwm_get_state().
58+
The PWM user API also allows one to query the PWM state that was passed to the
59+
last invocation of pwm_apply_state() using pwm_get_state(). Note this is
60+
different to what the driver has actually implemented if the request cannot be
61+
satisfied exactly with the hardware in use. There is currently no way for
62+
consumers to get the actually implemented settings.
5963

6064
In addition to the PWM state, the PWM API also exposes PWM arguments, which
6165
are the reference PWM config one should use on this PWM.

arch/arm/boot/dts/rk3036.dtsi

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,6 @@
355355
reg = <0x20050000 0x10>;
356356
#pwm-cells = <3>;
357357
clocks = <&cru PCLK_PWM>;
358-
clock-names = "pwm";
359358
pinctrl-names = "default";
360359
pinctrl-0 = <&pwm0_pin>;
361360
status = "disabled";
@@ -366,7 +365,6 @@
366365
reg = <0x20050010 0x10>;
367366
#pwm-cells = <3>;
368367
clocks = <&cru PCLK_PWM>;
369-
clock-names = "pwm";
370368
pinctrl-names = "default";
371369
pinctrl-0 = <&pwm1_pin>;
372370
status = "disabled";
@@ -377,7 +375,6 @@
377375
reg = <0x20050020 0x10>;
378376
#pwm-cells = <3>;
379377
clocks = <&cru PCLK_PWM>;
380-
clock-names = "pwm";
381378
pinctrl-names = "default";
382379
pinctrl-0 = <&pwm2_pin>;
383380
status = "disabled";
@@ -388,7 +385,6 @@
388385
reg = <0x20050030 0x10>;
389386
#pwm-cells = <2>;
390387
clocks = <&cru PCLK_PWM>;
391-
clock-names = "pwm";
392388
pinctrl-names = "default";
393389
pinctrl-0 = <&pwm3_pin>;
394390
status = "disabled";

arch/arm/boot/dts/rk3288.dtsi

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,6 @@
679679
pinctrl-names = "default";
680680
pinctrl-0 = <&pwm0_pin>;
681681
clocks = <&cru PCLK_RKPWM>;
682-
clock-names = "pwm";
683682
status = "disabled";
684683
};
685684

@@ -690,7 +689,6 @@
690689
pinctrl-names = "default";
691690
pinctrl-0 = <&pwm1_pin>;
692691
clocks = <&cru PCLK_RKPWM>;
693-
clock-names = "pwm";
694692
status = "disabled";
695693
};
696694

@@ -701,7 +699,6 @@
701699
pinctrl-names = "default";
702700
pinctrl-0 = <&pwm2_pin>;
703701
clocks = <&cru PCLK_RKPWM>;
704-
clock-names = "pwm";
705702
status = "disabled";
706703
};
707704

@@ -712,7 +709,6 @@
712709
pinctrl-names = "default";
713710
pinctrl-0 = <&pwm3_pin>;
714711
clocks = <&cru PCLK_RKPWM>;
715-
clock-names = "pwm";
716712
status = "disabled";
717713
};
718714

arch/arm64/boot/dts/rockchip/rk3368.dtsi

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,6 @@
558558
pinctrl-names = "default";
559559
pinctrl-0 = <&pwm0_pin>;
560560
clocks = <&cru PCLK_PWM1>;
561-
clock-names = "pwm";
562561
status = "disabled";
563562
};
564563

@@ -569,7 +568,6 @@
569568
pinctrl-names = "default";
570569
pinctrl-0 = <&pwm1_pin>;
571570
clocks = <&cru PCLK_PWM1>;
572-
clock-names = "pwm";
573571
status = "disabled";
574572
};
575573

@@ -578,7 +576,6 @@
578576
reg = <0x0 0xff680020 0x0 0x10>;
579577
#pwm-cells = <3>;
580578
clocks = <&cru PCLK_PWM1>;
581-
clock-names = "pwm";
582579
status = "disabled";
583580
};
584581

@@ -589,7 +586,6 @@
589586
pinctrl-names = "default";
590587
pinctrl-0 = <&pwm3_pin>;
591588
clocks = <&cru PCLK_PWM1>;
592-
clock-names = "pwm";
593589
status = "disabled";
594590
};
595591

arch/arm64/boot/dts/rockchip/rk3399.dtsi

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1182,7 +1182,6 @@
11821182
pinctrl-names = "default";
11831183
pinctrl-0 = <&pwm0_pin>;
11841184
clocks = <&pmucru PCLK_RKPWM_PMU>;
1185-
clock-names = "pwm";
11861185
status = "disabled";
11871186
};
11881187

@@ -1193,7 +1192,6 @@
11931192
pinctrl-names = "default";
11941193
pinctrl-0 = <&pwm1_pin>;
11951194
clocks = <&pmucru PCLK_RKPWM_PMU>;
1196-
clock-names = "pwm";
11971195
status = "disabled";
11981196
};
11991197

@@ -1204,7 +1202,6 @@
12041202
pinctrl-names = "default";
12051203
pinctrl-0 = <&pwm2_pin>;
12061204
clocks = <&pmucru PCLK_RKPWM_PMU>;
1207-
clock-names = "pwm";
12081205
status = "disabled";
12091206
};
12101207

@@ -1215,7 +1212,6 @@
12151212
pinctrl-names = "default";
12161213
pinctrl-0 = <&pwm3a_pin>;
12171214
clocks = <&pmucru PCLK_RKPWM_PMU>;
1218-
clock-names = "pwm";
12191215
status = "disabled";
12201216
};
12211217

drivers/pwm/Kconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,15 @@ config PWM_TWL_LED
618618
To compile this driver as a module, choose M here: the module
619619
will be called pwm-twl-led.
620620

621+
config PWM_VISCONTI
622+
tristate "Toshiba Visconti PWM support"
623+
depends on ARCH_VISCONTI || COMPILE_TEST
624+
help
625+
PWM Subsystem driver support for Toshiba Visconti SoCs.
626+
627+
To compile this driver as a module, choose M here: the module
628+
will be called pwm-visconti.
629+
621630
config PWM_VT8500
622631
tristate "vt8500 PWM support"
623632
depends on ARCH_VT8500 || COMPILE_TEST

drivers/pwm/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,5 @@ obj-$(CONFIG_PWM_TIECAP) += pwm-tiecap.o
5858
obj-$(CONFIG_PWM_TIEHRPWM) += pwm-tiehrpwm.o
5959
obj-$(CONFIG_PWM_TWL) += pwm-twl.o
6060
obj-$(CONFIG_PWM_TWL_LED) += pwm-twl-led.o
61+
obj-$(CONFIG_PWM_VISCONTI) += pwm-visconti.o
6162
obj-$(CONFIG_PWM_VT8500) += pwm-vt8500.o

0 commit comments

Comments
 (0)