#include <linux/crc8.h>
#include <linux/delay.h>
#include <linux/i2c.h>
#include <linux/module.h>
#include <linux/iio/iio.h>
#define AGS02MA_TVOC_READ_REG …
#define AGS02MA_VERSION_REG …
#define AGS02MA_VERSION_PROCESSING_DELAY …
#define AGS02MA_TVOC_READ_PROCESSING_DELAY …
#define AGS02MA_CRC8_INIT …
#define AGS02MA_CRC8_POLYNOMIAL …
DECLARE_CRC8_TABLE(ags02ma_crc8_table);
struct ags02ma_data { … };
struct ags02ma_reading { … } __packed;
static int ags02ma_register_read(struct i2c_client *client, u8 reg, u16 delay,
u32 *val)
{ … }
static int ags02ma_read_raw(struct iio_dev *iio_device,
struct iio_chan_spec const *chan, int *val,
int *val2, long mask)
{ … }
static const struct iio_info ags02ma_info = …;
static const struct iio_chan_spec ags02ma_channel = …;
static int ags02ma_probe(struct i2c_client *client)
{ … }
static const struct i2c_device_id ags02ma_id_table[] = …;
MODULE_DEVICE_TABLE(i2c, ags02ma_id_table);
static const struct of_device_id ags02ma_of_table[] = …;
MODULE_DEVICE_TABLE(of, ags02ma_of_table);
static struct i2c_driver ags02ma_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;