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: Willie Ruan <wruan@quicinc.com>