linux/drivers/leds/leds-lp5523.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * lp5523.c - LP5523, LP55231 LED Driver
 *
 * Copyright (C) 2010 Nokia Corporation
 * Copyright (C) 2012 Texas Instruments
 *
 * Contact: Samu Onkalo <[email protected]>
 *          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"

/* Memory is used like this:
 * 0x00 engine 1 program
 * 0x10 engine 2 program
 * 0x20 engine 3 program
 * 0x30 engine 1 muxing info
 * 0x40 engine 2 muxing info
 * 0x50 engine 3 muxing info
 */
#define LP5523_PAGES_PER_ENGINE
#define LP5523_MAX_LEDS

/* Registers */
#define LP5523_REG_ENABLE
#define LP5523_REG_OP_MODE
#define LP5523_REG_ENABLE_LEDS_MSB
#define LP5523_REG_ENABLE_LEDS_LSB
#define LP5523_REG_LED_CTRL_BASE
#define LP5523_REG_LED_PWM_BASE
#define LP5523_REG_LED_CURRENT_BASE
#define LP5523_REG_CONFIG

#define LP5523_REG_STATUS
#define LP5523_ENGINE_BUSY

#define LP5523_REG_RESET
#define LP5523_REG_LED_TEST_CTRL
#define LP5523_REG_LED_TEST_ADC
#define LP5523_REG_MASTER_FADER_BASE
#define LP5523_REG_CH1_PROG_START
#define LP5523_REG_CH2_PROG_START
#define LP5523_REG_CH3_PROG_START
#define LP5523_REG_PROG_PAGE_SEL
#define LP5523_REG_PROG_MEM

/* Bit description in registers */
#define LP5523_ENABLE
#define LP5523_AUTO_INC
#define LP5523_PWR_SAVE
#define LP5523_PWM_PWR_SAVE
#define LP5523_CP_MODE_MASK
#define LP5523_CP_MODE_SHIFT
#define LP5523_AUTO_CLK
#define LP5523_DEFAULT_CONFIG

#define LP5523_EN_LEDTEST
#define LP5523_LEDTEST_DONE
#define LP5523_RESET
#define LP5523_ADC_SHORTCIRC_LIM
#define LP5523_EXT_CLK_USED
#define LP5523_ENG_STATUS_MASK

static int lp5523_init_program_engine(struct lp55xx_chip *chip);

static int lp5523_post_init_device(struct lp55xx_chip *chip)
{}

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

static int lp5523_init_program_engine(struct lp55xx_chip *chip)
{}

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

LP55XX_DEV_ATTR_ENGINE_MODE();
LP55XX_DEV_ATTR_ENGINE_MODE();
LP55XX_DEV_ATTR_ENGINE_MODE();
LP55XX_DEV_ATTR_ENGINE_LEDS();
LP55XX_DEV_ATTR_ENGINE_LEDS();
LP55XX_DEV_ATTR_ENGINE_LEDS();
LP55XX_DEV_ATTR_ENGINE_LOAD();
LP55XX_DEV_ATTR_ENGINE_LOAD();
LP55XX_DEV_ATTR_ENGINE_LOAD();
static LP55XX_DEV_ATTR_RO(selftest, lp5523_selftest);
LP55XX_DEV_ATTR_MASTER_FADER();
LP55XX_DEV_ATTR_MASTER_FADER();
LP55XX_DEV_ATTR_MASTER_FADER();
static LP55XX_DEV_ATTR_RW(master_fader_leds, lp55xx_show_master_fader_leds,
			  lp55xx_store_master_fader_leds);

static struct attribute *lp5523_attributes[] =;

static const struct attribute_group lp5523_group =;

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

static const struct i2c_device_id lp5523_id[] =;

MODULE_DEVICE_TABLE(i2c, lp5523_id);

static const struct of_device_id of_lp5523_leds_match[] =;

MODULE_DEVICE_TABLE(of, of_lp5523_leds_match);

static struct i2c_driver lp5523_driver =;

module_i2c_driver();

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