#include <linux/delay.h>
#include <linux/err.h>
#include <linux/i2c.h>
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>
#include <linux/module.h>
#include <linux/regmap.h>
#include <linux/regulator/consumer.h>
#define NOA1305_REG_POWER_CONTROL …
#define NOA1305_POWER_CONTROL_DOWN …
#define NOA1305_POWER_CONTROL_ON …
#define NOA1305_REG_RESET …
#define NOA1305_RESET_RESET …
#define NOA1305_REG_INTEGRATION_TIME …
#define NOA1305_INTEGR_TIME_800MS …
#define NOA1305_INTEGR_TIME_400MS …
#define NOA1305_INTEGR_TIME_200MS …
#define NOA1305_INTEGR_TIME_100MS …
#define NOA1305_INTEGR_TIME_50MS …
#define NOA1305_INTEGR_TIME_25MS …
#define NOA1305_INTEGR_TIME_12_5MS …
#define NOA1305_INTEGR_TIME_6_25MS …
#define NOA1305_INTEGR_TIME_MASK …
#define NOA1305_REG_INT_SELECT …
#define NOA1305_INT_SEL_ACTIVE_HIGH …
#define NOA1305_INT_SEL_ACTIVE_LOW …
#define NOA1305_INT_SEL_INACTIVE …
#define NOA1305_REG_INT_THRESH_LSB …
#define NOA1305_REG_INT_THRESH_MSB …
#define NOA1305_REG_ALS_DATA_LSB …
#define NOA1305_REG_ALS_DATA_MSB …
#define NOA1305_REG_DEVICE_ID_LSB …
#define NOA1305_REG_DEVICE_ID_MSB …
#define NOA1305_DEVICE_ID …
#define NOA1305_DRIVER_NAME …
static int noa1305_scale_available[] = …;
static int noa1305_int_time_available[] = …;
struct noa1305_priv { … };
static int noa1305_measure(struct noa1305_priv *priv, int *val)
{ … }
static int noa1305_scale(struct noa1305_priv *priv, int *val, int *val2)
{ … }
static int noa1305_int_time(struct noa1305_priv *priv, int *val, int *val2)
{ … }
static const struct iio_chan_spec noa1305_channels[] = …;
static int noa1305_read_avail(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
const int **vals, int *type,
int *length, long mask)
{ … }
static int noa1305_read_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int *val, int *val2, long mask)
{ … }
static int noa1305_write_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int val, int val2, long mask)
{ … }
static const struct iio_info noa1305_info = …;
static bool noa1305_writable_reg(struct device *dev, unsigned int reg)
{ … }
static const struct regmap_config noa1305_regmap_config = …;
static int noa1305_probe(struct i2c_client *client)
{ … }
static const struct of_device_id noa1305_of_match[] = …;
MODULE_DEVICE_TABLE(of, noa1305_of_match);
static const struct i2c_device_id noa1305_ids[] = …;
MODULE_DEVICE_TABLE(i2c, noa1305_ids);
static struct i2c_driver noa1305_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;