#include <linux/delay.h>
#include <linux/gpio/consumer.h>
#include <linux/i2c.h>
#include <linux/iio/iio.h>
#include <linux/iio/buffer.h>
#include <linux/iio/trigger.h>
#include <linux/iio/triggered_buffer.h>
#include <linux/iio/trigger_consumer.h>
#include <linux/module.h>
#define CCS811_STATUS …
#define CCS811_MEAS_MODE …
#define CCS811_ALG_RESULT_DATA …
#define CCS811_RAW_DATA …
#define CCS811_HW_ID …
#define CCS811_HW_ID_VALUE …
#define CCS811_HW_VERSION …
#define CCS811_HW_VERSION_VALUE …
#define CCS811_HW_VERSION_MASK …
#define CCS811_ERR …
#define CCS811_APP_START …
#define CCS811_SW_RESET …
#define CCS811_STATUS_ERROR …
#define CCS811_STATUS_DATA_READY …
#define CCS811_STATUS_APP_VALID_MASK …
#define CCS811_STATUS_APP_VALID_LOADED …
#define CCS811_STATUS_FW_MODE_MASK …
#define CCS811_STATUS_FW_MODE_APPLICATION …
#define CCS811_MODE_IDLE …
#define CCS811_MODE_IAQ_1SEC …
#define CCS811_MODE_IAQ_10SEC …
#define CCS811_MODE_IAQ_60SEC …
#define CCS811_MODE_RAW_DATA …
#define CCS811_MEAS_MODE_INTERRUPT …
#define CCS811_VOLTAGE_MASK …
struct ccs811_reading { … } __attribute__((packed));
struct ccs811_data { … };
static const struct iio_chan_spec ccs811_channels[] = …;
static int ccs811_start_sensor_application(struct i2c_client *client)
{ … }
static int ccs811_setup(struct i2c_client *client)
{ … }
static void ccs811_set_wakeup(struct ccs811_data *data, bool enable)
{ … }
static int ccs811_get_measurement(struct ccs811_data *data)
{ … }
static int ccs811_read_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int *val, int *val2, long mask)
{ … }
static const struct iio_info ccs811_info = …;
static int ccs811_set_trigger_state(struct iio_trigger *trig,
bool state)
{ … }
static const struct iio_trigger_ops ccs811_trigger_ops = …;
static irqreturn_t ccs811_trigger_handler(int irq, void *p)
{ … }
static irqreturn_t ccs811_data_rdy_trigger_poll(int irq, void *private)
{ … }
static int ccs811_reset(struct i2c_client *client)
{ … }
static int ccs811_probe(struct i2c_client *client)
{ … }
static void ccs811_remove(struct i2c_client *client)
{ … }
static const struct i2c_device_id ccs811_id[] = …;
MODULE_DEVICE_TABLE(i2c, ccs811_id);
static const struct of_device_id ccs811_dt_ids[] = …;
MODULE_DEVICE_TABLE(of, ccs811_dt_ids);
static struct i2c_driver ccs811_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;