#include <linux/bits.h>
#include <linux/delay.h>
#include <linux/err.h>
#include <linux/i2c.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/math.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/pm.h>
#include <linux/property.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/iio/events.h>
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>
#define ADC_FRAC_BITS …
#define FRAC10K(f) …
#define CALIB_FRAC_BITS …
#define CALIB_BASE_SYSFS …
#define TSL2563_CMD …
#define TSL2563_CLEARINT …
#define TSL2563_REG_CTRL …
#define TSL2563_REG_TIMING …
#define TSL2563_REG_LOW …
#define TSL2563_REG_HIGH …
#define TSL2563_REG_INT …
#define TSL2563_REG_ID …
#define TSL2563_REG_DATA0 …
#define TSL2563_REG_DATA1 …
#define TSL2563_CMD_POWER_ON …
#define TSL2563_CMD_POWER_OFF …
#define TSL2563_CTRL_POWER_MASK …
#define TSL2563_TIMING_13MS …
#define TSL2563_TIMING_100MS …
#define TSL2563_TIMING_400MS …
#define TSL2563_TIMING_MASK …
#define TSL2563_TIMING_GAIN16 …
#define TSL2563_TIMING_GAIN1 …
#define TSL2563_INT_DISABLED …
#define TSL2563_INT_LEVEL …
#define TSL2563_INT_MASK …
#define TSL2563_INT_PERSIST(n) …
struct tsl2563_gainlevel_coeff { … };
static const struct tsl2563_gainlevel_coeff tsl2563_gainlevel_table[] = …;
struct tsl2563_chip { … };
static int tsl2563_set_power(struct tsl2563_chip *chip, int on)
{ … }
static int tsl2563_get_power(struct tsl2563_chip *chip)
{ … }
static int tsl2563_configure(struct tsl2563_chip *chip)
{ … }
static void tsl2563_poweroff_work(struct work_struct *work)
{ … }
static int tsl2563_detect(struct tsl2563_chip *chip)
{ … }
static int tsl2563_read_id(struct tsl2563_chip *chip, u8 *id)
{ … }
static int tsl2563_configure_irq(struct tsl2563_chip *chip, bool enable)
{ … }
static int tsl2563_adc_shiftbits(u8 timing)
{ … }
static u32 tsl2563_normalize_adc(u16 adc, u8 timing)
{ … }
static void tsl2563_wait_adc(struct tsl2563_chip *chip)
{ … }
static int tsl2563_adjust_gainlevel(struct tsl2563_chip *chip, u16 adc)
{ … }
static int tsl2563_get_adc(struct tsl2563_chip *chip)
{ … }
static inline int tsl2563_calib_to_sysfs(u32 calib)
{ … }
static inline u32 tsl2563_calib_from_sysfs(int value)
{ … }
struct tsl2563_lux_coeff { … };
static const struct tsl2563_lux_coeff lux_table[] = …;
static unsigned int tsl2563_adc_to_lux(u32 adc0, u32 adc1)
{ … }
static u32 tsl2563_calib_adc(u32 adc, u32 calib)
{ … }
static int tsl2563_write_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int val,
int val2,
long mask)
{ … }
static int tsl2563_read_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int *val,
int *val2,
long mask)
{ … }
static const struct iio_event_spec tsl2563_events[] = …;
static const struct iio_chan_spec tsl2563_channels[] = …;
static int tsl2563_read_thresh(struct iio_dev *indio_dev,
const struct iio_chan_spec *chan, enum iio_event_type type,
enum iio_event_direction dir, enum iio_event_info info, int *val,
int *val2)
{ … }
static int tsl2563_write_thresh(struct iio_dev *indio_dev,
const struct iio_chan_spec *chan, enum iio_event_type type,
enum iio_event_direction dir, enum iio_event_info info, int val,
int val2)
{ … }
static irqreturn_t tsl2563_event_handler(int irq, void *private)
{ … }
static int tsl2563_write_interrupt_config(struct iio_dev *indio_dev,
const struct iio_chan_spec *chan, enum iio_event_type type,
enum iio_event_direction dir, int state)
{ … }
static int tsl2563_read_interrupt_config(struct iio_dev *indio_dev,
const struct iio_chan_spec *chan, enum iio_event_type type,
enum iio_event_direction dir)
{ … }
static const struct iio_info tsl2563_info_no_irq = …;
static const struct iio_info tsl2563_info = …;
static int tsl2563_probe(struct i2c_client *client)
{ … }
static void tsl2563_remove(struct i2c_client *client)
{ … }
static int tsl2563_suspend(struct device *dev)
{ … }
static int tsl2563_resume(struct device *dev)
{ … }
static DEFINE_SIMPLE_DEV_PM_OPS(tsl2563_pm_ops, tsl2563_suspend,
tsl2563_resume);
static const struct i2c_device_id tsl2563_id[] = …;
MODULE_DEVICE_TABLE(i2c, tsl2563_id);
static const struct of_device_id tsl2563_of_match[] = …;
MODULE_DEVICE_TABLE(of, tsl2563_of_match);
static struct i2c_driver tsl2563_i2c_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;