linux/drivers/leds/leds-lp50xx.c

// SPDX-License-Identifier: GPL-2.0
// TI LP50XX LED chip family driver
// Copyright (C) 2018-20 Texas Instruments Incorporated - https://www.ti.com/

#include <linux/gpio/consumer.h>
#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/leds.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/regmap.h>
#include <linux/regulator/consumer.h>
#include <linux/slab.h>
#include <uapi/linux/uleds.h>

#include <linux/led-class-multicolor.h>

#include "leds.h"

#define LP50XX_DEV_CFG0
#define LP50XX_DEV_CFG1
#define LP50XX_LED_CFG0

/* LP5009 and LP5012 registers */
#define LP5012_BNK_BRT
#define LP5012_BNKA_CLR
#define LP5012_BNKB_CLR
#define LP5012_BNKC_CLR
#define LP5012_LED0_BRT
#define LP5012_OUT0_CLR
#define LP5012_RESET

/* LP5018 and LP5024 registers */
#define LP5024_BNK_BRT
#define LP5024_BNKA_CLR
#define LP5024_BNKB_CLR
#define LP5024_BNKC_CLR
#define LP5024_LED0_BRT
#define LP5024_OUT0_CLR
#define LP5024_RESET

/* LP5030 and LP5036 registers */
#define LP5036_LED_CFG1
#define LP5036_BNK_BRT
#define LP5036_BNKA_CLR
#define LP5036_BNKB_CLR
#define LP5036_BNKC_CLR
#define LP5036_LED0_BRT
#define LP5036_OUT0_CLR
#define LP5036_RESET

#define LP50XX_SW_RESET
#define LP50XX_CHIP_EN

/* There are 3 LED outputs per bank */
#define LP50XX_LEDS_PER_MODULE

#define LP5009_MAX_LED_MODULES
#define LP5012_MAX_LED_MODULES
#define LP5018_MAX_LED_MODULES
#define LP5024_MAX_LED_MODULES
#define LP5030_MAX_LED_MODULES
#define LP5036_MAX_LED_MODULES

static const struct reg_default lp5012_reg_defs[] =;

static const struct reg_default lp5024_reg_defs[] =;

static const struct reg_default lp5036_reg_defs[] =;

static const struct regmap_config lp5012_regmap_config =;

static const struct regmap_config lp5024_regmap_config =;

static const struct regmap_config lp5036_regmap_config =;

enum lp50xx_model {};

/**
 * struct lp50xx_chip_info -
 * @lp50xx_regmap_config: regmap register configuration
 * @model_id: LED device model
 * @max_modules: total number of supported LED modules
 * @num_leds: number of LED outputs available on the device
 * @led_brightness0_reg: first brightness register of the device
 * @mix_out0_reg: first color mix register of the device
 * @bank_brt_reg: bank brightness register
 * @bank_mix_reg: color mix register
 * @reset_reg: device reset register
 */
struct lp50xx_chip_info {};

static const struct lp50xx_chip_info lp50xx_chip_info_tbl[] =;

struct lp50xx_led {};

/**
 * struct lp50xx -
 * @enable_gpio: hardware enable gpio
 * @regulator: LED supply regulator pointer
 * @client: pointer to the I2C client
 * @regmap: device register map
 * @dev: pointer to the devices device struct
 * @lock: lock for reading/writing the device
 * @chip_info: chip specific information (ie num_leds)
 * @leds: array of LED strings
 */
struct lp50xx {};

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

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

static int lp50xx_set_banks(struct lp50xx *priv, u32 led_banks[])
{}

static int lp50xx_reset(struct lp50xx *priv)
{}

static int lp50xx_enable_disable(struct lp50xx *priv, int enable_disable)
{}

static int lp50xx_probe_leds(struct fwnode_handle *child, struct lp50xx *priv,
			     struct lp50xx_led *led, int num_leds)
{}

static int lp50xx_probe_dt(struct lp50xx *priv)
{}

static int lp50xx_probe(struct i2c_client *client)
{}

static void lp50xx_remove(struct i2c_client *client)
{}

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

static const struct of_device_id of_lp50xx_leds_match[] =;
MODULE_DEVICE_TABLE(of, of_lp50xx_leds_match);

static struct i2c_driver lp50xx_driver =;
module_i2c_driver();

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