#include <linux/bits.h>
#include <linux/bitfield.h>
#include <linux/led-class-multicolor.h>
#include <linux/module.h>
#include <linux/nvmem-consumer.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/pwm.h>
#include <linux/regmap.h>
#include <linux/slab.h>
#include <linux/soc/qcom/qcom-pbs.h>
#define LPG_SUBTYPE_REG …
#define LPG_SUBTYPE_LPG …
#define LPG_SUBTYPE_PWM …
#define LPG_SUBTYPE_HI_RES_PWM …
#define LPG_SUBTYPE_LPG_LITE …
#define LPG_PATTERN_CONFIG_REG …
#define LPG_SIZE_CLK_REG …
#define PWM_CLK_SELECT_MASK …
#define PWM_CLK_SELECT_HI_RES_MASK …
#define PWM_SIZE_HI_RES_MASK …
#define LPG_PREDIV_CLK_REG …
#define PWM_FREQ_PRE_DIV_MASK …
#define PWM_FREQ_EXP_MASK …
#define PWM_TYPE_CONFIG_REG …
#define PWM_VALUE_REG …
#define PWM_ENABLE_CONTROL_REG …
#define PWM_SYNC_REG …
#define LPG_RAMP_DURATION_REG …
#define LPG_HI_PAUSE_REG …
#define LPG_LO_PAUSE_REG …
#define LPG_HI_IDX_REG …
#define LPG_LO_IDX_REG …
#define PWM_SEC_ACCESS_REG …
#define PWM_DTEST_REG(x) …
#define SDAM_REG_PBS_SEQ_EN …
#define SDAM_PBS_TRIG_SET …
#define SDAM_PBS_TRIG_CLR …
#define TRI_LED_SRC_SEL …
#define TRI_LED_EN_CTL …
#define TRI_LED_ATC_CTL …
#define LPG_LUT_REG(x) …
#define RAMP_CONTROL_REG …
#define LPG_RESOLUTION_9BIT …
#define LPG_RESOLUTION_15BIT …
#define PPG_MAX_LED_BRIGHTNESS …
#define LPG_MAX_M …
#define LPG_MAX_PREDIV …
#define DEFAULT_TICK_DURATION_US …
#define RAMP_STEP_DURATION(x) …
#define SDAM_MAX_DEVICES …
#define SDAM_START_BASE …
#define SDAM_REG_RAMP_STEP_DURATION …
#define SDAM_LUT_SDAM_LUT_PATTERN_OFFSET …
#define SDAM_LPG_SDAM_LUT_PATTERN_OFFSET …
#define SDAM_LUT_EN_OFFSET …
#define SDAM_PATTERN_CONFIG_OFFSET …
#define SDAM_END_INDEX_OFFSET …
#define SDAM_START_INDEX_OFFSET …
#define SDAM_PBS_SCRATCH_LUT_COUNTER_OFFSET …
#define SDAM_PAUSE_HI_MULTIPLIER_OFFSET …
#define SDAM_PAUSE_LO_MULTIPLIER_OFFSET …
struct lpg_channel;
struct lpg_data;
struct lpg { … };
struct lpg_channel { … };
struct lpg_led { … };
struct lpg_channel_data { … };
struct lpg_data { … };
#define PBS_SW_TRIG_BIT …
static int lpg_clear_pbs_trigger(struct lpg *lpg, unsigned int lut_mask)
{ … }
static int lpg_set_pbs_trigger(struct lpg *lpg, unsigned int lut_mask)
{ … }
static int lpg_sdam_configure_triggers(struct lpg_channel *chan, u8 set_trig)
{ … }
static int triled_set(struct lpg *lpg, unsigned int mask, unsigned int enable)
{ … }
static int lpg_lut_store_sdam(struct lpg *lpg, struct led_pattern *pattern,
size_t len, unsigned int *lo_idx, unsigned int *hi_idx)
{ … }
static int lpg_lut_store(struct lpg *lpg, struct led_pattern *pattern,
size_t len, unsigned int *lo_idx, unsigned int *hi_idx)
{ … }
static void lpg_lut_free(struct lpg *lpg, unsigned int lo_idx, unsigned int hi_idx)
{ … }
static int lpg_lut_sync(struct lpg *lpg, unsigned int mask)
{ … }
static const unsigned int lpg_clk_rates[] = …;
static const unsigned int lpg_clk_rates_hi_res[] = …;
static const unsigned int lpg_pre_divs[] = …;
static const unsigned int lpg_pwm_resolution[] = …;
static const unsigned int lpg_pwm_resolution_hi_res[] = …;
static int lpg_calc_freq(struct lpg_channel *chan, uint64_t period)
{ … }
static void lpg_calc_duty(struct lpg_channel *chan, uint64_t duty)
{ … }
static void lpg_apply_freq(struct lpg_channel *chan)
{ … }
#define LPG_ENABLE_GLITCH_REMOVAL …
static void lpg_enable_glitch(struct lpg_channel *chan)
{ … }
static void lpg_disable_glitch(struct lpg_channel *chan)
{ … }
static void lpg_apply_pwm_value(struct lpg_channel *chan)
{ … }
#define LPG_PATTERN_CONFIG_LO_TO_HI …
#define LPG_PATTERN_CONFIG_REPEAT …
#define LPG_PATTERN_CONFIG_TOGGLE …
#define LPG_PATTERN_CONFIG_PAUSE_HI …
#define LPG_PATTERN_CONFIG_PAUSE_LO …
static void lpg_sdam_apply_lut_control(struct lpg_channel *chan)
{ … }
static void lpg_apply_lut_control(struct lpg_channel *chan)
{ … }
#define LPG_ENABLE_CONTROL_OUTPUT …
#define LPG_ENABLE_CONTROL_BUFFER_TRISTATE …
#define LPG_ENABLE_CONTROL_SRC_PWM …
#define LPG_ENABLE_CONTROL_RAMP_GEN …
static void lpg_apply_control(struct lpg_channel *chan)
{ … }
#define LPG_SYNC_PWM …
static void lpg_apply_sync(struct lpg_channel *chan)
{ … }
static int lpg_parse_dtest(struct lpg *lpg)
{ … }
static void lpg_apply_dtest(struct lpg_channel *chan)
{ … }
static void lpg_apply(struct lpg_channel *chan)
{ … }
static void lpg_brightness_set(struct lpg_led *led, struct led_classdev *cdev,
struct mc_subled *subleds)
{ … }
static int lpg_brightness_single_set(struct led_classdev *cdev,
enum led_brightness value)
{ … }
static int lpg_brightness_mc_set(struct led_classdev *cdev,
enum led_brightness value)
{ … }
static int lpg_blink_set(struct lpg_led *led,
unsigned long *delay_on, unsigned long *delay_off)
{ … }
static int lpg_blink_single_set(struct led_classdev *cdev,
unsigned long *delay_on, unsigned long *delay_off)
{ … }
static int lpg_blink_mc_set(struct led_classdev *cdev,
unsigned long *delay_on, unsigned long *delay_off)
{ … }
static int lpg_pattern_set(struct lpg_led *led, struct led_pattern *led_pattern,
u32 len, int repeat)
{ … }
static int lpg_pattern_single_set(struct led_classdev *cdev,
struct led_pattern *pattern, u32 len,
int repeat)
{ … }
static int lpg_pattern_mc_set(struct led_classdev *cdev,
struct led_pattern *pattern, u32 len,
int repeat)
{ … }
static int lpg_pattern_clear(struct lpg_led *led)
{ … }
static int lpg_pattern_single_clear(struct led_classdev *cdev)
{ … }
static int lpg_pattern_mc_clear(struct led_classdev *cdev)
{ … }
static inline struct lpg *lpg_pwm_from_chip(struct pwm_chip *chip)
{ … }
static int lpg_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm)
{ … }
static int lpg_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
const struct pwm_state *state)
{ … }
static int lpg_pwm_get_state(struct pwm_chip *chip, struct pwm_device *pwm,
struct pwm_state *state)
{ … }
static const struct pwm_ops lpg_pwm_ops = …;
static int lpg_add_pwm(struct lpg *lpg)
{ … }
static int lpg_parse_channel(struct lpg *lpg, struct device_node *np,
struct lpg_channel **channel)
{ … }
static int lpg_add_led(struct lpg *lpg, struct device_node *np)
{ … }
static int lpg_init_channels(struct lpg *lpg)
{ … }
static int lpg_init_triled(struct lpg *lpg)
{ … }
static int lpg_init_lut(struct lpg *lpg)
{ … }
static int lpg_init_sdam(struct lpg *lpg)
{ … }
static int lpg_probe(struct platform_device *pdev)
{ … }
static const struct lpg_data pm660l_lpg_data = …;
static const struct lpg_data pm8916_pwm_data = …;
static const struct lpg_data pm8941_lpg_data = …;
static const struct lpg_data pmi8950_pwm_data = …;
static const struct lpg_data pm8994_lpg_data = …;
static const struct lpg_data pmi632_lpg_data = …;
static const struct lpg_data pmi8994_lpg_data = …;
static const struct lpg_data pmi8998_lpg_data = …;
static const struct lpg_data pm8150b_lpg_data = …;
static const struct lpg_data pm8150l_lpg_data = …;
static const struct lpg_data pm8350c_pwm_data = …;
static const struct lpg_data pmk8550_pwm_data = …;
static const struct of_device_id lpg_of_table[] = …;
MODULE_DEVICE_TABLE(of, lpg_of_table);
static struct platform_driver lpg_driver = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;