Skip to content

Commit d12f68b

Browse files
committed
Merge tag 'pwm/for-6.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux
Pull pwm updates from Uwe Kleine-König: "This time there are very little changes for pwm. There is nothing new, just a few maintenance cleanups. The contributors this time around were Krzysztof Kozlowski, Mingwei Zheng, Philipp Stanner, and Stanislav Jakubek. Thanks!" * tag 'pwm/for-6.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux: pwm: stm32: Add check for clk_enable() dt-bindings: pwm: Correct indentation and style in DTS example pwm: stm32-lp: Add check for clk_enable() dt-bindings: pwm: marvell,berlin-pwm: Convert from txt to yaml dt-bindings: pwm: sprd,ums512-pwm: convert to YAML pwm: Replace deprecated PCI functions
2 parents 2bf717b + e8c5979 commit d12f68b

File tree

11 files changed

+143
-86
lines changed

11 files changed

+143
-86
lines changed

Documentation/devicetree/bindings/pwm/adi,axi-pwmgen.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ unevaluatedProperties: false
4141
examples:
4242
- |
4343
pwm@44b00000 {
44-
compatible = "adi,axi-pwmgen-2.00.a";
45-
reg = <0x44b00000 0x1000>;
46-
clocks = <&spi_clk>;
47-
#pwm-cells = <3>;
44+
compatible = "adi,axi-pwmgen-2.00.a";
45+
reg = <0x44b00000 0x1000>;
46+
clocks = <&spi_clk>;
47+
#pwm-cells = <3>;
4848
};

Documentation/devicetree/bindings/pwm/brcm,bcm7038-pwm.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ additionalProperties: false
3535
examples:
3636
- |
3737
pwm: pwm@f0408000 {
38-
compatible = "brcm,bcm7038-pwm";
39-
reg = <0xf0408000 0x28>;
40-
#pwm-cells = <2>;
41-
clocks = <&upg_fixed>;
38+
compatible = "brcm,bcm7038-pwm";
39+
reg = <0xf0408000 0x28>;
40+
#pwm-cells = <2>;
41+
clocks = <&upg_fixed>;
4242
};

Documentation/devicetree/bindings/pwm/brcm,kona-pwm.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ examples:
4343
#include <dt-bindings/clock/bcm281xx.h>
4444
4545
pwm@3e01a000 {
46-
compatible = "brcm,bcm11351-pwm", "brcm,kona-pwm";
47-
reg = <0x3e01a000 0xcc>;
48-
clocks = <&slave_ccu BCM281XX_SLAVE_CCU_PWM>;
49-
#pwm-cells = <3>;
46+
compatible = "brcm,bcm11351-pwm", "brcm,kona-pwm";
47+
reg = <0x3e01a000 0xcc>;
48+
clocks = <&slave_ccu BCM281XX_SLAVE_CCU_PWM>;
49+
#pwm-cells = <3>;
5050
};
5151
...
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/pwm/marvell,berlin-pwm.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Berlin PWM controller
8+
9+
maintainers:
10+
- Jisheng Zhang <[email protected]>
11+
- Sebastian Hesselbarth <[email protected]>
12+
13+
properties:
14+
compatible:
15+
const: marvell,berlin-pwm
16+
17+
reg:
18+
maxItems: 1
19+
20+
"#pwm-cells":
21+
const: 3
22+
23+
clocks:
24+
maxItems: 1
25+
26+
required:
27+
- compatible
28+
- reg
29+
- clocks
30+
31+
allOf:
32+
- $ref: pwm.yaml#
33+
34+
unevaluatedProperties: false
35+
36+
examples:
37+
- |
38+
pwm@f7f20000 {
39+
compatible = "marvell,berlin-pwm";
40+
reg = <0xf7f20000 0x40>;
41+
clocks = <&chip_clk 12>;
42+
#pwm-cells = <3>;
43+
};
44+

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

Lines changed: 0 additions & 17 deletions
This file was deleted.

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

Lines changed: 0 additions & 40 deletions
This file was deleted.
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/pwm/sprd,ums512-pwm.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Spreadtrum/Unisoc UMS512 PWM Controller
8+
9+
maintainers:
10+
- Orson Zhai <[email protected]>
11+
- Baolin Wang <[email protected]>
12+
- Chunyan Zhang <[email protected]>
13+
14+
properties:
15+
compatible:
16+
const: sprd,ums512-pwm
17+
18+
reg:
19+
maxItems: 1
20+
21+
clocks:
22+
maxItems: 8
23+
24+
clock-names:
25+
items:
26+
- const: pwm0
27+
- const: enable0
28+
- const: pwm1
29+
- const: enable1
30+
- const: pwm2
31+
- const: enable2
32+
- const: pwm3
33+
- const: enable3
34+
35+
'#pwm-cells':
36+
const: 2
37+
38+
required:
39+
- compatible
40+
- reg
41+
- clocks
42+
- clock-names
43+
44+
allOf:
45+
- $ref: pwm.yaml#
46+
47+
unevaluatedProperties: false
48+
49+
examples:
50+
- |
51+
#include <dt-bindings/clock/sprd,ums512-clk.h>
52+
53+
pwm@32260000 {
54+
compatible = "sprd,ums512-pwm";
55+
reg = <0x32260000 0x10000>;
56+
clocks = <&aon_clk CLK_PWM0>, <&aonapb_gate CLK_PWM0_EB>,
57+
<&aon_clk CLK_PWM1>, <&aonapb_gate CLK_PWM1_EB>,
58+
<&aon_clk CLK_PWM2>, <&aonapb_gate CLK_PWM2_EB>,
59+
<&aon_clk CLK_PWM3>, <&aonapb_gate CLK_PWM3_EB>;
60+
clock-names = "pwm0", "enable0",
61+
"pwm1", "enable1",
62+
"pwm2", "enable2",
63+
"pwm3", "enable3";
64+
#pwm-cells = <2>;
65+
};
66+
...

drivers/pwm/pwm-dwc.c

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,20 +66,16 @@ static int dwc_pwm_probe(struct pci_dev *pci, const struct pci_device_id *id)
6666

6767
pci_set_master(pci);
6868

69-
ret = pcim_iomap_regions(pci, BIT(0), pci_name(pci));
70-
if (ret)
71-
return dev_err_probe(dev, ret, "Failed to iomap PCI BAR\n");
72-
7369
info = (const struct dwc_pwm_info *)id->driver_data;
7470
ddata = devm_kzalloc(dev, struct_size(ddata, chips, info->nr), GFP_KERNEL);
7571
if (!ddata)
7672
return -ENOMEM;
7773

78-
/*
79-
* No need to check for pcim_iomap_table() failure,
80-
* pcim_iomap_regions() already does it for us.
81-
*/
82-
ddata->io_base = pcim_iomap_table(pci)[0];
74+
ddata->io_base = pcim_iomap_region(pci, 0, "pwm-dwc");
75+
if (IS_ERR(ddata->io_base))
76+
return dev_err_probe(dev, PTR_ERR(ddata->io_base),
77+
"Failed to request / iomap PCI BAR\n");
78+
8379
ddata->info = info;
8480

8581
for (idx = 0; idx < ddata->info->nr; idx++) {

drivers/pwm/pwm-lpss-pci.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,20 @@ static int pwm_lpss_probe_pci(struct pci_dev *pdev,
1818
const struct pci_device_id *id)
1919
{
2020
const struct pwm_lpss_boardinfo *info;
21+
void __iomem *io_base;
2122
struct pwm_chip *chip;
2223
int err;
2324

2425
err = pcim_enable_device(pdev);
2526
if (err < 0)
2627
return err;
2728

28-
err = pcim_iomap_regions(pdev, BIT(0), pci_name(pdev));
29-
if (err)
30-
return err;
29+
io_base = pcim_iomap_region(pdev, 0, "pwm-lpss");
30+
if (IS_ERR(io_base))
31+
return PTR_ERR(io_base);
3132

3233
info = (struct pwm_lpss_boardinfo *)id->driver_data;
33-
chip = devm_pwm_lpss_probe(&pdev->dev, pcim_iomap_table(pdev)[0], info);
34+
chip = devm_pwm_lpss_probe(&pdev->dev, io_base, info);
3435
if (IS_ERR(chip))
3536
return PTR_ERR(chip);
3637

drivers/pwm/pwm-stm32-lp.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,12 @@ static int stm32_pwm_lp_get_state(struct pwm_chip *chip,
167167
regmap_read(priv->regmap, STM32_LPTIM_CR, &val);
168168
state->enabled = !!FIELD_GET(STM32_LPTIM_ENABLE, val);
169169
/* Keep PWM counter clock refcount in sync with PWM initial state */
170-
if (state->enabled)
171-
clk_enable(priv->clk);
170+
if (state->enabled) {
171+
int ret = clk_enable(priv->clk);
172+
173+
if (ret)
174+
return ret;
175+
}
172176

173177
regmap_read(priv->regmap, STM32_LPTIM_CFGR, &val);
174178
presc = FIELD_GET(STM32_LPTIM_PRESC, val);

drivers/pwm/pwm-stm32.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -858,8 +858,11 @@ static int stm32_pwm_probe(struct platform_device *pdev)
858858
chip->ops = &stm32pwm_ops;
859859

860860
/* Initialize clock refcount to number of enabled PWM channels. */
861-
for (i = 0; i < num_enabled; i++)
862-
clk_enable(priv->clk);
861+
for (i = 0; i < num_enabled; i++) {
862+
ret = clk_enable(priv->clk);
863+
if (ret)
864+
return ret;
865+
}
863866

864867
ret = devm_pwmchip_add(dev, chip);
865868
if (ret < 0)

0 commit comments

Comments
 (0)