#include <linux/bitfield.h>
#include <linux/bitops.h>
#include <linux/kernel.h>
#include <linux/leds.h>
#include <linux/led-class-multicolor.h>
#include <linux/linear_range.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/platform_device.h>
#include <linux/property.h>
#include <linux/regmap.h>
#include <linux/util_macros.h>
#include <linux/unaligned.h>
enum { … };
enum mt6370_led_mode { … };
enum mt6370_led_field { … };
enum mt6370_led_ranges { … };
enum mt6370_pattern { … };
#define MT6370_REG_DEV_INFO …
#define MT6370_REG_RGB1_DIM …
#define MT6370_REG_RGB2_DIM …
#define MT6370_REG_RGB3_DIM …
#define MT6370_REG_RGB_EN …
#define MT6370_REG_RGB1_ISNK …
#define MT6370_REG_RGB2_ISNK …
#define MT6370_REG_RGB3_ISNK …
#define MT6370_REG_RGB1_TR …
#define MT6370_REG_RGB_CHRIND_DIM …
#define MT6370_REG_RGB_CHRIND_CTRL …
#define MT6370_REG_RGB_CHRIND_TR …
#define MT6372_REG_RGB_EN …
#define MT6372_REG_RGB1_ISNK …
#define MT6372_REG_RGB2_ISNK …
#define MT6372_REG_RGB3_ISNK …
#define MT6372_REG_RGB4_ISNK …
#define MT6372_REG_RGB1_DIM …
#define MT6372_REG_RGB2_DIM …
#define MT6372_REG_RGB3_DIM …
#define MT6372_REG_RGB4_DIM …
#define MT6372_REG_RGB12_FREQ …
#define MT6372_REG_RGB34_FREQ …
#define MT6372_REG_RGB1_TR …
#define MT6370_VENDOR_ID_MASK …
#define MT6372_VENDOR_ID …
#define MT6372C_VENDOR_ID …
#define MT6370_CHEN_BIT(id) …
#define MT6370_VIRTUAL_MULTICOLOR …
#define MC_CHANNEL_NUM …
#define MT6370_PWM_DUTY …
#define MT6372_PWM_DUTY …
struct mt6370_led { … };
struct mt6370_pdata { … };
struct mt6370_priv { … };
static const struct reg_field common_reg_fields[F_MAX_FIELDS] = …;
static const struct reg_field mt6372_reg_fields[F_MAX_FIELDS] = …;
static const struct linear_range common_led_ranges[R_MAX_RANGES] = …;
static const struct linear_range mt6372_led_ranges[R_MAX_RANGES] = …;
static const unsigned int common_tfreqs[] = …;
static const unsigned int mt6372_tfreqs[] = …;
static const struct mt6370_pdata common_pdata = …;
static const struct mt6370_pdata mt6372_pdata = …;
static enum mt6370_led_field mt6370_get_led_current_field(unsigned int led_no)
{ … }
static int mt6370_set_led_brightness(struct mt6370_priv *priv, unsigned int led_no,
unsigned int level)
{ … }
static int mt6370_get_led_brightness(struct mt6370_priv *priv, unsigned int led_no,
unsigned int *level)
{ … }
static int mt6370_set_led_duty(struct mt6370_priv *priv, unsigned int led_no, unsigned int ton,
unsigned int toff)
{ … }
static int mt6370_set_led_freq(struct mt6370_priv *priv, unsigned int led_no, unsigned int ton,
unsigned int toff)
{ … }
static void mt6370_get_breath_reg_base(struct mt6370_priv *priv, unsigned int led_no,
unsigned int *base)
{ … }
static int mt6370_gen_breath_pattern(struct mt6370_priv *priv, struct led_pattern *pattern, u32 len,
u8 *pattern_val, u32 val_len)
{ … }
static int mt6370_set_led_mode(struct mt6370_priv *priv, unsigned int led_no,
enum mt6370_led_mode mode)
{ … }
static int mt6370_mc_brightness_set(struct led_classdev *lcdev, enum led_brightness level)
{ … }
static int mt6370_mc_blink_set(struct led_classdev *lcdev,
unsigned long *delay_on,
unsigned long *delay_off)
{ … }
static int mt6370_mc_pattern_set(struct led_classdev *lcdev, struct led_pattern *pattern, u32 len,
int repeat)
{ … }
static inline int mt6370_mc_pattern_clear(struct led_classdev *lcdev)
{ … }
static int mt6370_isnk_brightness_set(struct led_classdev *lcdev,
enum led_brightness level)
{ … }
static int mt6370_isnk_blink_set(struct led_classdev *lcdev, unsigned long *delay_on,
unsigned long *delay_off)
{ … }
static int mt6370_isnk_pattern_set(struct led_classdev *lcdev, struct led_pattern *pattern, u32 len,
int repeat)
{ … }
static inline int mt6370_isnk_pattern_clear(struct led_classdev *lcdev)
{ … }
static int mt6370_assign_multicolor_info(struct device *dev, struct mt6370_led *led,
struct fwnode_handle *fwnode)
{ … }
static int mt6370_init_led_properties(struct device *dev, struct mt6370_led *led,
struct led_init_data *init_data)
{ … }
static int mt6370_isnk_init_default_state(struct mt6370_led *led)
{ … }
static int mt6370_multicolor_led_register(struct device *dev, struct mt6370_led *led,
struct led_init_data *init_data)
{ … }
static int mt6370_led_register(struct device *dev, struct mt6370_led *led,
struct led_init_data *init_data)
{ … }
static int mt6370_check_vendor_info(struct mt6370_priv *priv)
{ … }
static int mt6370_leds_probe(struct platform_device *pdev)
{ … }
static const struct of_device_id mt6370_rgbled_device_table[] = …;
MODULE_DEVICE_TABLE(of, mt6370_rgbled_device_table);
static struct platform_driver mt6370_rgbled_driver = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;