Home
last modified time | relevance | path

Searched full:pwm (Results 1 – 25 of 1485) sorted by relevance

12345678910>>...60

/Linux-v6.6/drivers/pwm/
DKconfig2 menuconfig PWM config
3 bool "Pulse-Width Modulation (PWM) Support"
5 Generic Pulse-Width Modulation (PWM) support.
14 This framework provides a generic interface to PWM devices
16 to register and unregister a PWM chip, an abstraction of a PWM
17 controller, that supports one or more PWM devices. Client
18 drivers can request PWM devices and use the generic framework
21 This generic framework replaces the legacy PWM framework which
30 if PWM
37 bool "PWM lowlevel drivers additional checks and debug messages"
[all …]
DMakefile4 obj-$(CONFIG_PWM_AB8500) += pwm-ab8500.o
5 obj-$(CONFIG_PWM_APPLE) += pwm-apple.o
6 obj-$(CONFIG_PWM_ATMEL) += pwm-atmel.o
7 obj-$(CONFIG_PWM_ATMEL_HLCDC_PWM) += pwm-atmel-hlcdc.o
8 obj-$(CONFIG_PWM_ATMEL_TCB) += pwm-atmel-tcb.o
9 obj-$(CONFIG_PWM_BCM_IPROC) += pwm-bcm-iproc.o
10 obj-$(CONFIG_PWM_BCM_KONA) += pwm-bcm-kona.o
11 obj-$(CONFIG_PWM_BCM2835) += pwm-bcm2835.o
12 obj-$(CONFIG_PWM_BERLIN) += pwm-berlin.o
13 obj-$(CONFIG_PWM_BRCMSTB) += pwm-brcmstb.o
[all …]
Dcore.c12 #include <linux/pwm.h>
21 #include <dt-bindings/pwm/pwm.h>
24 #include <trace/events/pwm.h>
85 static int pwm_device_request(struct pwm_device *pwm, const char *label) in pwm_device_request() argument
89 if (test_bit(PWMF_REQUESTED, &pwm->flags)) in pwm_device_request()
92 if (!try_module_get(pwm->chip->ops->owner)) in pwm_device_request()
95 if (pwm->chip->ops->request) { in pwm_device_request()
96 err = pwm->chip->ops->request(pwm->chip, pwm); in pwm_device_request()
98 module_put(pwm->chip->ops->owner); in pwm_device_request()
103 if (pwm->chip->ops->get_state) { in pwm_device_request()
[all …]
Dpwm-twl.c12 #include <linux/pwm.h>
32 #define TWL4030_PWM_TOGGLE(pwm, x) ((x) << (pwm)) argument
46 #define TWL6030_PWM_TOGGLE(pwm, x) ((x) << (pwm * 3)) argument
60 static int twl_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, in twl_pwm_config() argument
76 * When on cycle == off cycle the PWM will be always on in twl_pwm_config()
83 base = pwm->hwpwm * 3; in twl_pwm_config()
89 dev_err(chip->dev, "%s: Failed to configure PWM\n", pwm->label); in twl_pwm_config()
94 static int twl4030_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm) in twl4030_pwm_enable() argument
103 dev_err(chip->dev, "%s: Failed to read GPBR1\n", pwm->label); in twl4030_pwm_enable()
107 val |= TWL4030_PWM_TOGGLE(pwm->hwpwm, TWL4030_PWMXCLK_ENABLE); in twl4030_pwm_enable()
[all …]
Dsysfs.c3 * A simple sysfs interface for the generic PWM framework
15 #include <linux/pwm.h>
19 struct pwm_device *pwm; member
33 return export->pwm; in child_to_pwm_device()
40 const struct pwm_device *pwm = child_to_pwm_device(child); in period_show() local
43 pwm_get_state(pwm, &state); in period_show()
53 struct pwm_device *pwm = export->pwm; in period_store() local
63 pwm_get_state(pwm, &state); in period_store()
65 ret = pwm_apply_state(pwm, &state); in period_store()
75 const struct pwm_device *pwm = child_to_pwm_device(child); in duty_cycle_show() local
[all …]
Dpwm-vt8500.c3 * drivers/pwm/pwm-vt8500.c
16 #include <linux/pwm.h>
28 #define REG_CTRL(pwm) (((pwm) << 4) + 0x00) argument
29 #define REG_SCALAR(pwm) (((pwm) << 4) + 0x04) argument
30 #define REG_PERIOD(pwm) (((pwm) << 4) + 0x08) argument
31 #define REG_DUTY(pwm) (((pwm) << 4) + 0x0C) argument
69 static int vt8500_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, in vt8500_pwm_config() argument
105 writel(prescale, vt8500->base + REG_SCALAR(pwm->hwpwm)); in vt8500_pwm_config()
106 vt8500_pwm_busy_wait(vt8500, pwm->hwpwm, STATUS_SCALAR_UPDATE); in vt8500_pwm_config()
108 writel(pv, vt8500->base + REG_PERIOD(pwm->hwpwm)); in vt8500_pwm_config()
[all …]
Dpwm-lpss.c3 * Intel Low Power Subsystem PWM controller driver
24 #include "pwm-lpss.h"
26 #define PWM 0x00000000 macro
32 /* Size of each PWM register space if multiple */
74 static inline u32 pwm_lpss_read(const struct pwm_device *pwm) in pwm_lpss_read() argument
76 struct pwm_lpss_chip *lpwm = to_lpwm(pwm->chip); in pwm_lpss_read()
78 return readl(lpwm->regs + pwm->hwpwm * PWM_SIZE + PWM); in pwm_lpss_read()
81 static inline void pwm_lpss_write(const struct pwm_device *pwm, u32 value) in pwm_lpss_write() argument
83 struct pwm_lpss_chip *lpwm = to_lpwm(pwm->chip); in pwm_lpss_write()
85 writel(value, lpwm->regs + pwm->hwpwm * PWM_SIZE + PWM); in pwm_lpss_write()
[all …]
Dpwm-twl-led.c8 * This driver is a complete rewrite of the former pwm-twl6030.c authorded by:
31 #include <linux/pwm.h>
36 * This driver handles the PWM driven LED terminals of TWL4030 and TWL6030.
74 static int twl4030_pwmled_config(struct pwm_chip *chip, struct pwm_device *pwm, in twl4030_pwmled_config() argument
90 * When on cycle == off cycle the PWM will be always on in twl4030_pwmled_config()
97 base = pwm->hwpwm * 2 + TWL4030_PWMA_REG; in twl4030_pwmled_config()
103 dev_err(chip->dev, "%s: Failed to configure PWM\n", pwm->label); in twl4030_pwmled_config()
108 static int twl4030_pwmled_enable(struct pwm_chip *chip, struct pwm_device *pwm) in twl4030_pwmled_enable() argument
117 dev_err(chip->dev, "%s: Failed to read LEDEN\n", pwm->label); in twl4030_pwmled_enable()
121 val |= TWL4030_LED_TOGGLE(pwm->hwpwm, TWL4030_LED_PINS); in twl4030_pwmled_enable()
[all …]
Dpwm-samsung.c9 * PWM driver for Samsung SoCs
21 #include <linux/pwm.h>
59 * struct samsung_pwm_channel - private data of PWM channel
71 * struct samsung_pwm_chip - private data of PWM chip
72 * @chip: generic PWM chip
76 * @base: base address of mapped PWM registers
95 * PWM block is shared between pwm-samsung and samsung_pwm_timer drivers
101 * because all the supported SoCs contain only one instance of the PWM
121 struct pwm_device *pwm) in __pwm_samsung_manual_update() argument
123 unsigned int tcon_chan = to_tcon_channel(pwm->hwpwm); in __pwm_samsung_manual_update()
[all …]
Dpwm-jz4740.c4 * JZ4740 platform PWM support
20 #include <linux/pwm.h>
40 /* Enable all TCU channels for PWM use by default except channels 0/1 */ in jz4740_pwm_can_use_chn()
44 "ingenic,pwm-channels-mask", in jz4740_pwm_can_use_chn()
50 static int jz4740_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm) in jz4740_pwm_request() argument
57 if (!jz4740_pwm_can_use_chn(jz, pwm->hwpwm)) in jz4740_pwm_request()
60 snprintf(name, sizeof(name), "timer%u", pwm->hwpwm); in jz4740_pwm_request()
73 pwm_set_chip_data(pwm, clk); in jz4740_pwm_request()
78 static void jz4740_pwm_free(struct pwm_chip *chip, struct pwm_device *pwm) in jz4740_pwm_free() argument
80 struct clk *clk = pwm_get_chip_data(pwm); in jz4740_pwm_free()
[all …]
Dpwm-stmpe.c15 #include <linux/pwm.h>
39 static int stmpe_24xx_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm) in stmpe_24xx_pwm_enable() argument
47 dev_err(chip->dev, "error reading PWM#%u control\n", in stmpe_24xx_pwm_enable()
48 pwm->hwpwm); in stmpe_24xx_pwm_enable()
52 value = ret | BIT(pwm->hwpwm); in stmpe_24xx_pwm_enable()
56 dev_err(chip->dev, "error writing PWM#%u control\n", in stmpe_24xx_pwm_enable()
57 pwm->hwpwm); in stmpe_24xx_pwm_enable()
65 struct pwm_device *pwm) in stmpe_24xx_pwm_disable() argument
73 dev_err(chip->dev, "error reading PWM#%u control\n", in stmpe_24xx_pwm_disable()
74 pwm->hwpwm); in stmpe_24xx_pwm_disable()
[all …]
/Linux-v6.6/include/linux/
Dpwm.h12 * enum pwm_polarity - polarity of a PWM signal
26 * struct pwm_args - board-dependent PWM arguments
30 * This structure describes board-dependent arguments attached to a PWM
31 * device. These arguments are usually retrieved from the PWM lookup table or
34 * Do not confuse this with the PWM state: PWM arguments represent the initial
35 * configuration that users want to use on this PWM device rather than the
36 * current PWM hardware state.
49 * struct pwm_state - state of a PWM channel
50 * @period: PWM period (in nanoseconds)
51 * @duty_cycle: PWM duty cycle (in nanoseconds)
[all …]
/Linux-v6.6/Documentation/devicetree/bindings/pwm/
Dpwm.txt1 Specifying PWM information for devices
4 1) PWM user nodes
7 PWM users should specify a list of PWM devices that they want to use
8 with a property containing a 'pwm-list':
10 pwm-list ::= <single-pwm> [pwm-list]
11 single-pwm ::= <pwm-phandle> <pwm-specifier>
12 pwm-phandle : phandle to PWM controller node
13 pwm-specifier : array of #pwm-cells specifying the given PWM
16 PWM properties should be named "pwms". The exact meaning of each pwms
18 An optional property "pwm-names" may contain a list of strings to label
[all …]
Drenesas,pwm-rcar.yaml4 $id: http://devicetree.org/schemas/pwm/renesas,pwm-rcar.yaml#
7 title: Renesas R-Car PWM Timer Controller
16 - renesas,pwm-r8a7742 # RZ/G1H
17 - renesas,pwm-r8a7743 # RZ/G1M
18 - renesas,pwm-r8a7744 # RZ/G1N
19 - renesas,pwm-r8a7745 # RZ/G1E
20 - renesas,pwm-r8a77470 # RZ/G1C
21 - renesas,pwm-r8a774a1 # RZ/G2M
22 - renesas,pwm-r8a774b1 # RZ/G2N
23 - renesas,pwm-r8a774c0 # RZ/G2E
[all …]
Dpwm-samsung.yaml4 $id: http://devicetree.org/schemas/pwm/pwm-samsung.yaml#
7 title: Samsung SoC PWM timers
14 Samsung SoCs contain PWM timer blocks which can be used for system clock source
15 and clock event timers, as well as to drive SoC outputs with PWM signal. Each
16 PWM timer block provides 5 PWM channels (not all of them can drive physical
25 - samsung,s3c2410-pwm # 16-bit, S3C24xx
26 - samsung,s3c6400-pwm # 32-bit, S3C64xx
27 - samsung,s5p6440-pwm # 32-bit, S5P64x0
28 - samsung,s5pc100-pwm # 32-bit, S5PC100, S5PV210, Exynos4210 rev0 SoCs
29 - samsung,exynos4210-pwm # 32-bit, Exynos
[all …]
Dimx-pwm.yaml4 $id: http://devicetree.org/schemas/pwm/imx-pwm.yaml#
7 title: Freescale i.MX PWM controller
13 - $ref: pwm.yaml#
16 "#pwm-cells":
18 Should be 2 for i.MX1 and 3 for i.MX27 and newer SoCs. See pwm.yaml
27 - fsl,imx1-pwm
28 - fsl,imx27-pwm
31 - fsl,imx25-pwm
32 - fsl,imx31-pwm
33 - fsl,imx50-pwm
[all …]
Dpwm-rockchip.yaml4 $id: http://devicetree.org/schemas/pwm/pwm-rockchip.yaml#
7 title: Rockchip PWM controller
15 - const: rockchip,rk2928-pwm
16 - const: rockchip,rk3288-pwm
17 - const: rockchip,rk3328-pwm
18 - const: rockchip,vop-pwm
20 - const: rockchip,rk3036-pwm
21 - const: rockchip,rk2928-pwm
24 - rockchip,rk3128-pwm
25 - rockchip,rk3368-pwm
[all …]
Dallwinner,sun4i-a10-pwm.yaml4 $id: http://devicetree.org/schemas/pwm/allwinner,sun4i-a10-pwm.yaml#
7 title: Allwinner A10 PWM
14 "#pwm-cells":
19 - const: allwinner,sun4i-a10-pwm
20 - const: allwinner,sun5i-a10s-pwm
21 - const: allwinner,sun5i-a13-pwm
22 - const: allwinner,sun7i-a20-pwm
23 - const: allwinner,sun8i-h3-pwm
25 - const: allwinner,sun8i-a83t-pwm
26 - const: allwinner,sun8i-h3-pwm
[all …]
Dpwm-amlogic.yaml4 $id: http://devicetree.org/schemas/pwm/pwm-amlogic.yaml#
7 title: Amlogic PWM
13 - $ref: pwm.yaml#
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
[all …]
Dnvidia,tegra20-pwm.yaml4 $id: http://devicetree.org/schemas/pwm/nvidia,tegra20-pwm.yaml#
17 - nvidia,tegra20-pwm
18 - nvidia,tegra186-pwm
22 - nvidia,tegra30-pwm
23 - nvidia,tegra114-pwm
24 - nvidia,tegra124-pwm
25 - nvidia,tegra132-pwm
26 - nvidia,tegra210-pwm
28 - nvidia,tegra20-pwm
31 - const: nvidia,tegra194-pwm
[all …]
Dpwm-sifive.yaml5 $id: http://devicetree.org/schemas/pwm/pwm-sifive.yaml#
8 title: SiFive PWM controller
14 Unlike most other PWM controllers, the SiFive PWM controller currently
15 only supports one period for all channels in the PWM. All PWMs need to
18 achievable period. PWM RTL that corresponds to the IP block version
21 https://github.com/sifive/sifive-blocks/tree/master/src/main/scala/devices/pwm
24 - $ref: pwm.yaml#
30 - sifive,fu540-c000-pwm
31 - sifive,fu740-c000-pwm
34 Should be "sifive,<chip>-pwm" and "sifive,pwm<version>". Supported
[all …]
Dmediatek,mt2712-pwm.yaml4 $id: http://devicetree.org/schemas/pwm/mediatek,mt2712-pwm.yaml#
7 title: MediaTek PWM Controller
13 - $ref: pwm.yaml#
19 - mediatek,mt2712-pwm
20 - mediatek,mt6795-pwm
21 - mediatek,mt7622-pwm
22 - mediatek,mt7623-pwm
23 - mediatek,mt7628-pwm
24 - mediatek,mt7629-pwm
25 - mediatek,mt7981-pwm
[all …]
/Linux-v6.6/drivers/clocksource/
Dsamsung_pwm_timer.c79 static struct samsung_pwm_clocksource pwm; variable
92 reg = readl(pwm.base + REG_TCFG0); in samsung_timer_set_prescale()
95 writel(reg, pwm.base + REG_TCFG0); in samsung_timer_set_prescale()
107 bits = (fls(divisor) - 1) - pwm.variant.div_base; in samsung_timer_set_divisor()
111 reg = readl(pwm.base + REG_TCFG1); in samsung_timer_set_divisor()
114 writel(reg, pwm.base + REG_TCFG1); in samsung_timer_set_divisor()
129 tcon = readl_relaxed(pwm.base + REG_TCON); in samsung_time_stop()
131 writel_relaxed(tcon, pwm.base + REG_TCON); in samsung_time_stop()
147 tcon = readl_relaxed(pwm.base + REG_TCON); in samsung_time_setup()
152 writel_relaxed(tcnt, pwm.base + REG_TCNTB(channel)); in samsung_time_setup()
[all …]
/Linux-v6.6/Documentation/driver-api/
Dpwm.rst2 Pulse Width Modulation (PWM) interface
5 This provides an overview about the Linux PWM interface
9 the Linux PWM API (although they could). However, PWMs are often
12 this kind of flexibility the generic PWM API exists.
17 Users of the legacy PWM API use unique IDs to refer to PWM devices.
19 Instead of referring to a PWM device via its unique ID, board setup code
20 should instead register a static mapping that can be used to match PWM
24 PWM_LOOKUP("tegra-pwm", 0, "pwm-backlight", NULL,
39 consumer name. pwm_put() is used to free the PWM device. Managed variants of
42 After being requested, a PWM has to be configured using::
[all …]
/Linux-v6.6/Documentation/ABI/testing/
Dsysfs-class-pwm1 What: /sys/class/pwm/
6 The pwm/ class sub-directory belongs to the Generic PWM
7 Framework and provides a sysfs interface for using PWM
10 What: /sys/class/pwm/pwmchip<N>/
15 A /sys/class/pwm/pwmchipN directory is created for each
16 probed PWM controller/chip where N is the base of the
17 PWM chip.
19 What: /sys/class/pwm/pwmchip<N>/npwm
24 The number of PWM channels supported by the PWM chip.
26 What: /sys/class/pwm/pwmchip<N>/export
[all …]

12345678910>>...60