linux/drivers/leds/leds-lp5562.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * LP5562 LED driver
 *
 * Copyright (C) 2013 Texas Instruments
 *
 * Author: Milo(Woogyom) Kim <[email protected]>
 */

#include <linux/cleanup.h>
#include <linux/delay.h>
#include <linux/firmware.h>
#include <linux/i2c.h>
#include <linux/leds.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/of.h>
#include <linux/platform_data/leds-lp55xx.h>
#include <linux/slab.h>

#include "leds-lp55xx-common.h"

#define LP5562_MAX_LEDS

/* ENABLE Register 00h */
#define LP5562_REG_ENABLE
#define LP5562_EXEC_ENG1_M
#define LP5562_EXEC_ENG2_M
#define LP5562_EXEC_ENG3_M
#define LP5562_EXEC_M
#define LP5562_MASTER_ENABLE
#define LP5562_LOGARITHMIC_PWM
#define LP5562_EXEC_RUN
#define LP5562_ENABLE_DEFAULT
#define LP5562_ENABLE_RUN_PROGRAM

/* OPMODE Register 01h */
#define LP5562_REG_OP_MODE

/* BRIGHTNESS Registers */
#define LP5562_REG_R_PWM
#define LP5562_REG_G_PWM
#define LP5562_REG_B_PWM
#define LP5562_REG_W_PWM

/* CURRENT Registers */
#define LP5562_REG_R_CURRENT
#define LP5562_REG_G_CURRENT
#define LP5562_REG_B_CURRENT
#define LP5562_REG_W_CURRENT

/* CONFIG Register 08h */
#define LP5562_REG_CONFIG
#define LP5562_PWM_HF
#define LP5562_PWRSAVE_EN
#define LP5562_CLK_INT
#define LP5562_DEFAULT_CFG

/* RESET Register 0Dh */
#define LP5562_REG_RESET
#define LP5562_RESET

/* PROGRAM ENGINE Registers */
#define LP5562_REG_PROG_MEM_ENG1
#define LP5562_REG_PROG_MEM_ENG2
#define LP5562_REG_PROG_MEM_ENG3

/* LEDMAP Register 70h */
#define LP5562_REG_ENG_SEL
#define LP5562_ENG_SEL_PWM
#define LP5562_ENG_FOR_RGB_M
#define LP5562_ENG_SEL_RGB
#define LP5562_ENG_FOR_W_M
#define LP5562_ENG1_FOR_W
#define LP5562_ENG2_FOR_W
#define LP5562_ENG3_FOR_W

/* Program Commands */
#define LP5562_CMD_DISABLE
#define LP5562_CMD_LOAD
#define LP5562_CMD_RUN
#define LP5562_CMD_DIRECT
#define LP5562_PATTERN_OFF

static inline void lp5562_wait_opmode_done(void)
{}

static inline void lp5562_wait_enable_done(void)
{}

static void lp5562_set_led_current(struct lp55xx_led *led, u8 led_current)
{}

static void lp5562_run_engine(struct lp55xx_chip *chip, bool start)
{}

static int lp5562_post_init_device(struct lp55xx_chip *chip)
{}

static int lp5562_led_brightness(struct lp55xx_led *led)
{}

static void lp5562_write_program_memory(struct lp55xx_chip *chip,
					u8 base, const u8 *rgb, int size)
{}

/* check the size of program count */
static inline bool _is_pc_overflow(struct lp55xx_predef_pattern *ptn)
{}

static int lp5562_run_predef_led_pattern(struct lp55xx_chip *chip, int mode)
{}

static ssize_t lp5562_store_pattern(struct device *dev,
				struct device_attribute *attr,
				const char *buf, size_t len)
{}

static ssize_t lp5562_store_engine_mux(struct device *dev,
				     struct device_attribute *attr,
				     const char *buf, size_t len)
{}

static LP55XX_DEV_ATTR_WO(led_pattern, lp5562_store_pattern);
static LP55XX_DEV_ATTR_WO(engine_mux, lp5562_store_engine_mux);

static struct attribute *lp5562_attributes[] =;

static const struct attribute_group lp5562_group =;

/* Chip specific configurations */
static struct lp55xx_device_config lp5562_cfg =;

static const struct i2c_device_id lp5562_id[] =;
MODULE_DEVICE_TABLE(i2c, lp5562_id);

static const struct of_device_id of_lp5562_leds_match[] =;

MODULE_DEVICE_TABLE(of, of_lp5562_leds_match);

static struct i2c_driver lp5562_driver =;

module_i2c_driver();

MODULE_DESCRIPTION();
MODULE_AUTHOR();
MODULE_LICENSE();