#include <linux/delay.h>
#include <linux/i2c.h>
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/slab.h>
#include <linux/sysfs.h>
#include <linux/stat.h>
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>
#define SI7020CMD_RH_HOLD …
#define SI7020CMD_TEMP_HOLD …
#define SI7020CMD_RESET …
#define SI7020CMD_USR_WRITE …
#define SI7020_USR_HEATER_EN …
#define SI7020CMD_HEATER_WRITE …
#define SI7020_HEATER_VAL …
struct si7020_data { … };
static const int si7020_heater_vals[] = …;
static int si7020_read_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan, int *val,
int *val2, long mask)
{ … }
static const struct iio_chan_spec si7020_channels[] = …;
static int si7020_update_reg(struct si7020_data *data,
u8 *reg, u8 cmd, u8 mask, u8 val)
{ … }
static int si7020_write_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int val, int val2, long mask)
{ … }
static int si7020_read_available(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
const int **vals,
int *type, int *length, long mask)
{ … }
static ssize_t si7020_show_heater_en(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t si7020_store_heater_en(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t len)
{ … }
static IIO_DEVICE_ATTR(heater_enable, 0644,
si7020_show_heater_en, si7020_store_heater_en, 0);
static struct attribute *si7020_attributes[] = …;
static const struct attribute_group si7020_attribute_group = …;
static const struct iio_info si7020_info = …;
static int si7020_probe(struct i2c_client *client)
{ … }
static const struct i2c_device_id si7020_id[] = …;
MODULE_DEVICE_TABLE(i2c, si7020_id);
static const struct of_device_id si7020_dt_ids[] = …;
MODULE_DEVICE_TABLE(of, si7020_dt_ids);
static struct i2c_driver si7020_driver = …;
module_i2c_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;