linux/drivers/leds/leds-lm3697.c

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

#include <linux/bits.h>
#include <linux/gpio/consumer.h>
#include <linux/i2c.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/property.h>
#include <linux/regmap.h>
#include <linux/regulator/consumer.h>
#include <linux/types.h>

#include <linux/leds-ti-lmu-common.h>

#define LM3697_REV
#define LM3697_RESET
#define LM3697_OUTPUT_CONFIG
#define LM3697_CTRL_A_RAMP
#define LM3697_CTRL_B_RAMP
#define LM3697_CTRL_A_B_RT_RAMP
#define LM3697_CTRL_A_B_RAMP_CFG
#define LM3697_CTRL_A_B_BRT_CFG
#define LM3697_CTRL_A_FS_CURR_CFG
#define LM3697_CTRL_B_FS_CURR_CFG
#define LM3697_PWM_CFG
#define LM3697_CTRL_A_BRT_LSB
#define LM3697_CTRL_A_BRT_MSB
#define LM3697_CTRL_B_BRT_LSB
#define LM3697_CTRL_B_BRT_MSB
#define LM3697_CTRL_ENABLE

#define LM3697_SW_RESET

#define LM3697_CTRL_A_EN
#define LM3697_CTRL_B_EN
#define LM3697_CTRL_A_B_EN

#define LM3697_MAX_LED_STRINGS

#define LM3697_CONTROL_A
#define LM3697_CONTROL_B
#define LM3697_MAX_CONTROL_BANKS

/**
 * struct lm3697_led -
 * @hvled_strings: Array of LED strings associated with a control bank
 * @label: LED label
 * @led_dev: LED class device
 * @priv: Pointer to the device struct
 * @lmu_data: Register and setting values for common code
 * @control_bank: Control bank the LED is associated to. 0 is control bank A
 *		   1 is control bank B
 * @enabled: LED brightness level (or LED_OFF)
 * @num_leds: Number of LEDs available
 */
struct lm3697_led {};

/**
 * struct lm3697 -
 * @enable_gpio: Hardware enable gpio
 * @regulator: LED supply regulator pointer
 * @client: Pointer to the I2C client
 * @regmap: Devices register map
 * @dev: Pointer to the devices device struct
 * @lock: Lock for reading/writing the device
 * @leds: Array of LED strings
 * @bank_cfg: OUTPUT_CONFIG register values
 * @num_banks: Number of control banks
 */
struct lm3697 {};

static const struct reg_default lm3697_reg_defs[] =;

static const struct regmap_config lm3697_regmap_config =;

static int lm3697_brightness_set(struct led_classdev *led_cdev,
				enum led_brightness brt_val)
{}

static int lm3697_init(struct lm3697 *priv)
{}

static int lm3697_probe_dt(struct lm3697 *priv)
{}

static int lm3697_probe(struct i2c_client *client)
{}

static void lm3697_remove(struct i2c_client *client)
{}

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

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

static struct i2c_driver lm3697_driver =;
module_i2c_driver();

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