linux/drivers/leds/leds-lp55xx-common.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * LP5521/LP5523/LP55231/LP5562 Common Driver
 *
 * Copyright 2012 Texas Instruments
 *
 * Author: Milo(Woogyom) Kim <[email protected]>
 *
 * Derived from leds-lp5521.c, leds-lp5523.c
 */

#include <linux/bitfield.h>
#include <linux/cleanup.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/firmware.h>
#include <linux/i2c.h>
#include <linux/iopoll.h>
#include <linux/leds.h>
#include <linux/module.h>
#include <linux/platform_data/leds-lp55xx.h>
#include <linux/slab.h>
#include <linux/gpio/consumer.h>
#include <dt-bindings/leds/leds-lp55xx.h>

#include "leds-lp55xx-common.h"

/* OP MODE require at least 153 us to clear regs */
#define LP55XX_CMD_SLEEP

#define LP55xx_PROGRAM_PAGES
#define LP55xx_MAX_PROGRAM_LENGTH

/*
 * Program Memory Operations
 * Same Mask for each engine for both mode and exec
 * ENG1        GENMASK(3, 2)
 * ENG2        GENMASK(5, 4)
 * ENG3        GENMASK(7, 6)
 */
#define LP55xx_MODE_DISABLE_ALL_ENG
#define LP55xx_MODE_ENG_MASK
#define LP55xx_MODE_DISABLE_ENG
#define LP55xx_MODE_LOAD_ENG
#define LP55xx_MODE_RUN_ENG
#define LP55xx_MODE_HALT_ENG

#define LP55xx_MODE_ENGn_SHIFT(n, shift)
#define LP55xx_MODE_ENGn_MASK(n, shift)
#define LP55xx_MODE_ENGn_GET(n, mode, shift)

#define LP55xx_EXEC_ENG_MASK
#define LP55xx_EXEC_HOLD_ENG
#define LP55xx_EXEC_STEP_ENG
#define LP55xx_EXEC_RUN_ENG
#define LP55xx_EXEC_ONCE_ENG

#define LP55xx_EXEC_ENGn_SHIFT(n, shift)
#define LP55xx_EXEC_ENGn_MASK(n, shift)

/* Memory Page Selection */
#define LP55xx_REG_PROG_PAGE_SEL
/* If supported, each ENGINE have an equal amount of pages offset from page 0 */
#define LP55xx_PAGE_OFFSET(n, pages)

#define LED_ACTIVE(mux, led)

/* MASTER FADER common property */
#define LP55xx_FADER_MAPPING_MASK

/* External clock rate */
#define LP55XX_CLK_32K

static struct lp55xx_led *cdev_to_lp55xx_led(struct led_classdev *cdev)
{}

static struct lp55xx_led *dev_to_lp55xx_led(struct device *dev)
{}

static struct lp55xx_led *mcled_cdev_to_led(struct led_classdev_mc *mc_cdev)
{}

static void lp55xx_wait_opmode_done(struct lp55xx_chip *chip)
{}

void lp55xx_stop_all_engine(struct lp55xx_chip *chip)
{}
EXPORT_SYMBOL_GPL();

void lp55xx_load_engine(struct lp55xx_chip *chip)
{}
EXPORT_SYMBOL_GPL();

int lp55xx_run_engine_common(struct lp55xx_chip *chip)
{}
EXPORT_SYMBOL_GPL();

int lp55xx_update_program_memory(struct lp55xx_chip *chip,
				 const u8 *data, size_t size)
{}
EXPORT_SYMBOL_GPL();

void lp55xx_firmware_loaded_cb(struct lp55xx_chip *chip)
{}
EXPORT_SYMBOL_GPL();

int lp55xx_led_brightness(struct lp55xx_led *led)
{}
EXPORT_SYMBOL_GPL();

int lp55xx_multicolor_brightness(struct lp55xx_led *led)
{}
EXPORT_SYMBOL_GPL();

void lp55xx_set_led_current(struct lp55xx_led *led, u8 led_current)
{}
EXPORT_SYMBOL_GPL();

void lp55xx_turn_off_channels(struct lp55xx_chip *chip)
{}
EXPORT_SYMBOL_GPL();

void lp55xx_stop_engine(struct lp55xx_chip *chip)
{}
EXPORT_SYMBOL_GPL();

static void lp55xx_reset_device(struct lp55xx_chip *chip)
{}

static int lp55xx_detect_device(struct lp55xx_chip *chip)
{}

static int lp55xx_post_init_device(struct lp55xx_chip *chip)
{}

static ssize_t led_current_show(struct device *dev,
			    struct device_attribute *attr,
			    char *buf)
{}

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

static ssize_t max_current_show(struct device *dev,
			    struct device_attribute *attr,
			    char *buf)
{}

static DEVICE_ATTR_RW(led_current);
static DEVICE_ATTR_RO(max_current);

static struct attribute *lp55xx_led_attrs[] =;
ATTRIBUTE_GROUPS();

static int lp55xx_set_mc_brightness(struct led_classdev *cdev,
				    enum led_brightness brightness)
{}

static int lp55xx_set_brightness(struct led_classdev *cdev,
			     enum led_brightness brightness)
{}

static int lp55xx_init_led(struct lp55xx_led *led,
			struct lp55xx_chip *chip, int chan)
{}

static void lp55xx_firmware_loaded(const struct firmware *fw, void *context)
{}

static int lp55xx_request_firmware(struct lp55xx_chip *chip)
{}

static ssize_t select_engine_show(struct device *dev,
				  struct device_attribute *attr,
				  char *buf)
{}

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

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

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

static DEVICE_ATTR_RW(select_engine);
static DEVICE_ATTR_WO(run_engine);

ssize_t lp55xx_show_engine_mode(struct device *dev,
				struct device_attribute *attr,
				char *buf, int nr)
{}
EXPORT_SYMBOL_GPL();

ssize_t lp55xx_store_engine_mode(struct device *dev,
				 struct device_attribute *attr,
				 const char *buf, size_t len, int nr)
{}
EXPORT_SYMBOL_GPL();

ssize_t lp55xx_store_engine_load(struct device *dev,
				 struct device_attribute *attr,
				 const char *buf, size_t len, int nr)
{}
EXPORT_SYMBOL_GPL();

static int lp55xx_mux_parse(struct lp55xx_chip *chip, const char *buf,
			    u16 *mux, size_t len)
{}

ssize_t lp55xx_show_engine_leds(struct device *dev,
				struct device_attribute *attr,
				char *buf, int nr)
{}
EXPORT_SYMBOL_GPL();

static int lp55xx_load_mux(struct lp55xx_chip *chip, u16 mux, int nr)
{}

ssize_t lp55xx_store_engine_leds(struct device *dev,
				 struct device_attribute *attr,
				 const char *buf, size_t len, int nr)
{}
EXPORT_SYMBOL_GPL();

ssize_t lp55xx_show_master_fader(struct device *dev,
				 struct device_attribute *attr,
				 char *buf, int nr)
{}
EXPORT_SYMBOL_GPL();

ssize_t lp55xx_store_master_fader(struct device *dev,
				  struct device_attribute *attr,
				  const char *buf, size_t len, int nr)
{}
EXPORT_SYMBOL_GPL();

ssize_t lp55xx_show_master_fader_leds(struct device *dev,
				      struct device_attribute *attr,
				      char *buf)
{}
EXPORT_SYMBOL_GPL();

ssize_t lp55xx_store_master_fader_leds(struct device *dev,
				       struct device_attribute *attr,
				       const char *buf, size_t len)
{}
EXPORT_SYMBOL_GPL();

static struct attribute *lp55xx_engine_attributes[] =;

static const struct attribute_group lp55xx_engine_attr_group =;

int lp55xx_write(struct lp55xx_chip *chip, u8 reg, u8 val)
{}
EXPORT_SYMBOL_GPL();

int lp55xx_read(struct lp55xx_chip *chip, u8 reg, u8 *val)
{}
EXPORT_SYMBOL_GPL();

int lp55xx_update_bits(struct lp55xx_chip *chip, u8 reg, u8 mask, u8 val)
{}
EXPORT_SYMBOL_GPL();

bool lp55xx_is_extclk_used(struct lp55xx_chip *chip)
{}
EXPORT_SYMBOL_GPL();

static void lp55xx_deinit_device(struct lp55xx_chip *chip)
{}

static int lp55xx_init_device(struct lp55xx_chip *chip)
{}

static int lp55xx_register_leds(struct lp55xx_led *led, struct lp55xx_chip *chip)
{}

static int lp55xx_register_sysfs(struct lp55xx_chip *chip)
{}

static void lp55xx_unregister_sysfs(struct lp55xx_chip *chip)
{}

static int lp55xx_parse_common_child(struct device_node *np,
				     struct lp55xx_led_config *cfg,
				     int led_number, int *chan_nr)
{}

static int lp55xx_parse_multi_led_child(struct device_node *child,
					 struct lp55xx_led_config *cfg,
					 int child_number, int color_number)
{}

static int lp55xx_parse_multi_led(struct device_node *np,
				  struct lp55xx_led_config *cfg,
				  int child_number)
{}

static int lp55xx_parse_logical_led(struct device_node *np,
				   struct lp55xx_led_config *cfg,
				   int child_number)
{}

static struct lp55xx_platform_data *lp55xx_of_populate_pdata(struct device *dev,
							     struct device_node *np,
							     struct lp55xx_chip *chip)
{}

int lp55xx_probe(struct i2c_client *client)
{}
EXPORT_SYMBOL_GPL();

void lp55xx_remove(struct i2c_client *client)
{}
EXPORT_SYMBOL_GPL();

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