linux/drivers/leds/leds-is31fl319x.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright 2015-16 Golden Delicious Computers
 *
 * Author: Nikolaus Schaller <[email protected]>
 *
 * LED driver for the IS31FL319{0,1,3,6,9} to drive 1, 3, 6 or 9 light
 * effect LEDs.
 */

#include <linux/err.h>
#include <linux/i2c.h>
#include <linux/leds.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/property.h>
#include <linux/regmap.h>
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/gpio/consumer.h>

/* register numbers */
#define IS31FL319X_SHUTDOWN

/* registers for 3190, 3191 and 3193 */
#define IS31FL3190_BREATHING
#define IS31FL3190_LEDMODE
#define IS31FL3190_CURRENT
#define IS31FL3190_PWM(channel)
#define IS31FL3190_DATA_UPDATE
#define IS31FL3190_T0(channel)
#define IS31FL3190_T1T2(channel)
#define IS31FL3190_T3T4(channel)
#define IS31FL3190_TIME_UPDATE
#define IS31FL3190_LEDCONTROL
#define IS31FL3190_RESET

#define IS31FL3190_CURRENT_uA_MIN
#define IS31FL3190_CURRENT_uA_DEFAULT
#define IS31FL3190_CURRENT_uA_MAX
#define IS31FL3190_CURRENT_SHIFT
#define IS31FL3190_CURRENT_MASK
#define IS31FL3190_CURRENT_5_mA
#define IS31FL3190_CURRENT_10_mA
#define IS31FL3190_CURRENT_17dot5_mA
#define IS31FL3190_CURRENT_30_mA
#define IS31FL3190_CURRENT_42_mA

/* registers for 3196 and 3199 */
#define IS31FL3196_CTRL1
#define IS31FL3196_CTRL2
#define IS31FL3196_CONFIG1
#define IS31FL3196_CONFIG2
#define IS31FL3196_RAMP_MODE
#define IS31FL3196_BREATH_MARK
#define IS31FL3196_PWM(channel)
#define IS31FL3196_DATA_UPDATE
#define IS31FL3196_T0(channel)
#define IS31FL3196_T123_1
#define IS31FL3196_T123_2
#define IS31FL3196_T123_3
#define IS31FL3196_T4(channel)
#define IS31FL3196_TIME_UPDATE
#define IS31FL3196_RESET

#define IS31FL3196_REG_CNT

#define IS31FL319X_MAX_LEDS

/* CS (Current Setting) in CONFIG2 register */
#define IS31FL3196_CONFIG2_CS_SHIFT
#define IS31FL3196_CONFIG2_CS_MASK
#define IS31FL3196_CONFIG2_CS_STEP_REF

#define IS31FL3196_CURRENT_uA_MIN
#define IS31FL3196_CURRENT_uA_MAX
#define IS31FL3196_CURRENT_uA_STEP
#define IS31FL3196_CURRENT_uA_DEFAULT

/* Audio gain in CONFIG2 register */
#define IS31FL3196_AUDIO_GAIN_DB_MAX
#define IS31FL3196_AUDIO_GAIN_DB_STEP

/*
 * regmap is used as a cache of chip's register space,
 * to avoid reading back brightness values from chip,
 * which is known to hang.
 */
struct is31fl319x_chip {};

struct is31fl319x_chipdef {};

static bool is31fl319x_readable_reg(struct device *dev, unsigned int reg)
{}

static bool is31fl3190_volatile_reg(struct device *dev, unsigned int reg)
{}

static const struct reg_default is31fl3190_reg_defaults[] =;

static const struct regmap_config is31fl3190_regmap_config =;

static bool is31fl3196_volatile_reg(struct device *dev, unsigned int reg)
{}

static const struct reg_default is31fl3196_reg_defaults[] =;

static const struct regmap_config is31fl3196_regmap_config =;

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

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

static const struct is31fl319x_chipdef is31fl3190_cdef =;

static const struct is31fl319x_chipdef is31fl3193_cdef =;

static const struct is31fl319x_chipdef is31fl3196_cdef =;

static const struct is31fl319x_chipdef is31fl3199_cdef =;

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

static int is31fl319x_parse_child_fw(const struct device *dev,
				     const struct fwnode_handle *child,
				     struct is31fl319x_led *led,
				     struct is31fl319x_chip *is31)
{}

static int is31fl319x_parse_fw(struct device *dev, struct is31fl319x_chip *is31)
{}

static inline int is31fl3190_microamp_to_cs(struct device *dev, u32 microamp)
{}

static inline int is31fl3196_microamp_to_cs(struct device *dev, u32 microamp)
{}

static inline int is31fl3196_db_to_gain(u32 dezibel)
{}

static void is31f1319x_mutex_destroy(void *lock)
{}

static int is31fl319x_probe(struct i2c_client *client)
{}

/*
 * i2c-core (and modalias) requires that id_table be properly filled,
 * even though it is not used for DeviceTree based instantiation.
 */
static const struct i2c_device_id is31fl319x_id[] =;
MODULE_DEVICE_TABLE(i2c, is31fl319x_id);

static struct i2c_driver is31fl319x_driver =;

module_i2c_driver();

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