linux/drivers/leds/leds-lm3692x.c

// SPDX-License-Identifier: GPL-2.0
// TI LM3692x LED chip family driver
// Copyright (C) 2017-18 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/log2.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>

#define LM36922_MODEL
#define LM36923_MODEL

#define LM3692X_REV
#define LM3692X_RESET
#define LM3692X_EN
#define LM3692X_BRT_CTRL
#define LM3692X_PWM_CTRL
#define LM3692X_BOOST_CTRL
#define LM3692X_AUTO_FREQ_HI
#define LM3692X_AUTO_FREQ_LO
#define LM3692X_BL_ADJ_THRESH
#define LM3692X_BRT_LSB
#define LM3692X_BRT_MSB
#define LM3692X_FAULT_CTRL
#define LM3692X_FAULT_FLAGS

#define LM3692X_SW_RESET
#define LM3692X_DEVICE_EN
#define LM3692X_LED1_EN
#define LM3692X_LED2_EN
#define LM36923_LED3_EN
#define LM3692X_ENABLE_MASK

/* Brightness Control Bits */
#define LM3692X_BL_ADJ_POL
#define LM3692X_RAMP_RATE_125us
#define LM3692X_RAMP_RATE_250us
#define LM3692X_RAMP_RATE_500us
#define LM3692X_RAMP_RATE_1ms
#define LM3692X_RAMP_RATE_2ms
#define LM3692X_RAMP_RATE_4ms
#define LM3692X_RAMP_RATE_8ms
#define LM3692X_RAMP_RATE_16ms
#define LM3692X_RAMP_EN
#define LM3692X_BRHT_MODE_REG
#define LM3692X_BRHT_MODE_PWM
#define LM3692X_BRHT_MODE_MULTI_RAMP
#define LM3692X_BRHT_MODE_RAMP_MULTI
#define LM3692X_MAP_MODE_EXP

/* PWM Register Bits */
#define LM3692X_PWM_FILTER_100
#define LM3692X_PWM_FILTER_150
#define LM3692X_PWM_FILTER_200
#define LM3692X_PWM_HYSTER_1LSB
#define LM3692X_PWM_HYSTER_2LSB
#define LM3692X_PWM_HYSTER_3LSB
#define LM3692X_PWM_HYSTER_4LSB
#define LM3692X_PWM_HYSTER_5LSB
#define LM3692X_PWM_HYSTER_6LSB
#define LM3692X_PWM_POLARITY
#define LM3692X_PWM_SAMP_4MHZ
#define LM3692X_PWM_SAMP_24MHZ

/* Boost Control Bits */
#define LM3692X_OCP_PROT_1A
#define LM3692X_OCP_PROT_1_25A
#define LM3692X_OCP_PROT_1_5A
#define LM3692X_OVP_21V
#define LM3692X_OVP_25V
#define LM3692X_OVP_29V
#define LM3692X_MIN_IND_22UH
#define LM3692X_BOOST_SW_1MHZ
#define LM3692X_BOOST_SW_NO_SHIFT

/* Fault Control Bits */
#define LM3692X_FAULT_CTRL_OVP
#define LM3692X_FAULT_CTRL_OCP
#define LM3692X_FAULT_CTRL_TSD
#define LM3692X_FAULT_CTRL_OPEN

/* Fault Flag Bits */
#define LM3692X_FAULT_FLAG_OVP
#define LM3692X_FAULT_FLAG_OCP
#define LM3692X_FAULT_FLAG_TSD
#define LM3692X_FAULT_FLAG_SHRT
#define LM3692X_FAULT_FLAG_OPEN

/**
 * struct lm3692x_led
 * @lock: Lock for reading/writing the device
 * @client: Pointer to the I2C client
 * @led_dev: LED class device pointer
 * @regmap: Devices register map
 * @enable_gpio: VDDIO/EN gpio to enable communication interface
 * @regulator: LED supply regulator pointer
 * @led_enable: LED sync to be enabled
 * @model_id: Current device model ID enumerated
 */
struct lm3692x_led {};

static const struct reg_default lm3692x_reg_defs[] =;

static const struct regmap_config lm3692x_regmap_config =;

static int lm3692x_fault_check(struct lm3692x_led *led)
{}

static int lm3692x_leds_enable(struct lm3692x_led *led)
{}

static int lm3692x_leds_disable(struct lm3692x_led *led)
{}

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

static enum led_brightness lm3692x_max_brightness(struct lm3692x_led *led,
						  u32 max_cur)
{}

static int lm3692x_probe_dt(struct lm3692x_led *led)
{}

static int lm3692x_probe(struct i2c_client *client)
{}

static void lm3692x_remove(struct i2c_client *client)
{}

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

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

static struct i2c_driver lm3692x_driver =;
module_i2c_driver();

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