/Linux-v5.15/Documentation/driver-api/ |
D | pwm.rst | 2 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. 15 ---------------- 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, 36 ---------- [all …]
|
/Linux-v5.15/Documentation/devicetree/bindings/input/ |
D | pwm-vibrator.txt | 1 * PWM vibrator device tree bindings 3 Registers a PWM device as vibrator. It is expected, that the vibrator's 4 strength increases based on the duty cycle of the enable PWM channel 7 The binding supports an optional direction PWM channel, that can be 12 - compatible: should contain "pwm-vibrator" 13 - pwm-names: Should contain "enable" and optionally "direction" 14 - pwms: Should contain a PWM handle for each entry in pwm-names 17 - vcc-supply: Phandle for the regulator supplying power 18 - direction-duty-cycle-ns: Duty cycle of the direction PWM channel in 26 pinctrl-single,pins = < [all …]
|
D | dlg,da7280.txt | 4 - compatible: Should be "dlg,da7280". 5 - reg: Specifies the I2C slave address. 7 - interrupt-parent : Specifies the phandle of the interrupt controller to 10 - dlg,actuator-type: Set Actuator type. it should be one of: 11 "LRA" - Linear Resonance Actuator type. 12 "ERM-bar" - Bar type Eccentric Rotating Mass. 13 "ERM-coin" - Coin type Eccentric Rotating Mass. 15 - dlg,const-op-mode: Haptic operation mode for FF_CONSTANT. 17 1 - Direct register override(DRO) mode triggered by i2c(default), 18 2 - PWM data source mode controlled by PWM duty, [all …]
|
/Linux-v5.15/drivers/pwm/ |
D | pwm-twl.c | 1 // SPDX-License-Identifier: GPL-2.0-only 12 #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 69 * On-cycle is set to 1 (the minimum allowed value) in twl_pwm_config() 71 * 0 -> off cycle = 2, in twl_pwm_config() 72 * 1 -> off cycle = 2, in twl_pwm_config() 73 * 2 -> off cycle = 3, in twl_pwm_config() 74 * 126 - > off cycle 127, in twl_pwm_config() [all …]
|
D | pwm-twl-led.c | 1 // SPDX-License-Identifier: GPL-2.0-only 8 * This driver is a complete rewrite of the former pwm-twl6030.c authorded by: 15 #include <linux/pwm.h> 20 * This driver handles the PWM driven LED terminals of TWL4030 and TWL6030. 22 * - LEDA uses PWMA 23 * - LEDB uses PWMB 58 static int twl4030_pwmled_config(struct pwm_chip *chip, struct pwm_device *pwm, in twl4030_pwmled_config() argument 67 * On-cycle is set to 1 (the minimum allowed value) in twl4030_pwmled_config() 69 * 0 -> off cycle = 2, in twl4030_pwmled_config() 70 * 1 -> off cycle = 2, in twl4030_pwmled_config() [all …]
|
D | pwm-sti.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * PWM device driver for ST SoCs 5 * Copyright (C) 2013-2016 STMicroelectronics (R&D) Limited 18 #include <linux/pwm.h> 30 #define STI_INT_EN 0x54 /* Interrupt Enable/Disable register */ 59 * Each capture input can be programmed to detect rising-edge, falling-edge, 100 struct mutex sti_pwm_lock; /* To sync between enable/disable calls */ 125 struct sti_pwm_compat_data *cdata = pc->cdata; in sti_pwm_get_prescale() 130 clk_rate = clk_get_rate(pc->pwm_clk); in sti_pwm_get_prescale() 132 dev_err(pc->dev, "failed to get clock rate\n"); in sti_pwm_get_prescale() [all …]
|
D | pwm-sprd.c | 1 // SPDX-License-Identifier: GPL-2.0 12 #include <linux/pwm.h> 43 * The list of clocks required by PWM channels, and each channel has 2 clocks: 44 * enable clock and pwm clock. 57 return readl_relaxed(spc->base + offset); in sprd_pwm_read() 65 writel_relaxed(val, spc->base + offset); in sprd_pwm_write() 68 static void sprd_pwm_get_state(struct pwm_chip *chip, struct pwm_device *pwm, in sprd_pwm_get_state() argument 73 struct sprd_pwm_chn *chn = &spc->chn[pwm->hwpwm]; in sprd_pwm_get_state() 79 * The clocks to PWM channel has to be enabled first before in sprd_pwm_get_state() 82 ret = clk_bulk_prepare_enable(SPRD_PWM_CHN_CLKS_NUM, chn->clks); in sprd_pwm_get_state() [all …]
|
D | pwm-sifive.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * Copyright (C) 2017-2018 SiFive 4 * For SiFive's PWM IP block documentation please refer Chapter 14 of 5 * Reference Manual : https://static.dev.sifive.com/FU540-C000-v1.0.pdf 8 * - When changing both duty cycle and period, we cannot prevent in 11 * - The hardware cannot generate a 100% duty cycle. 12 * - The hardware generates only inverted output. 18 #include <linux/pwm.h> 61 static int pwm_sifive_request(struct pwm_chip *chip, struct pwm_device *pwm) in pwm_sifive_request() argument 65 mutex_lock(&ddata->lock); in pwm_sifive_request() [all …]
|
D | pwm-vt8500.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * drivers/pwm/pwm-vt8500.c 15 #include <linux/pwm.h> 31 #define REG_CTRL(pwm) (((pwm) << 4) + 0x00) argument 32 #define REG_SCALAR(pwm) (((pwm) << 4) + 0x04) argument 33 #define REG_PERIOD(pwm) (((pwm) << 4) + 0x08) argument 34 #define REG_DUTY(pwm) (((pwm) << 4) + 0x0C) argument 64 while ((readl(vt8500->base + REG_STATUS) & mask) && --loops) in pwm_busy_wait() 68 dev_warn(vt8500->chip.dev, "Waiting for status bits 0x%x to clear timed out\n", in pwm_busy_wait() 72 static int vt8500_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, in vt8500_pwm_config() argument [all …]
|
D | pwm-renesas-tpu.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * R-Mobile TPU PWM driver 18 #include <linux/pwm.h> 50 #define TPU_TIERn 0x0c /* Timer interrupt enable register */ 63 TPU_PIN_PWM, /* Pin is driven by PWM */ 92 static void tpu_pwm_write(struct tpu_pwm_device *pwm, int reg_nr, u16 value) in tpu_pwm_write() argument 94 void __iomem *base = pwm->tpu->base + TPU_CHANNEL_OFFSET in tpu_pwm_write() 95 + pwm->channel * TPU_CHANNEL_SIZE; in tpu_pwm_write() 100 static void tpu_pwm_set_pin(struct tpu_pwm_device *pwm, in tpu_pwm_set_pin() argument 103 static const char * const states[] = { "inactive", "PWM", "active" }; in tpu_pwm_set_pin() [all …]
|
D | pwm-rockchip.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * PWM driver for Rockchip SoCs 15 #include <linux/pwm.h> 61 struct pwm_device *pwm, in rockchip_pwm_get_state() argument 65 u32 enable_conf = pc->data->enable_conf; in rockchip_pwm_get_state() 71 ret = clk_enable(pc->pclk); in rockchip_pwm_get_state() 75 ret = clk_enable(pc->clk); in rockchip_pwm_get_state() 79 clk_rate = clk_get_rate(pc->clk); in rockchip_pwm_get_state() 81 tmp = readl_relaxed(pc->base + pc->data->regs.period); in rockchip_pwm_get_state() 82 tmp *= pc->data->prescaler * NSEC_PER_SEC; in rockchip_pwm_get_state() [all …]
|
D | pwm-bcm-kona.c | 23 #include <linux/pwm.h> 28 * The Kona PWM has some unusual characteristics. Here are the main points. 44 * 5) When the external clock that feeds the PWM is disabled, output is pegged 85 unsigned int value = readl(kp->base + PWM_CONTROL_OFFSET); in kona_pwmc_prepare_for_settings() 89 writel(value, kp->base + PWM_CONTROL_OFFSET); in kona_pwmc_prepare_for_settings() 93 * it. Failing to do this may result in no PWM signal. in kona_pwmc_prepare_for_settings() 100 unsigned int value = readl(kp->base + PWM_CONTROL_OFFSET); in kona_pwmc_apply_settings() 105 writel(value, kp->base + PWM_CONTROL_OFFSET); in kona_pwmc_apply_settings() 111 static int kona_pwmc_config(struct pwm_chip *chip, struct pwm_device *pwm, in kona_pwmc_config() argument 117 unsigned int value, chan = pwm->hwpwm; in kona_pwmc_config() [all …]
|
D | pwm-berlin.c | 2 * Marvell Berlin PWM driver 6 * Author: Antoine Tenart <antoine.tenart@free-electrons.com> 18 #include <linux/pwm.h> 42 u32 enable; member 62 return readl_relaxed(bpc->base + channel * 0x10 + offset); in berlin_pwm_readl() 69 writel_relaxed(value, bpc->base + channel * 0x10 + offset); in berlin_pwm_writel() 72 static int berlin_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm) in berlin_pwm_request() argument 78 return -ENOMEM; in berlin_pwm_request() 80 return pwm_set_chip_data(pwm, channel); in berlin_pwm_request() 83 static void berlin_pwm_free(struct pwm_chip *chip, struct pwm_device *pwm) in berlin_pwm_free() argument [all …]
|
D | pwm-tiecap.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * ECAP PWM driver 5 * Copyright (C) 2012 Texas Instruments, Inc. - https://www.ti.com/ 14 #include <linux/pwm.h> 50 static int ecap_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, in ecap_pwm_config() argument 58 c = pc->clk_rate; in ecap_pwm_config() 67 c = pc->clk_rate; in ecap_pwm_config() 73 pm_runtime_get_sync(pc->chip.dev); in ecap_pwm_config() 75 value = readw(pc->mmio_base + ECCTL2); in ecap_pwm_config() 80 writew(value, pc->mmio_base + ECCTL2); in ecap_pwm_config() [all …]
|
D | pwm-img.c | 1 // SPDX-License-Identifier: GPL-2.0-only 5 * Copyright (c) 2014-2015, Imagination Technologies 7 * Based on drivers/pwm/pwm-tegra.c, Copyright (c) 2010, NVIDIA Corporation 19 #include <linux/pwm.h> 23 /* PWM registers */ 43 * PWM period is specified with a timebase register, 44 * in number of step periods. The PWM duty cycle is also 49 * Imposing a minimum timebase, will impose a maximum PWM frequency. 83 writel(val, chip->base + reg); in img_pwm_writel() 89 return readl(chip->base + reg); in img_pwm_readl() [all …]
|
D | pwm-tiehrpwm.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * EHRPWM PWM driver 5 * Copyright (C) 2012 Texas Instruments, Inc. - https://www.ti.com/ 10 #include <linux/pwm.h> 145 * set_prescale_div - Set up the prescaler divider function 187 * Configure PWM output to HIGH/LOW level on counter in configure_polarity() 196 if (pc->polarity[chan] == PWM_POLARITY_INVERSED) in configure_polarity() 204 if (pc->polarity[chan] == PWM_POLARITY_INVERSED) in configure_polarity() 211 ehrpwm_modify(pc->mmio_base, aqctl_reg, aqctl_mask, aqctl_val); in configure_polarity() 218 static int ehrpwm_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, in ehrpwm_pwm_config() argument [all …]
|
/Linux-v5.15/Documentation/devicetree/bindings/regulator/ |
D | pwm-regulator.txt | 1 Bindings for the Generic PWM Regulator 7 predefined voltage <=> duty-cycle values must be 10 Intermediary duty-cycle values which would normally 13 the user if the assumptions made in continuous-voltage 18 regulator-{min,max}-microvolt properties to calculate 19 appropriate duty-cycle values. This allows for a much 21 voltage-table mode above. This solution does make an 22 assumption that a %50 duty-cycle value will cause the 27 -------------------- 28 - compatible: Should be "pwm-regulator" [all …]
|
D | tps51632-regulator.txt | 4 - compatible: Must be "ti,tps51632" 5 - reg: I2C slave address 8 - ti,enable-pwm-dvfs: Enable the DVFS voltage control through the PWM interface. 9 - ti,dvfs-step-20mV: The 20mV step voltage when PWM DVFS enabled. Missing this 10 will set 10mV step voltage in PWM DVFS mode. In normal mode, the voltage 21 regulator-name = "tps51632-vout"; 22 regulator-min-microvolt = <500000>; 23 regulator-max-microvolt = <1500000>; 24 regulator-boot-on; 25 ti,enable-pwm-dvfs; [all …]
|
/Linux-v5.15/Documentation/devicetree/bindings/leds/backlight/ |
D | pwm-backlight.yaml | 1 # SPDX-License-Identifier: GPL-2.0-only 3 --- 4 $id: http://devicetree.org/schemas/leds/backlight/pwm-backlight.yaml# 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 7 title: pwm-backlight bindings 10 - Lee Jones <lee.jones@linaro.org> 11 - Daniel Thompson <daniel.thompson@linaro.org> 12 - Jingoo Han <jingoohan1@gmail.com> 16 const: pwm-backlight 21 pwm-names: true [all …]
|
/Linux-v5.15/Documentation/ABI/testing/ |
D | sysfs-class-pwm | 1 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/pwmchipN/ 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/pwmchipN/npwm 24 The number of PWM channels supported by the PWM chip. 26 What: /sys/class/pwm/pwmchipN/export [all …]
|
/Linux-v5.15/drivers/regulator/ |
D | pwm-regulator.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * Regulator driver for PWM Regulators 5 * Copyright (C) 2014 - STMicroelectronics Inc. 18 #include <linux/pwm.h> 29 struct pwm_device *pwm; member 42 /* Enable GPIO */ 52 * Voltage table call-backs 61 pwm_get_state(drvdata->pwm, &pwm_state); in pwm_regulator_init_state() 64 for (i = 0; i < rdev->desc->n_voltages; i++) { in pwm_regulator_init_state() 65 if (dutycycle == drvdata->duty_cycle_table[i].dutycycle) { in pwm_regulator_init_state() [all …]
|
/Linux-v5.15/drivers/video/backlight/ |
D | lp855x_bl.c | 1 // SPDX-License-Identifier: GPL-2.0-only 16 #include <linux/pwm.h> 39 #define DEFAULT_BL_NAME "lcd-backlight" 72 struct pwm_device *pwm; member 74 struct regulator *enable; /* regulator for EN/VDDIO input */ member 79 return i2c_smbus_write_byte_data(lp->client, reg, data); in lp855x_write_byte() 87 ret = i2c_smbus_read_byte_data(lp->client, reg); in lp855x_update_bit() 89 dev_err(lp->dev, "failed to read 0x%.2x\n", reg); in lp855x_update_bit() 104 switch (lp->chip_id) { in lp855x_is_valid_rom_area() 171 struct lp855x_platform_data *pd = lp->pdata; in lp855x_configure() [all …]
|
D | Kconfig | 1 # SPDX-License-Identifier: GPL-2.0-only 14 This framework adds support for low-level control of LCD. 15 Some framebuffer devices connect to platform-specific LCD modules 16 in order to have a platform-specific way to control the flat panel 90 This driver provides a platform-device registered LCD power 94 tristate "Sharp SL-6000 LCD Driver" 97 If you have an Sharp SL-6000 Zaurus say Y to enable a driver 106 say Y to enable LCD control driver. 113 If you have an AMS369FG06 AMOLED Panel, say Y to enable its 121 If you have an LMS501KF03 LCD Panel, say Y to enable its [all …]
|
/Linux-v5.15/drivers/leds/ |
D | leds-lm3530.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * Copyright (C) 2011 ST-Ericsson SA. 9 * based on leds-lm3530.c by Dan Murphy <D.Murphy@motorola.com> 17 #include <linux/led-lm3530.h> 22 #define LM3530_LED_DEV "lcd-backlight" 23 #define LM3530_NAME "lm3530-led" 92 { "pwm", LM3530_BL_MODE_PWM }, 100 * @mode: mode of operation - manual, ALS, PWM 103 * @enable: regulator is enabled 112 bool enable; member [all …]
|
/Linux-v5.15/arch/arm64/boot/dts/rockchip/ |
D | rk3399-gru-chromebook.dtsi | 1 // SPDX-License-Identifier: (GPL-2.0+ OR MIT) 3 * Google Gru-Chromebook shared properties 8 #include "rk3399-gru.dtsi" 11 pp900_ap: pp900-ap { 12 compatible = "regulator-fixed"; 13 regulator-name = "pp900_ap"; 16 regulator-always-on; 17 regulator-boot-on; 18 regulator-min-microvolt = <900000>; 19 regulator-max-microvolt = <900000>; [all …]
|