Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'pwm/for-6.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm

Pull pwm updates from Thierry Reding:
"The bulk of this is trivial conversions to the new .remove_new()
callback for drivers as part of Uwe's effort to clean that up.

Other than that a driver is added for Apple devices and various small
fixes are included for existing drivers.

Last but not least, this finally gets rid of the old pwm_request() and
pwm_free() APIs are removed since the last user was dropped in v6.3"

* tag 'pwm/for-6.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm: (44 commits)
pwm: Remove unused radix tree
pwm: Delete deprecated functions pwm_request() and pwm_free()
pwm: meson: Fix g12a ao clk81 name
pwm: meson: Fix axg ao mux parents
pwm: stm32: Enforce settings for PWM capture
MAINTAINERS: Add entries for Apple PWM driver
pwm: Add Apple PWM controller
dt-bindings: pwm: Add Apple PWM controller
pwm: mtk-disp: Configure double buffering before reading in .get_state()
pwm: mtk-disp: Disable shadow registers before setting backlight values
pwm: stm32-lp: Drop of_match_ptr for ID table
pwm: rcar: Drop of_match_ptr for ID table
dt-bindings: pwm: Convert Amlogic Meson PWM binding
dt-bindings: pwm: mediatek: Add mediatek,mt7986 compatible
pwm: xilinx: Convert to platform remove callback returning void
pwm: vt8500: Convert to platform remove callback returning void
pwm: tiehrpwm: Convert to platform remove callback returning void
pwm: tiecap: Convert to platform remove callback returning void
pwm: tegra: Convert to platform remove callback returning void
pwm: sun4i: Convert to platform remove callback returning void
...

+397 -252
+51
Documentation/devicetree/bindings/pwm/apple,s5l-fpwm.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/pwm/apple,s5l-fpwm.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Apple FPWM controller 8 + 9 + maintainers: 10 + - asahi@lists.linux.dev 11 + - Sasha Finkelstein <fnkl.kernel@gmail.com> 12 + 13 + description: PWM controller used for keyboard backlight on ARM Macs 14 + 15 + properties: 16 + compatible: 17 + items: 18 + - enum: 19 + - apple,t8103-fpwm 20 + - apple,t6000-fpwm 21 + - apple,t8112-fpwm 22 + - const: apple,s5l-fpwm 23 + 24 + reg: 25 + maxItems: 1 26 + 27 + clocks: 28 + maxItems: 1 29 + 30 + power-domains: 31 + maxItems: 1 32 + 33 + "#pwm-cells": 34 + const: 2 35 + 36 + required: 37 + - compatible 38 + - reg 39 + - clocks 40 + 41 + additionalProperties: false 42 + 43 + examples: 44 + - | 45 + pwm@235044000 { 46 + compatible = "apple,t8103-fpwm", "apple,s5l-fpwm"; 47 + reg = <0x35044000 0x4000>; 48 + power-domains = <&ps_fpwm1>; 49 + clocks = <&clkref>; 50 + #pwm-cells = <2>; 51 + };
+1
Documentation/devicetree/bindings/pwm/mediatek,mt2712-pwm.yaml
··· 22 22 - mediatek,mt7623-pwm 23 23 - mediatek,mt7628-pwm 24 24 - mediatek,mt7629-pwm 25 + - mediatek,mt7986-pwm 25 26 - mediatek,mt8183-pwm 26 27 - mediatek,mt8365-pwm 27 28 - mediatek,mt8516-pwm
+70
Documentation/devicetree/bindings/pwm/pwm-amlogic.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/pwm/pwm-amlogic.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Amlogic PWM 8 + 9 + maintainers: 10 + - Heiner Kallweit <hkallweit1@gmail.com> 11 + 12 + allOf: 13 + - $ref: pwm.yaml# 14 + 15 + properties: 16 + compatible: 17 + oneOf: 18 + - enum: 19 + - amlogic,meson8b-pwm 20 + - amlogic,meson-gxbb-pwm 21 + - amlogic,meson-gxbb-ao-pwm 22 + - amlogic,meson-axg-ee-pwm 23 + - amlogic,meson-axg-ao-pwm 24 + - amlogic,meson-g12a-ee-pwm 25 + - amlogic,meson-g12a-ao-pwm-ab 26 + - amlogic,meson-g12a-ao-pwm-cd 27 + - amlogic,meson-s4-pwm 28 + - items: 29 + - const: amlogic,meson-gx-pwm 30 + - const: amlogic,meson-gxbb-pwm 31 + - items: 32 + - const: amlogic,meson-gx-ao-pwm 33 + - const: amlogic,meson-gxbb-ao-pwm 34 + - items: 35 + - const: amlogic,meson8-pwm 36 + - const: amlogic,meson8b-pwm 37 + 38 + reg: 39 + maxItems: 1 40 + 41 + clocks: 42 + minItems: 1 43 + maxItems: 2 44 + 45 + clock-names: 46 + oneOf: 47 + - items: 48 + - enum: [clkin0, clkin1] 49 + - items: 50 + - const: clkin0 51 + - const: clkin1 52 + 53 + "#pwm-cells": 54 + const: 3 55 + 56 + required: 57 + - compatible 58 + - reg 59 + 60 + additionalProperties: false 61 + 62 + examples: 63 + - | 64 + pwm@8550 { 65 + compatible = "amlogic,meson-gxbb-pwm"; 66 + reg = <0x08550 0x10>; 67 + clocks = <&xtal>, <&xtal>; 68 + clock-names = "clkin0", "clkin1"; 69 + #pwm-cells = <3>; 70 + };
-29
Documentation/devicetree/bindings/pwm/pwm-meson.txt
··· 1 - Amlogic Meson PWM Controller 2 - ============================ 3 - 4 - Required properties: 5 - - compatible: Shall contain "amlogic,meson8b-pwm" 6 - or "amlogic,meson-gxbb-pwm" 7 - or "amlogic,meson-gxbb-ao-pwm" 8 - or "amlogic,meson-axg-ee-pwm" 9 - or "amlogic,meson-axg-ao-pwm" 10 - or "amlogic,meson-g12a-ee-pwm" 11 - or "amlogic,meson-g12a-ao-pwm-ab" 12 - or "amlogic,meson-g12a-ao-pwm-cd" 13 - - #pwm-cells: Should be 3. See pwm.yaml in this directory for a description of 14 - the cells format. 15 - 16 - Optional properties: 17 - - clocks: Could contain one or two parents clocks phandle for each of the two 18 - PWM channels. 19 - - clock-names: Could contain at least the "clkin0" and/or "clkin1" names. 20 - 21 - Example: 22 - 23 - pwm_ab: pwm@8550 { 24 - compatible = "amlogic,meson-gxbb-pwm"; 25 - reg = <0x0 0x08550 0x0 0x10>; 26 - #pwm-cells = <3>; 27 - clocks = <&xtal>, <&xtal>; 28 - clock-names = "clkin0", "clkin1"; 29 - }
+5 -8
Documentation/driver-api/pwm.rst
··· 35 35 Using PWMs 36 36 ---------- 37 37 38 - Legacy users can request a PWM device using pwm_request() and free it 39 - after usage with pwm_free(). 40 - 41 - New users should use the pwm_get() function and pass to it the consumer 42 - device or a consumer name. pwm_put() is used to free the PWM device. Managed 43 - variants of the getter, devm_pwm_get() and devm_fwnode_pwm_get(), also exist. 38 + Consumers use the pwm_get() function and pass to it the consumer device or a 39 + consumer name. pwm_put() is used to free the PWM device. Managed variants of 40 + the getter, devm_pwm_get() and devm_fwnode_pwm_get(), also exist. 44 41 45 42 After being requested, a PWM has to be configured using:: 46 43 ··· 162 165 Locking 163 166 ------- 164 167 165 - The PWM core list manipulations are protected by a mutex, so pwm_request() 166 - and pwm_free() may not be called from an atomic context. Currently the 168 + The PWM core list manipulations are protected by a mutex, so pwm_get() 169 + and pwm_put() may not be called from an atomic context. Currently the 167 170 PWM core does not enforce any locking to pwm_enable(), pwm_disable() and 168 171 pwm_config(), so the calling context is currently driver specific. This 169 172 is an issue derived from the former barebone API and should be fixed soon.
+2
MAINTAINERS
··· 1961 1961 F: Documentation/devicetree/bindings/pci/apple,pcie.yaml 1962 1962 F: Documentation/devicetree/bindings/pinctrl/apple,pinctrl.yaml 1963 1963 F: Documentation/devicetree/bindings/power/apple* 1964 + F: Documentation/devicetree/bindings/pwm/pwm-apple.yaml 1964 1965 F: Documentation/devicetree/bindings/watchdog/apple,wdt.yaml 1965 1966 F: arch/arm64/boot/dts/apple/ 1966 1967 F: drivers/bluetooth/hci_bcm4377.c ··· 1977 1976 F: drivers/nvme/host/apple.c 1978 1977 F: drivers/nvmem/apple-efuses.c 1979 1978 F: drivers/pinctrl/pinctrl-apple-gpio.c 1979 + F: drivers/pwm/pwm-apple.c 1980 1980 F: drivers/soc/apple/* 1981 1981 F: drivers/watchdog/apple_wdt.c 1982 1982 F: include/dt-bindings/interrupt-controller/apple-aic.h
+12
drivers/pwm/Kconfig
··· 51 51 To compile this driver as a module, choose M here: the module 52 52 will be called pwm-ab8500. 53 53 54 + config PWM_APPLE 55 + tristate "Apple SoC PWM support" 56 + depends on ARCH_APPLE || COMPILE_TEST 57 + help 58 + Generic PWM framework driver for PWM controller present on 59 + Apple SoCs 60 + 61 + Say Y here if you have an ARM Apple laptop, otherwise say N 62 + 63 + To compile this driver as a module, choose M here: the module 64 + will be called pwm-apple. 65 + 54 66 config PWM_ATMEL 55 67 tristate "Atmel PWM support" 56 68 depends on ARCH_AT91 || COMPILE_TEST
+1
drivers/pwm/Makefile
··· 2 2 obj-$(CONFIG_PWM) += core.o 3 3 obj-$(CONFIG_PWM_SYSFS) += sysfs.o 4 4 obj-$(CONFIG_PWM_AB8500) += pwm-ab8500.o 5 + obj-$(CONFIG_PWM_APPLE) += pwm-apple.o 5 6 obj-$(CONFIG_PWM_ATMEL) += pwm-atmel.o 6 7 obj-$(CONFIG_PWM_ATMEL_HLCDC_PWM) += pwm-atmel-hlcdc.o 7 8 obj-$(CONFIG_PWM_ATMEL_TCB) += pwm-atmel-tcb.o
+3 -68
drivers/pwm/core.c
··· 28 28 static DEFINE_MUTEX(pwm_lookup_lock); 29 29 static LIST_HEAD(pwm_lookup_list); 30 30 31 - /* protects access to pwm_chips, allocated_pwms, and pwm_tree */ 31 + /* protects access to pwm_chips and allocated_pwms */ 32 32 static DEFINE_MUTEX(pwm_lock); 33 33 34 34 static LIST_HEAD(pwm_chips); 35 35 static DECLARE_BITMAP(allocated_pwms, MAX_PWMS); 36 - static RADIX_TREE(pwm_tree, GFP_KERNEL); 37 - 38 - static struct pwm_device *pwm_to_device(unsigned int pwm) 39 - { 40 - return radix_tree_lookup(&pwm_tree, pwm); 41 - } 42 36 43 37 /* Called with pwm_lock held */ 44 38 static int alloc_pwms(unsigned int count) ··· 53 59 /* Called with pwm_lock held */ 54 60 static void free_pwms(struct pwm_chip *chip) 55 61 { 56 - unsigned int i; 57 - 58 - for (i = 0; i < chip->npwm; i++) { 59 - struct pwm_device *pwm = &chip->pwms[i]; 60 - 61 - radix_tree_delete(&pwm_tree, pwm->pwm); 62 - } 63 - 64 62 bitmap_clear(allocated_pwms, chip->base, chip->npwm); 65 63 66 64 kfree(chip->pwms); ··· 293 307 pwm->chip = chip; 294 308 pwm->pwm = chip->base + i; 295 309 pwm->hwpwm = i; 296 - 297 - radix_tree_insert(&pwm_tree, pwm->pwm, pwm); 298 310 } 299 311 300 312 list_add(&chip->list, &pwm_chips); ··· 354 370 EXPORT_SYMBOL_GPL(devm_pwmchip_add); 355 371 356 372 /** 357 - * pwm_request() - request a PWM device 358 - * @pwm: global PWM device index 359 - * @label: PWM device label 360 - * 361 - * This function is deprecated, use pwm_get() instead. 362 - * 363 - * Returns: A pointer to a PWM device or an ERR_PTR()-encoded error code on 364 - * failure. 365 - */ 366 - struct pwm_device *pwm_request(int pwm, const char *label) 367 - { 368 - struct pwm_device *dev; 369 - int err; 370 - 371 - if (pwm < 0 || pwm >= MAX_PWMS) 372 - return ERR_PTR(-EINVAL); 373 - 374 - mutex_lock(&pwm_lock); 375 - 376 - dev = pwm_to_device(pwm); 377 - if (!dev) { 378 - dev = ERR_PTR(-EPROBE_DEFER); 379 - goto out; 380 - } 381 - 382 - err = pwm_device_request(dev, label); 383 - if (err < 0) 384 - dev = ERR_PTR(err); 385 - 386 - out: 387 - mutex_unlock(&pwm_lock); 388 - 389 - return dev; 390 - } 391 - EXPORT_SYMBOL_GPL(pwm_request); 392 - 393 - /** 394 373 * pwm_request_from_chip() - request a PWM device relative to a PWM chip 395 374 * @chip: PWM chip 396 375 * @index: per-chip index of the PWM to request ··· 384 437 return pwm; 385 438 } 386 439 EXPORT_SYMBOL_GPL(pwm_request_from_chip); 387 - 388 - /** 389 - * pwm_free() - free a PWM device 390 - * @pwm: PWM device 391 - * 392 - * This function is deprecated, use pwm_put() instead. 393 - */ 394 - void pwm_free(struct pwm_device *pwm) 395 - { 396 - pwm_put(pwm); 397 - } 398 - EXPORT_SYMBOL_GPL(pwm_free); 399 440 400 441 static void pwm_apply_state_debug(struct pwm_device *pwm, 401 442 const struct pwm_state *state) ··· 725 790 dl = pwm_device_link_add(dev, pwm); 726 791 if (IS_ERR(dl)) { 727 792 /* of_xlate ended up calling pwm_request_from_chip() */ 728 - pwm_free(pwm); 793 + pwm_put(pwm); 729 794 pwm = ERR_CAST(dl); 730 795 goto put; 731 796 } ··· 949 1014 950 1015 dl = pwm_device_link_add(dev, pwm); 951 1016 if (IS_ERR(dl)) { 952 - pwm_free(pwm); 1017 + pwm_put(pwm); 953 1018 return ERR_CAST(dl); 954 1019 } 955 1020
+159
drivers/pwm/pwm-apple.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 OR MIT 2 + /* 3 + * Driver for the Apple SoC PWM controller 4 + * 5 + * Copyright The Asahi Linux Contributors 6 + * 7 + * Limitations: 8 + * - The writes to cycle registers are shadowed until a write to 9 + * the control register. 10 + * - If both OFF_CYCLES and ON_CYCLES are set to 0, the output 11 + * is a constant off signal. 12 + * - When APPLE_PWM_CTRL is set to 0, the output is constant low 13 + */ 14 + 15 + #include <linux/module.h> 16 + #include <linux/platform_device.h> 17 + #include <linux/pwm.h> 18 + #include <linux/io.h> 19 + #include <linux/clk.h> 20 + #include <linux/math64.h> 21 + 22 + #define APPLE_PWM_CTRL 0x00 23 + #define APPLE_PWM_ON_CYCLES 0x1c 24 + #define APPLE_PWM_OFF_CYCLES 0x18 25 + 26 + #define APPLE_PWM_CTRL_ENABLE BIT(0) 27 + #define APPLE_PWM_CTRL_MODE BIT(2) 28 + #define APPLE_PWM_CTRL_UPDATE BIT(5) 29 + #define APPLE_PWM_CTRL_TRIGGER BIT(9) 30 + #define APPLE_PWM_CTRL_INVERT BIT(10) 31 + #define APPLE_PWM_CTRL_OUTPUT_ENABLE BIT(14) 32 + 33 + struct apple_pwm { 34 + struct pwm_chip chip; 35 + void __iomem *base; 36 + u64 clkrate; 37 + }; 38 + 39 + static inline struct apple_pwm *to_apple_pwm(struct pwm_chip *chip) 40 + { 41 + return container_of(chip, struct apple_pwm, chip); 42 + } 43 + 44 + static int apple_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm, 45 + const struct pwm_state *state) 46 + { 47 + struct apple_pwm *fpwm; 48 + 49 + if (state->polarity == PWM_POLARITY_INVERSED) 50 + return -EINVAL; 51 + 52 + fpwm = to_apple_pwm(chip); 53 + if (state->enabled) { 54 + u64 on_cycles, off_cycles; 55 + 56 + on_cycles = mul_u64_u64_div_u64(fpwm->clkrate, 57 + state->duty_cycle, NSEC_PER_SEC); 58 + if (on_cycles > 0xFFFFFFFF) 59 + on_cycles = 0xFFFFFFFF; 60 + 61 + off_cycles = mul_u64_u64_div_u64(fpwm->clkrate, 62 + state->period, NSEC_PER_SEC) - on_cycles; 63 + if (off_cycles > 0xFFFFFFFF) 64 + off_cycles = 0xFFFFFFFF; 65 + 66 + writel(on_cycles, fpwm->base + APPLE_PWM_ON_CYCLES); 67 + writel(off_cycles, fpwm->base + APPLE_PWM_OFF_CYCLES); 68 + writel(APPLE_PWM_CTRL_ENABLE | APPLE_PWM_CTRL_OUTPUT_ENABLE | APPLE_PWM_CTRL_UPDATE, 69 + fpwm->base + APPLE_PWM_CTRL); 70 + } else { 71 + writel(0, fpwm->base + APPLE_PWM_CTRL); 72 + } 73 + return 0; 74 + } 75 + 76 + static int apple_pwm_get_state(struct pwm_chip *chip, struct pwm_device *pwm, 77 + struct pwm_state *state) 78 + { 79 + struct apple_pwm *fpwm; 80 + u32 on_cycles, off_cycles, ctrl; 81 + 82 + fpwm = to_apple_pwm(chip); 83 + 84 + ctrl = readl(fpwm->base + APPLE_PWM_CTRL); 85 + on_cycles = readl(fpwm->base + APPLE_PWM_ON_CYCLES); 86 + off_cycles = readl(fpwm->base + APPLE_PWM_OFF_CYCLES); 87 + 88 + state->enabled = (ctrl & APPLE_PWM_CTRL_ENABLE) && (ctrl & APPLE_PWM_CTRL_OUTPUT_ENABLE); 89 + state->polarity = PWM_POLARITY_NORMAL; 90 + // on_cycles + off_cycles is 33 bits, NSEC_PER_SEC is 30, there is no overflow 91 + state->duty_cycle = DIV64_U64_ROUND_UP((u64)on_cycles * NSEC_PER_SEC, fpwm->clkrate); 92 + state->period = DIV64_U64_ROUND_UP(((u64)off_cycles + (u64)on_cycles) * 93 + NSEC_PER_SEC, fpwm->clkrate); 94 + 95 + return 0; 96 + } 97 + 98 + static const struct pwm_ops apple_pwm_ops = { 99 + .apply = apple_pwm_apply, 100 + .get_state = apple_pwm_get_state, 101 + .owner = THIS_MODULE, 102 + }; 103 + 104 + static int apple_pwm_probe(struct platform_device *pdev) 105 + { 106 + struct apple_pwm *fpwm; 107 + struct clk *clk; 108 + int ret; 109 + 110 + fpwm = devm_kzalloc(&pdev->dev, sizeof(*fpwm), GFP_KERNEL); 111 + if (!fpwm) 112 + return -ENOMEM; 113 + 114 + fpwm->base = devm_platform_ioremap_resource(pdev, 0); 115 + if (IS_ERR(fpwm->base)) 116 + return PTR_ERR(fpwm->base); 117 + 118 + clk = devm_clk_get_enabled(&pdev->dev, NULL); 119 + if (IS_ERR(clk)) 120 + return dev_err_probe(&pdev->dev, PTR_ERR(clk), "unable to get the clock"); 121 + 122 + /* 123 + * Uses the 24MHz system clock on all existing devices, can only 124 + * happen if the device tree is broken 125 + * 126 + * This check is done to prevent an overflow in .apply 127 + */ 128 + fpwm->clkrate = clk_get_rate(clk); 129 + if (fpwm->clkrate > NSEC_PER_SEC) 130 + return dev_err_probe(&pdev->dev, -EINVAL, "pwm clock out of range"); 131 + 132 + fpwm->chip.dev = &pdev->dev; 133 + fpwm->chip.npwm = 1; 134 + fpwm->chip.ops = &apple_pwm_ops; 135 + 136 + ret = devm_pwmchip_add(&pdev->dev, &fpwm->chip); 137 + if (ret < 0) 138 + return dev_err_probe(&pdev->dev, ret, "unable to add pwm chip"); 139 + 140 + return 0; 141 + } 142 + 143 + static const struct of_device_id apple_pwm_of_match[] = { 144 + { .compatible = "apple,s5l-fpwm" }, 145 + {} 146 + }; 147 + MODULE_DEVICE_TABLE(of, apple_pwm_of_match); 148 + 149 + static struct platform_driver apple_pwm_driver = { 150 + .probe = apple_pwm_probe, 151 + .driver = { 152 + .name = "apple-pwm", 153 + .of_match_table = apple_pwm_of_match, 154 + }, 155 + }; 156 + module_platform_driver(apple_pwm_driver); 157 + 158 + MODULE_DESCRIPTION("Apple SoC PWM driver"); 159 + MODULE_LICENSE("Dual MIT/GPL");
+2 -4
drivers/pwm/pwm-atmel-hlcdc.c
··· 278 278 return 0; 279 279 } 280 280 281 - static int atmel_hlcdc_pwm_remove(struct platform_device *pdev) 281 + static void atmel_hlcdc_pwm_remove(struct platform_device *pdev) 282 282 { 283 283 struct atmel_hlcdc_pwm *chip = platform_get_drvdata(pdev); 284 284 285 285 pwmchip_remove(&chip->chip); 286 286 287 287 clk_disable_unprepare(chip->hlcdc->periph_clk); 288 - 289 - return 0; 290 288 } 291 289 292 290 static const struct of_device_id atmel_hlcdc_pwm_dt_ids[] = { ··· 299 301 .pm = &atmel_hlcdc_pwm_pm_ops, 300 302 }, 301 303 .probe = atmel_hlcdc_pwm_probe, 302 - .remove = atmel_hlcdc_pwm_remove, 304 + .remove_new = atmel_hlcdc_pwm_remove, 303 305 }; 304 306 module_platform_driver(atmel_hlcdc_pwm_driver); 305 307
+2 -4
drivers/pwm/pwm-atmel-tcb.c
··· 500 500 return err; 501 501 } 502 502 503 - static int atmel_tcb_pwm_remove(struct platform_device *pdev) 503 + static void atmel_tcb_pwm_remove(struct platform_device *pdev) 504 504 { 505 505 struct atmel_tcb_pwm_chip *tcbpwm = platform_get_drvdata(pdev); 506 506 ··· 509 509 clk_disable_unprepare(tcbpwm->slow_clk); 510 510 clk_put(tcbpwm->slow_clk); 511 511 clk_put(tcbpwm->clk); 512 - 513 - return 0; 514 512 } 515 513 516 514 static const struct of_device_id atmel_tcb_pwm_dt_ids[] = { ··· 562 564 .pm = &atmel_tcb_pwm_pm_ops, 563 565 }, 564 566 .probe = atmel_tcb_pwm_probe, 565 - .remove = atmel_tcb_pwm_remove, 567 + .remove_new = atmel_tcb_pwm_remove, 566 568 }; 567 569 module_platform_driver(atmel_tcb_pwm_driver); 568 570
+2 -4
drivers/pwm/pwm-atmel.c
··· 511 511 return ret; 512 512 } 513 513 514 - static int atmel_pwm_remove(struct platform_device *pdev) 514 + static void atmel_pwm_remove(struct platform_device *pdev) 515 515 { 516 516 struct atmel_pwm_chip *atmel_pwm = platform_get_drvdata(pdev); 517 517 518 518 pwmchip_remove(&atmel_pwm->chip); 519 519 520 520 clk_unprepare(atmel_pwm->clk); 521 - 522 - return 0; 523 521 } 524 522 525 523 static struct platform_driver atmel_pwm_driver = { ··· 526 528 .of_match_table = of_match_ptr(atmel_pwm_dt_ids), 527 529 }, 528 530 .probe = atmel_pwm_probe, 529 - .remove = atmel_pwm_remove, 531 + .remove_new = atmel_pwm_remove, 530 532 }; 531 533 module_platform_driver(atmel_pwm_driver); 532 534
+2 -4
drivers/pwm/pwm-bcm-iproc.c
··· 239 239 return ret; 240 240 } 241 241 242 - static int iproc_pwmc_remove(struct platform_device *pdev) 242 + static void iproc_pwmc_remove(struct platform_device *pdev) 243 243 { 244 244 struct iproc_pwmc *ip = platform_get_drvdata(pdev); 245 245 246 246 pwmchip_remove(&ip->chip); 247 247 248 248 clk_disable_unprepare(ip->clk); 249 - 250 - return 0; 251 249 } 252 250 253 251 static const struct of_device_id bcm_iproc_pwmc_dt[] = { ··· 260 262 .of_match_table = bcm_iproc_pwmc_dt, 261 263 }, 262 264 .probe = iproc_pwmc_probe, 263 - .remove = iproc_pwmc_remove, 265 + .remove_new = iproc_pwmc_remove, 264 266 }; 265 267 module_platform_driver(iproc_pwmc_driver); 266 268
+2 -4
drivers/pwm/pwm-bcm2835.c
··· 173 173 return ret; 174 174 } 175 175 176 - static int bcm2835_pwm_remove(struct platform_device *pdev) 176 + static void bcm2835_pwm_remove(struct platform_device *pdev) 177 177 { 178 178 struct bcm2835_pwm *pc = platform_get_drvdata(pdev); 179 179 180 180 pwmchip_remove(&pc->chip); 181 181 182 182 clk_disable_unprepare(pc->clk); 183 - 184 - return 0; 185 183 } 186 184 187 185 static const struct of_device_id bcm2835_pwm_of_match[] = { ··· 194 196 .of_match_table = bcm2835_pwm_of_match, 195 197 }, 196 198 .probe = bcm2835_pwm_probe, 197 - .remove = bcm2835_pwm_remove, 199 + .remove_new = bcm2835_pwm_remove, 198 200 }; 199 201 module_platform_driver(bcm2835_pwm_driver); 200 202
+2 -4
drivers/pwm/pwm-berlin.c
··· 250 250 return 0; 251 251 } 252 252 253 - static int berlin_pwm_remove(struct platform_device *pdev) 253 + static void berlin_pwm_remove(struct platform_device *pdev) 254 254 { 255 255 struct berlin_pwm_chip *bpc = platform_get_drvdata(pdev); 256 256 257 257 pwmchip_remove(&bpc->chip); 258 258 259 259 clk_disable_unprepare(bpc->clk); 260 - 261 - return 0; 262 260 } 263 261 264 262 #ifdef CONFIG_PM_SLEEP ··· 315 317 316 318 static struct platform_driver berlin_pwm_driver = { 317 319 .probe = berlin_pwm_probe, 318 - .remove = berlin_pwm_remove, 320 + .remove_new = berlin_pwm_remove, 319 321 .driver = { 320 322 .name = "berlin-pwm", 321 323 .of_match_table = berlin_pwm_match,
+2 -4
drivers/pwm/pwm-brcmstb.c
··· 275 275 return ret; 276 276 } 277 277 278 - static int brcmstb_pwm_remove(struct platform_device *pdev) 278 + static void brcmstb_pwm_remove(struct platform_device *pdev) 279 279 { 280 280 struct brcmstb_pwm *p = platform_get_drvdata(pdev); 281 281 282 282 pwmchip_remove(&p->chip); 283 283 clk_disable_unprepare(p->clk); 284 - 285 - return 0; 286 284 } 287 285 288 286 #ifdef CONFIG_PM_SLEEP ··· 308 310 309 311 static struct platform_driver brcmstb_pwm_driver = { 310 312 .probe = brcmstb_pwm_probe, 311 - .remove = brcmstb_pwm_remove, 313 + .remove_new = brcmstb_pwm_remove, 312 314 .driver = { 313 315 .name = "pwm-brcmstb", 314 316 .of_match_table = brcmstb_pwm_of_match,
+2 -4
drivers/pwm/pwm-clk.c
··· 112 112 return 0; 113 113 } 114 114 115 - static int pwm_clk_remove(struct platform_device *pdev) 115 + static void pwm_clk_remove(struct platform_device *pdev) 116 116 { 117 117 struct pwm_clk_chip *pcchip = platform_get_drvdata(pdev); 118 118 ··· 122 122 clk_disable(pcchip->clk); 123 123 124 124 clk_unprepare(pcchip->clk); 125 - 126 - return 0; 127 125 } 128 126 129 127 static const struct of_device_id pwm_clk_dt_ids[] = { ··· 136 138 .of_match_table = pwm_clk_dt_ids, 137 139 }, 138 140 .probe = pwm_clk_probe, 139 - .remove = pwm_clk_remove, 141 + .remove_new = pwm_clk_remove, 140 142 }; 141 143 module_platform_driver(pwm_clk_driver); 142 144
+2 -4
drivers/pwm/pwm-cros-ec.c
··· 329 329 return ret; 330 330 } 331 331 332 - static int cros_ec_pwm_remove(struct platform_device *dev) 332 + static void cros_ec_pwm_remove(struct platform_device *dev) 333 333 { 334 334 struct cros_ec_pwm_device *ec_pwm = platform_get_drvdata(dev); 335 335 struct pwm_chip *chip = &ec_pwm->chip; 336 336 337 337 pwmchip_remove(chip); 338 - 339 - return 0; 340 338 } 341 339 342 340 #ifdef CONFIG_OF ··· 348 350 349 351 static struct platform_driver cros_ec_pwm_driver = { 350 352 .probe = cros_ec_pwm_probe, 351 - .remove = cros_ec_pwm_remove, 353 + .remove_new = cros_ec_pwm_remove, 352 354 .driver = { 353 355 .name = "cros-ec-pwm", 354 356 .of_match_table = of_match_ptr(cros_ec_pwm_of_match),
+2 -4
drivers/pwm/pwm-hibvt.c
··· 245 245 return 0; 246 246 } 247 247 248 - static int hibvt_pwm_remove(struct platform_device *pdev) 248 + static void hibvt_pwm_remove(struct platform_device *pdev) 249 249 { 250 250 struct hibvt_pwm_chip *pwm_chip; 251 251 ··· 258 258 reset_control_deassert(pwm_chip->rstc); 259 259 260 260 clk_disable_unprepare(pwm_chip->clk); 261 - 262 - return 0; 263 261 } 264 262 265 263 static const struct of_device_id hibvt_pwm_of_match[] = { ··· 279 281 .of_match_table = hibvt_pwm_of_match, 280 282 }, 281 283 .probe = hibvt_pwm_probe, 282 - .remove = hibvt_pwm_remove, 284 + .remove_new = hibvt_pwm_remove, 283 285 }; 284 286 module_platform_driver(hibvt_pwm_driver); 285 287
+2 -4
drivers/pwm/pwm-img.c
··· 343 343 return ret; 344 344 } 345 345 346 - static int img_pwm_remove(struct platform_device *pdev) 346 + static void img_pwm_remove(struct platform_device *pdev) 347 347 { 348 348 struct img_pwm_chip *imgchip = platform_get_drvdata(pdev); 349 349 ··· 352 352 img_pwm_runtime_suspend(&pdev->dev); 353 353 354 354 pwmchip_remove(&imgchip->chip); 355 - 356 - return 0; 357 355 } 358 356 359 357 #ifdef CONFIG_PM_SLEEP ··· 421 423 .of_match_table = img_pwm_of_match, 422 424 }, 423 425 .probe = img_pwm_probe, 424 - .remove = img_pwm_remove, 426 + .remove_new = img_pwm_remove, 425 427 }; 426 428 module_platform_driver(img_pwm_driver); 427 429
+2 -4
drivers/pwm/pwm-imx-tpm.c
··· 381 381 return ret; 382 382 } 383 383 384 - static int pwm_imx_tpm_remove(struct platform_device *pdev) 384 + static void pwm_imx_tpm_remove(struct platform_device *pdev) 385 385 { 386 386 struct imx_tpm_pwm_chip *tpm = platform_get_drvdata(pdev); 387 387 388 388 pwmchip_remove(&tpm->chip); 389 389 390 390 clk_disable_unprepare(tpm->clk); 391 - 392 - return 0; 393 391 } 394 392 395 393 static int __maybe_unused pwm_imx_tpm_suspend(struct device *dev) ··· 430 432 .pm = &imx_tpm_pwm_pm, 431 433 }, 432 434 .probe = pwm_imx_tpm_probe, 433 - .remove = pwm_imx_tpm_remove, 435 + .remove_new = pwm_imx_tpm_remove, 434 436 }; 435 437 module_platform_driver(imx_tpm_pwm_driver); 436 438
+2 -4
drivers/pwm/pwm-lpc18xx-sct.c
··· 449 449 return ret; 450 450 } 451 451 452 - static int lpc18xx_pwm_remove(struct platform_device *pdev) 452 + static void lpc18xx_pwm_remove(struct platform_device *pdev) 453 453 { 454 454 struct lpc18xx_pwm_chip *lpc18xx_pwm = platform_get_drvdata(pdev); 455 455 u32 val; ··· 461 461 val | LPC18XX_PWM_CTRL_HALT); 462 462 463 463 clk_disable_unprepare(lpc18xx_pwm->pwm_clk); 464 - 465 - return 0; 466 464 } 467 465 468 466 static struct platform_driver lpc18xx_pwm_driver = { ··· 469 471 .of_match_table = lpc18xx_pwm_of_match, 470 472 }, 471 473 .probe = lpc18xx_pwm_probe, 472 - .remove = lpc18xx_pwm_remove, 474 + .remove_new = lpc18xx_pwm_remove, 473 475 }; 474 476 module_platform_driver(lpc18xx_pwm_driver); 475 477
+2 -3
drivers/pwm/pwm-lpss-platform.c
··· 62 62 return 0; 63 63 } 64 64 65 - static int pwm_lpss_remove_platform(struct platform_device *pdev) 65 + static void pwm_lpss_remove_platform(struct platform_device *pdev) 66 66 { 67 67 pm_runtime_disable(&pdev->dev); 68 - return 0; 69 68 } 70 69 71 70 static const struct acpi_device_id pwm_lpss_acpi_match[] = { ··· 82 83 .acpi_match_table = pwm_lpss_acpi_match, 83 84 }, 84 85 .probe = pwm_lpss_probe_platform, 85 - .remove = pwm_lpss_remove_platform, 86 + .remove_new = pwm_lpss_remove_platform, 86 87 }; 87 88 module_platform_driver(pwm_lpss_driver_platform); 88 89
+3 -3
drivers/pwm/pwm-meson.c
··· 418 418 }; 419 419 420 420 static const char * const pwm_axg_ao_parent_names[] = { 421 - "aoclk81", "xtal", "fclk_div4", "fclk_div5" 421 + "xtal", "axg_ao_clk81", "fclk_div4", "fclk_div5" 422 422 }; 423 423 424 424 static const struct meson_pwm_data pwm_axg_ao_data = { ··· 427 427 }; 428 428 429 429 static const char * const pwm_g12a_ao_ab_parent_names[] = { 430 - "xtal", "aoclk81", "fclk_div4", "fclk_div5" 430 + "xtal", "g12a_ao_clk81", "fclk_div4", "fclk_div5" 431 431 }; 432 432 433 433 static const struct meson_pwm_data pwm_g12a_ao_ab_data = { ··· 436 436 }; 437 437 438 438 static const char * const pwm_g12a_ao_cd_parent_names[] = { 439 - "xtal", "aoclk81", 439 + "xtal", "g12a_ao_clk81", 440 440 }; 441 441 442 442 static const struct meson_pwm_data pwm_g12a_ao_cd_data = {
+25 -15
drivers/pwm/pwm-mtk-disp.c
··· 138 138 high_width = mul_u64_u64_div_u64(state->duty_cycle, rate, div); 139 139 value = period | (high_width << PWM_HIGH_WIDTH_SHIFT); 140 140 141 + if (mdp->data->bls_debug && !mdp->data->has_commit) { 142 + /* 143 + * For MT2701, disable double buffer before writing register 144 + * and select manual mode and use PWM_PERIOD/PWM_HIGH_WIDTH. 145 + */ 146 + mtk_disp_pwm_update_bits(mdp, mdp->data->bls_debug, 147 + mdp->data->bls_debug_mask, 148 + mdp->data->bls_debug_mask); 149 + mtk_disp_pwm_update_bits(mdp, mdp->data->con0, 150 + mdp->data->con0_sel, 151 + mdp->data->con0_sel); 152 + } 153 + 141 154 mtk_disp_pwm_update_bits(mdp, mdp->data->con0, 142 155 PWM_CLKDIV_MASK, 143 156 clk_div << PWM_CLKDIV_SHIFT); ··· 165 152 mtk_disp_pwm_update_bits(mdp, mdp->data->commit, 166 153 mdp->data->commit_mask, 167 154 0x0); 168 - } else { 169 - /* 170 - * For MT2701, disable double buffer before writing register 171 - * and select manual mode and use PWM_PERIOD/PWM_HIGH_WIDTH. 172 - */ 173 - mtk_disp_pwm_update_bits(mdp, mdp->data->bls_debug, 174 - mdp->data->bls_debug_mask, 175 - mdp->data->bls_debug_mask); 176 - mtk_disp_pwm_update_bits(mdp, mdp->data->con0, 177 - mdp->data->con0_sel, 178 - mdp->data->con0_sel); 179 155 } 180 156 181 157 mtk_disp_pwm_update_bits(mdp, DISP_PWM_EN, mdp->data->enable_mask, ··· 195 193 clk_disable_unprepare(mdp->clk_main); 196 194 return err; 197 195 } 196 + 197 + /* 198 + * Apply DISP_PWM_DEBUG settings to choose whether to enable or disable 199 + * registers double buffer and manual commit to working register before 200 + * performing any read/write operation 201 + */ 202 + if (mdp->data->bls_debug) 203 + mtk_disp_pwm_update_bits(mdp, mdp->data->bls_debug, 204 + mdp->data->bls_debug_mask, 205 + mdp->data->bls_debug_mask); 198 206 199 207 rate = clk_get_rate(mdp->clk_main); 200 208 con0 = readl(mdp->base + mdp->data->con0); ··· 272 260 return 0; 273 261 } 274 262 275 - static int mtk_disp_pwm_remove(struct platform_device *pdev) 263 + static void mtk_disp_pwm_remove(struct platform_device *pdev) 276 264 { 277 265 struct mtk_disp_pwm *mdp = platform_get_drvdata(pdev); 278 266 279 267 pwmchip_remove(&mdp->chip); 280 - 281 - return 0; 282 268 } 283 269 284 270 static const struct mtk_pwm_data mt2701_pwm_data = { ··· 324 314 .of_match_table = mtk_disp_pwm_of_match, 325 315 }, 326 316 .probe = mtk_disp_pwm_probe, 327 - .remove = mtk_disp_pwm_remove, 317 + .remove_new = mtk_disp_pwm_remove, 328 318 }; 329 319 module_platform_driver(mtk_disp_pwm_driver); 330 320
+2 -4
drivers/pwm/pwm-omap-dmtimer.c
··· 441 441 return ret; 442 442 } 443 443 444 - static int pwm_omap_dmtimer_remove(struct platform_device *pdev) 444 + static void pwm_omap_dmtimer_remove(struct platform_device *pdev) 445 445 { 446 446 struct pwm_omap_dmtimer_chip *omap = platform_get_drvdata(pdev); 447 447 ··· 455 455 put_device(&omap->dm_timer_pdev->dev); 456 456 457 457 mutex_destroy(&omap->mutex); 458 - 459 - return 0; 460 458 } 461 459 462 460 static const struct of_device_id pwm_omap_dmtimer_of_match[] = { ··· 469 471 .of_match_table = of_match_ptr(pwm_omap_dmtimer_of_match), 470 472 }, 471 473 .probe = pwm_omap_dmtimer_probe, 472 - .remove = pwm_omap_dmtimer_remove, 474 + .remove_new = pwm_omap_dmtimer_remove, 473 475 }; 474 476 module_platform_driver(pwm_omap_dmtimer_driver); 475 477
+3 -5
drivers/pwm/pwm-rcar.c
··· 238 238 return 0; 239 239 } 240 240 241 - static int rcar_pwm_remove(struct platform_device *pdev) 241 + static void rcar_pwm_remove(struct platform_device *pdev) 242 242 { 243 243 struct rcar_pwm_chip *rcar_pwm = platform_get_drvdata(pdev); 244 244 245 245 pwmchip_remove(&rcar_pwm->chip); 246 246 247 247 pm_runtime_disable(&pdev->dev); 248 - 249 - return 0; 250 248 } 251 249 252 250 static const struct of_device_id rcar_pwm_of_table[] = { ··· 255 257 256 258 static struct platform_driver rcar_pwm_driver = { 257 259 .probe = rcar_pwm_probe, 258 - .remove = rcar_pwm_remove, 260 + .remove_new = rcar_pwm_remove, 259 261 .driver = { 260 262 .name = "pwm-rcar", 261 - .of_match_table = of_match_ptr(rcar_pwm_of_table), 263 + .of_match_table = rcar_pwm_of_table, 262 264 } 263 265 }; 264 266 module_platform_driver(rcar_pwm_driver);
+2 -4
drivers/pwm/pwm-rockchip.c
··· 376 376 return ret; 377 377 } 378 378 379 - static int rockchip_pwm_remove(struct platform_device *pdev) 379 + static void rockchip_pwm_remove(struct platform_device *pdev) 380 380 { 381 381 struct rockchip_pwm_chip *pc = platform_get_drvdata(pdev); 382 382 ··· 384 384 385 385 clk_unprepare(pc->pclk); 386 386 clk_unprepare(pc->clk); 387 - 388 - return 0; 389 387 } 390 388 391 389 static struct platform_driver rockchip_pwm_driver = { ··· 392 394 .of_match_table = rockchip_pwm_dt_ids, 393 395 }, 394 396 .probe = rockchip_pwm_probe, 395 - .remove = rockchip_pwm_remove, 397 + .remove_new = rockchip_pwm_remove, 396 398 }; 397 399 module_platform_driver(rockchip_pwm_driver); 398 400
+2 -4
drivers/pwm/pwm-samsung.c
··· 621 621 return 0; 622 622 } 623 623 624 - static int pwm_samsung_remove(struct platform_device *pdev) 624 + static void pwm_samsung_remove(struct platform_device *pdev) 625 625 { 626 626 struct samsung_pwm_chip *chip = platform_get_drvdata(pdev); 627 627 628 628 pwmchip_remove(&chip->chip); 629 629 630 630 clk_disable_unprepare(chip->base_clk); 631 - 632 - return 0; 633 631 } 634 632 635 633 #ifdef CONFIG_PM_SLEEP ··· 674 676 .of_match_table = of_match_ptr(samsung_pwm_matches), 675 677 }, 676 678 .probe = pwm_samsung_probe, 677 - .remove = pwm_samsung_remove, 679 + .remove_new = pwm_samsung_remove, 678 680 }; 679 681 module_platform_driver(pwm_samsung_driver); 680 682
+2 -4
drivers/pwm/pwm-sifive.c
··· 313 313 return ret; 314 314 } 315 315 316 - static int pwm_sifive_remove(struct platform_device *dev) 316 + static void pwm_sifive_remove(struct platform_device *dev) 317 317 { 318 318 struct pwm_sifive_ddata *ddata = platform_get_drvdata(dev); 319 319 struct pwm_device *pwm; ··· 329 329 } 330 330 331 331 clk_unprepare(ddata->clk); 332 - 333 - return 0; 334 332 } 335 333 336 334 static const struct of_device_id pwm_sifive_of_match[] = { ··· 339 341 340 342 static struct platform_driver pwm_sifive_driver = { 341 343 .probe = pwm_sifive_probe, 342 - .remove = pwm_sifive_remove, 344 + .remove_new = pwm_sifive_remove, 343 345 .driver = { 344 346 .name = "pwm-sifive", 345 347 .of_match_table = pwm_sifive_of_match,
+2 -4
drivers/pwm/pwm-spear.c
··· 247 247 return ret; 248 248 } 249 249 250 - static int spear_pwm_remove(struct platform_device *pdev) 250 + static void spear_pwm_remove(struct platform_device *pdev) 251 251 { 252 252 struct spear_pwm_chip *pc = platform_get_drvdata(pdev); 253 253 ··· 255 255 256 256 /* clk was prepared in probe, hence unprepare it here */ 257 257 clk_unprepare(pc->clk); 258 - 259 - return 0; 260 258 } 261 259 262 260 static const struct of_device_id spear_pwm_of_match[] = { ··· 271 273 .of_match_table = spear_pwm_of_match, 272 274 }, 273 275 .probe = spear_pwm_probe, 274 - .remove = spear_pwm_remove, 276 + .remove_new = spear_pwm_remove, 275 277 }; 276 278 277 279 module_platform_driver(spear_pwm_driver);
+2 -4
drivers/pwm/pwm-sprd.c
··· 280 280 return ret; 281 281 } 282 282 283 - static int sprd_pwm_remove(struct platform_device *pdev) 283 + static void sprd_pwm_remove(struct platform_device *pdev) 284 284 { 285 285 struct sprd_pwm_chip *spc = platform_get_drvdata(pdev); 286 286 287 287 pwmchip_remove(&spc->chip); 288 - 289 - return 0; 290 288 } 291 289 292 290 static const struct of_device_id sprd_pwm_of_match[] = { ··· 299 301 .of_match_table = sprd_pwm_of_match, 300 302 }, 301 303 .probe = sprd_pwm_probe, 302 - .remove = sprd_pwm_remove, 304 + .remove_new = sprd_pwm_remove, 303 305 }; 304 306 305 307 module_platform_driver(sprd_pwm_driver);
+2 -4
drivers/pwm/pwm-sti.c
··· 669 669 return 0; 670 670 } 671 671 672 - static int sti_pwm_remove(struct platform_device *pdev) 672 + static void sti_pwm_remove(struct platform_device *pdev) 673 673 { 674 674 struct sti_pwm_chip *pc = platform_get_drvdata(pdev); 675 675 ··· 677 677 678 678 clk_unprepare(pc->pwm_clk); 679 679 clk_unprepare(pc->cpt_clk); 680 - 681 - return 0; 682 680 } 683 681 684 682 static const struct of_device_id sti_pwm_of_match[] = { ··· 691 693 .of_match_table = sti_pwm_of_match, 692 694 }, 693 695 .probe = sti_pwm_probe, 694 - .remove = sti_pwm_remove, 696 + .remove_new = sti_pwm_remove, 695 697 }; 696 698 module_platform_driver(sti_pwm_driver); 697 699
+1 -1
drivers/pwm/pwm-stm32-lp.c
··· 252 252 .probe = stm32_pwm_lp_probe, 253 253 .driver = { 254 254 .name = "stm32-pwm-lp", 255 - .of_match_table = of_match_ptr(stm32_pwm_lp_of_match), 255 + .of_match_table = stm32_pwm_lp_of_match, 256 256 .pm = &stm32_pwm_lp_pm_ops, 257 257 }, 258 258 };
+6 -4
drivers/pwm/pwm-stm32.c
··· 207 207 regmap_write(priv->regmap, TIM_ARR, priv->max_arr); 208 208 regmap_write(priv->regmap, TIM_PSC, psc); 209 209 210 + /* Reset input selector to its default input and disable slave mode */ 211 + regmap_write(priv->regmap, TIM_TISEL, 0x0); 212 + regmap_write(priv->regmap, TIM_SMCR, 0x0); 213 + 210 214 /* Map TI1 or TI2 PWM input to IC1 & IC2 (or TI3/4 to IC3 & IC4) */ 211 215 regmap_update_bits(priv->regmap, 212 216 pwm->hwpwm < 2 ? TIM_CCMR1 : TIM_CCMR2, ··· 646 642 return 0; 647 643 } 648 644 649 - static int stm32_pwm_remove(struct platform_device *pdev) 645 + static void stm32_pwm_remove(struct platform_device *pdev) 650 646 { 651 647 struct stm32_pwm *priv = platform_get_drvdata(pdev); 652 648 unsigned int i; ··· 655 651 pwm_disable(&priv->chip.pwms[i]); 656 652 657 653 pwmchip_remove(&priv->chip); 658 - 659 - return 0; 660 654 } 661 655 662 656 static int __maybe_unused stm32_pwm_suspend(struct device *dev) ··· 701 699 702 700 static struct platform_driver stm32_pwm_driver = { 703 701 .probe = stm32_pwm_probe, 704 - .remove = stm32_pwm_remove, 702 + .remove_new = stm32_pwm_remove, 705 703 .driver = { 706 704 .name = "stm32-pwm", 707 705 .of_match_table = stm32_pwm_of_match,
+2 -4
drivers/pwm/pwm-sun4i.c
··· 477 477 return ret; 478 478 } 479 479 480 - static int sun4i_pwm_remove(struct platform_device *pdev) 480 + static void sun4i_pwm_remove(struct platform_device *pdev) 481 481 { 482 482 struct sun4i_pwm_chip *sun4ichip = platform_get_drvdata(pdev); 483 483 ··· 485 485 486 486 clk_disable_unprepare(sun4ichip->bus_clk); 487 487 reset_control_assert(sun4ichip->rst); 488 - 489 - return 0; 490 488 } 491 489 492 490 static struct platform_driver sun4i_pwm_driver = { ··· 493 495 .of_match_table = sun4i_pwm_dt_ids, 494 496 }, 495 497 .probe = sun4i_pwm_probe, 496 - .remove = sun4i_pwm_remove, 498 + .remove_new = sun4i_pwm_remove, 497 499 }; 498 500 module_platform_driver(sun4i_pwm_driver); 499 501
+2 -4
drivers/pwm/pwm-tegra.c
··· 350 350 return ret; 351 351 } 352 352 353 - static int tegra_pwm_remove(struct platform_device *pdev) 353 + static void tegra_pwm_remove(struct platform_device *pdev) 354 354 { 355 355 struct tegra_pwm_chip *pc = platform_get_drvdata(pdev); 356 356 ··· 359 359 reset_control_assert(pc->rst); 360 360 361 361 pm_runtime_force_suspend(&pdev->dev); 362 - 363 - return 0; 364 362 } 365 363 366 364 static int __maybe_unused tegra_pwm_runtime_suspend(struct device *dev) ··· 432 434 .pm = &tegra_pwm_pm_ops, 433 435 }, 434 436 .probe = tegra_pwm_probe, 435 - .remove = tegra_pwm_remove, 437 + .remove_new = tegra_pwm_remove, 436 438 }; 437 439 438 440 module_platform_driver(tegra_pwm_driver);
+2 -4
drivers/pwm/pwm-tiecap.c
··· 265 265 return 0; 266 266 } 267 267 268 - static int ecap_pwm_remove(struct platform_device *pdev) 268 + static void ecap_pwm_remove(struct platform_device *pdev) 269 269 { 270 270 pm_runtime_disable(&pdev->dev); 271 - 272 - return 0; 273 271 } 274 272 275 273 #ifdef CONFIG_PM_SLEEP ··· 324 326 .pm = &ecap_pwm_pm_ops, 325 327 }, 326 328 .probe = ecap_pwm_probe, 327 - .remove = ecap_pwm_remove, 329 + .remove_new = ecap_pwm_remove, 328 330 }; 329 331 module_platform_driver(ecap_pwm_driver); 330 332
+2 -4
drivers/pwm/pwm-tiehrpwm.c
··· 511 511 return ret; 512 512 } 513 513 514 - static int ehrpwm_pwm_remove(struct platform_device *pdev) 514 + static void ehrpwm_pwm_remove(struct platform_device *pdev) 515 515 { 516 516 struct ehrpwm_pwm_chip *pc = platform_get_drvdata(pdev); 517 517 ··· 520 520 clk_unprepare(pc->tbclk); 521 521 522 522 pm_runtime_disable(&pdev->dev); 523 - 524 - return 0; 525 523 } 526 524 527 525 #ifdef CONFIG_PM_SLEEP ··· 602 604 .pm = &ehrpwm_pwm_pm_ops, 603 605 }, 604 606 .probe = ehrpwm_pwm_probe, 605 - .remove = ehrpwm_pwm_remove, 607 + .remove_new = ehrpwm_pwm_remove, 606 608 }; 607 609 module_platform_driver(ehrpwm_pwm_driver); 608 610
+2 -4
drivers/pwm/pwm-vt8500.c
··· 279 279 return ret; 280 280 } 281 281 282 - static int vt8500_pwm_remove(struct platform_device *pdev) 282 + static void vt8500_pwm_remove(struct platform_device *pdev) 283 283 { 284 284 struct vt8500_chip *vt8500 = platform_get_drvdata(pdev); 285 285 286 286 pwmchip_remove(&vt8500->chip); 287 287 288 288 clk_unprepare(vt8500->clk); 289 - 290 - return 0; 291 289 } 292 290 293 291 static struct platform_driver vt8500_pwm_driver = { 294 292 .probe = vt8500_pwm_probe, 295 - .remove = vt8500_pwm_remove, 293 + .remove_new = vt8500_pwm_remove, 296 294 .driver = { 297 295 .name = "vt8500-pwm", 298 296 .of_match_table = vt8500_pwm_dt_ids,
+2 -3
drivers/pwm/pwm-xilinx.c
··· 292 292 return 0; 293 293 } 294 294 295 - static int xilinx_pwm_remove(struct platform_device *pdev) 295 + static void xilinx_pwm_remove(struct platform_device *pdev) 296 296 { 297 297 struct xilinx_pwm_device *xilinx_pwm = platform_get_drvdata(pdev); 298 298 299 299 pwmchip_remove(&xilinx_pwm->chip); 300 300 clk_rate_exclusive_put(xilinx_pwm->priv.clk); 301 301 clk_disable_unprepare(xilinx_pwm->priv.clk); 302 - return 0; 303 302 } 304 303 305 304 static const struct of_device_id xilinx_pwm_of_match[] = { ··· 309 310 310 311 static struct platform_driver xilinx_pwm_driver = { 311 312 .probe = xilinx_pwm_probe, 312 - .remove = xilinx_pwm_remove, 313 + .remove_new = xilinx_pwm_remove, 313 314 .driver = { 314 315 .name = "xilinx-pwm", 315 316 .of_match_table = of_match_ptr(xilinx_pwm_of_match),
+1
include/linux/mfd/stm32-timers.h
··· 31 31 #define TIM_BDTR 0x44 /* Break and Dead-Time Reg */ 32 32 #define TIM_DCR 0x48 /* DMA control register */ 33 33 #define TIM_DMAR 0x4C /* DMA register for transfer */ 34 + #define TIM_TISEL 0x68 /* Input Selection */ 34 35 35 36 #define TIM_CR1_CEN BIT(0) /* Counter Enable */ 36 37 #define TIM_CR1_DIR BIT(4) /* Counter Direction */
-13
include/linux/pwm.h
··· 309 309 310 310 #if IS_ENABLED(CONFIG_PWM) 311 311 /* PWM user APIs */ 312 - struct pwm_device *pwm_request(int pwm_id, const char *label); 313 - void pwm_free(struct pwm_device *pwm); 314 312 int pwm_apply_state(struct pwm_device *pwm, const struct pwm_state *state); 315 313 int pwm_adjust_config(struct pwm_device *pwm); 316 314 ··· 408 410 struct fwnode_handle *fwnode, 409 411 const char *con_id); 410 412 #else 411 - static inline struct pwm_device *pwm_request(int pwm_id, const char *label) 412 - { 413 - might_sleep(); 414 - return ERR_PTR(-ENODEV); 415 - } 416 - 417 - static inline void pwm_free(struct pwm_device *pwm) 418 - { 419 - might_sleep(); 420 - } 421 - 422 413 static inline int pwm_apply_state(struct pwm_device *pwm, 423 414 const struct pwm_state *state) 424 415 {