linux/drivers/video/backlight/mp3309c.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Driver for MPS MP3309C White LED driver with I2C interface
 *
 * This driver support both analog (by I2C commands) and PWM dimming control
 * modes.
 *
 * Copyright (C) 2023 ASEM Srl
 * Author: Flavio Suligoi <[email protected]>
 *
 * Based on pwm_bl.c
 */

#include <linux/backlight.h>
#include <linux/delay.h>
#include <linux/gpio/consumer.h>
#include <linux/i2c.h>
#include <linux/mod_devicetable.h>
#include <linux/property.h>
#include <linux/pwm.h>
#include <linux/regmap.h>

#define REG_I2C_0
#define REG_I2C_1

#define REG_I2C_0_EN
#define REG_I2C_0_D0
#define REG_I2C_0_D1
#define REG_I2C_0_D2
#define REG_I2C_0_D3
#define REG_I2C_0_D4
#define REG_I2C_0_RSRV1
#define REG_I2C_0_RSRV2

#define REG_I2C_1_RSRV1
#define REG_I2C_1_DIMS
#define REG_I2C_1_SYNC
#define REG_I2C_1_OVP0
#define REG_I2C_1_OVP1
#define REG_I2C_1_VOS
#define REG_I2C_1_LEDO
#define REG_I2C_1_OTP

#define ANALOG_I2C_NUM_LEVELS
#define ANALOG_I2C_REG_MASK

#define MP3309C_PWM_DEFAULT_NUM_LEVELS

enum mp3309c_status_value {};

enum mp3309c_dimming_mode_value {};

struct mp3309c_platform_data {};

struct mp3309c_chip {};

static const struct regmap_config mp3309c_regmap =;

static int mp3309c_enable_device(struct mp3309c_chip *chip)
{}

static int mp3309c_bl_update_status(struct backlight_device *bl)
{}

static const struct backlight_ops mp3309c_bl_ops =;

static int mp3309c_parse_fwnode(struct mp3309c_chip *chip,
				struct mp3309c_platform_data *pdata)
{}

static int mp3309c_probe(struct i2c_client *client)
{}

static void mp3309c_remove(struct i2c_client *client)
{}

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

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

static struct i2c_driver mp3309c_i2c_driver =;

module_i2c_driver();

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