#include <linux/module.h>
#include <linux/i2c.h>
#include <linux/err.h>
#include <linux/mutex.h>
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/regmap.h>
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>
#include <linux/pm_runtime.h>
#define ISL29028_CONV_TIME_MS …
#define ISL29028_REG_CONFIGURE …
#define ISL29028_CONF_ALS_IR_MODE_ALS …
#define ISL29028_CONF_ALS_IR_MODE_IR …
#define ISL29028_CONF_ALS_IR_MODE_MASK …
#define ISL29028_CONF_ALS_RANGE_LOW_LUX …
#define ISL29028_CONF_ALS_RANGE_HIGH_LUX …
#define ISL29028_CONF_ALS_RANGE_MASK …
#define ISL29028_CONF_ALS_DIS …
#define ISL29028_CONF_ALS_EN …
#define ISL29028_CONF_ALS_EN_MASK …
#define ISL29028_CONF_PROX_SLP_SH …
#define ISL29028_CONF_PROX_SLP_MASK …
#define ISL29028_CONF_PROX_EN …
#define ISL29028_CONF_PROX_EN_MASK …
#define ISL29028_REG_INTERRUPT …
#define ISL29028_REG_PROX_DATA …
#define ISL29028_REG_ALSIR_L …
#define ISL29028_REG_ALSIR_U …
#define ISL29028_REG_TEST1_MODE …
#define ISL29028_REG_TEST2_MODE …
#define ISL29028_NUM_REGS …
#define ISL29028_POWER_OFF_DELAY_MS …
struct isl29028_prox_data { … };
static const struct isl29028_prox_data isl29028_prox_data[] = …;
enum isl29028_als_ir_mode { … };
struct isl29028_chip { … };
static int isl29028_find_prox_sleep_index(int sampling_int, int sampling_fract)
{ … }
static int isl29028_set_proxim_sampling(struct isl29028_chip *chip,
int sampling_int, int sampling_fract)
{ … }
static int isl29028_enable_proximity(struct isl29028_chip *chip)
{ … }
static int isl29028_set_als_scale(struct isl29028_chip *chip, int lux_scale)
{ … }
static int isl29028_set_als_ir_mode(struct isl29028_chip *chip,
enum isl29028_als_ir_mode mode)
{ … }
static int isl29028_read_als_ir(struct isl29028_chip *chip, int *als_ir)
{ … }
static int isl29028_read_proxim(struct isl29028_chip *chip, int *prox)
{ … }
static int isl29028_als_get(struct isl29028_chip *chip, int *als_data)
{ … }
static int isl29028_ir_get(struct isl29028_chip *chip, int *ir_data)
{ … }
static int isl29028_set_pm_runtime_busy(struct isl29028_chip *chip, bool on)
{ … }
static int isl29028_write_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int val, int val2, long mask)
{ … }
static int isl29028_read_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int *val, int *val2, long mask)
{ … }
static IIO_CONST_ATTR(in_proximity_sampling_frequency_available,
"1.25 2.5 5 10 13.3 20 80 100");
static IIO_CONST_ATTR(in_illuminance_scale_available, "125 2000");
#define ISL29028_CONST_ATTR(name) …
static struct attribute *isl29028_attributes[] = …;
static const struct attribute_group isl29108_group = …;
static const struct iio_chan_spec isl29028_channels[] = …;
static const struct iio_info isl29028_info = …;
static int isl29028_clear_configure_reg(struct isl29028_chip *chip)
{ … }
static bool isl29028_is_volatile_reg(struct device *dev, unsigned int reg)
{ … }
static const struct regmap_config isl29028_regmap_config = …;
static int isl29028_probe(struct i2c_client *client)
{ … }
static void isl29028_remove(struct i2c_client *client)
{ … }
static int isl29028_suspend(struct device *dev)
{ … }
static int isl29028_resume(struct device *dev)
{ … }
static DEFINE_RUNTIME_DEV_PM_OPS(isl29028_pm_ops, isl29028_suspend,
isl29028_resume, NULL);
static const struct i2c_device_id isl29028_id[] = …;
MODULE_DEVICE_TABLE(i2c, isl29028_id);
static const struct of_device_id isl29028_of_match[] = …;
MODULE_DEVICE_TABLE(of, isl29028_of_match);
static struct i2c_driver isl29028_driver = …;
module_i2c_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;