Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 5103ce1b authored by Willie Ruan's avatar Willie Ruan Committed by Stephen Boyd
Browse files

misc: add PWM (Pulse Width Modulation) driver for pmic8058 chip



Qualcomm PM8058 chip has 8 channels of PWM, also called LPG (Light
Pulse Generator). All PWM channels can be used as simple PWM machine
or as a more advanced PWM pattern generator using programmed lookup
table. This patch supports simple PWM machine as a sub device of
pmic8058 core.

To use PWM:
1. #include <linux/pwm.h>
2. #include <linux/pmic8058-pwm.h> only when you want to do the
   configuration by yourself.
3. First call
   * pwm_request() -- to reserve a PWM chanel
4. Call these APIs to configure & start/stop a PWM waveform
   * pwm_config(period, duty) -- to configure a PWM wave
   * pwm_enable() -- to start and enable the PWM output
   * pwm_disable() -- to stop and disable the PWM output
   You can repeat above 3 calls for different PWM waveforms.
5. Last call
   * pwm_free() -- to free the PWM channel

Signed-off-by: default avatarWillie Ruan <wruan@quicinc.com>
parent d6428142
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment