#include <linux/bitfield.h>
#include <linux/i2c.h>
#include <linux/iio/iio.h>
#include <linux/math64.h>
#include <linux/module.h>
#include <linux/property.h>
#include <linux/regmap.h>
#include <linux/regulator/consumer.h>
#define OPT4001_LIGHT1_MSB …
#define OPT4001_LIGHT1_LSB …
#define OPT4001_CTRL …
#define OPT4001_DEVICE_ID …
#define OPT4001_EXPONENT_MASK …
#define OPT4001_MSB_MASK …
#define OPT4001_LSB_MASK …
#define OPT4001_COUNTER_MASK …
#define OPT4001_CRC_MASK …
#define OPT4001_DEVICE_ID_MASK …
#define OPT4001_CTRL_QWAKE_MASK …
#define OPT4001_CTRL_RANGE_MASK …
#define OPT4001_CTRL_CONV_TIME_MASK …
#define OPT4001_CTRL_OPER_MODE_MASK …
#define OPT4001_CTRL_LATCH_MASK …
#define OPT4001_CTRL_INT_POL_MASK …
#define OPT4001_CTRL_FAULT_COUNT …
#define OPT4001_DEVICE_ID_VAL …
#define OPT4001_CTRL_OPER_MODE_OFF …
#define OPT4001_CTRL_OPER_MODE_FORCED …
#define OPT4001_CTRL_OPER_MODE_ONE_SHOT …
#define OPT4001_CTRL_OPER_MODE_CONTINUOUS …
#define OPT4001_CTRL_CONVERSION_0_6MS …
#define OPT4001_CTRL_CONVERSION_1MS …
#define OPT4001_CTRL_CONVERSION_1_8MS …
#define OPT4001_CTRL_CONVERSION_3_4MS …
#define OPT4001_CTRL_CONVERSION_6_5MS …
#define OPT4001_CTRL_CONVERSION_12_7MS …
#define OPT4001_CTRL_CONVERSION_25MS …
#define OPT4001_CTRL_CONVERSION_50MS …
#define OPT4001_CTRL_CONVERSION_100MS …
#define OPT4001_CTRL_CONVERSION_200MS …
#define OPT4001_CTRL_CONVERSION_400MS …
#define OPT4001_CTRL_CONVERSION_800MS …
#define OPT4001_CTRL_LIGHT_SCALE_AUTO …
#define OPT4001_DEFAULT_CONVERSION_TIME …
struct opt4001_chip_info { … };
struct opt4001_chip { … };
static const struct opt4001_chip_info opt4001_sot_5x3_info = …;
static const struct opt4001_chip_info opt4001_picostar_info = …;
static const int opt4001_int_time_available[][2] = …;
static const int opt4001_int_time_reg[][2] = …;
static int opt4001_als_time_to_index(const u32 als_integration_time)
{ … }
static u8 opt4001_calculate_crc(u8 exp, u32 mantissa, u8 count)
{ … }
static int opt4001_read_lux_value(struct iio_dev *indio_dev,
int *val, int *val2)
{ … }
static int opt4001_set_conf(struct opt4001_chip *chip)
{ … }
static int opt4001_power_down(struct opt4001_chip *chip)
{ … }
static void opt4001_chip_off_action(void *data)
{ … }
static const struct iio_chan_spec opt4001_channels[] = …;
static int opt4001_read_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int *val, int *val2, long mask)
{ … }
static int opt4001_write_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int val, int val2, long mask)
{ … }
static int opt4001_read_available(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
const int **vals, int *type, int *length,
long mask)
{ … }
static const struct iio_info opt4001_info_no_irq = …;
static int opt4001_load_defaults(struct opt4001_chip *chip)
{ … }
static bool opt4001_readable_reg(struct device *dev, unsigned int reg)
{ … }
static bool opt4001_writable_reg(struct device *dev, unsigned int reg)
{ … }
static bool opt4001_volatile_reg(struct device *dev, unsigned int reg)
{ … }
static const struct regmap_config opt4001_regmap_config = …;
static int opt4001_probe(struct i2c_client *client)
{ … }
static const struct i2c_device_id opt4001_id[] = …;
MODULE_DEVICE_TABLE(i2c, opt4001_id);
static const struct of_device_id opt4001_of_match[] = …;
MODULE_DEVICE_TABLE(of, opt4001_of_match);
static struct i2c_driver opt4001_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;