#include <linux/init.h>
#include <linux/device.h>
#include <linux/kernel.h>
#include <linux/stat.h>
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>
#include "../common/ms_sensors/ms_sensors_i2c.h"
#define HTU21_RESET …
enum { … };
static const int htu21_samp_freq[4] = …;
static const char htu21_show_samp_freq[] = …;
static int htu21_read_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *channel, int *val,
int *val2, long mask)
{ … }
static int htu21_write_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int val, int val2, long mask)
{ … }
static const struct iio_chan_spec htu21_channels[] = …;
static const struct iio_chan_spec ms8607_channels[] = …;
static ssize_t htu21_show_battery_low(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t htu21_show_heater(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t htu21_write_heater(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t len)
{ … }
static IIO_CONST_ATTR_SAMP_FREQ_AVAIL(htu21_show_samp_freq);
static IIO_DEVICE_ATTR(battery_low, S_IRUGO,
htu21_show_battery_low, NULL, 0);
static IIO_DEVICE_ATTR(heater_enable, S_IRUGO | S_IWUSR,
htu21_show_heater, htu21_write_heater, 0);
static struct attribute *htu21_attributes[] = …;
static const struct attribute_group htu21_attribute_group = …;
static const struct iio_info htu21_info = …;
static int htu21_probe(struct i2c_client *client)
{ … }
static const struct i2c_device_id htu21_id[] = …;
MODULE_DEVICE_TABLE(i2c, htu21_id);
static const struct of_device_id htu21_of_match[] = …;
MODULE_DEVICE_TABLE(of, htu21_of_match);
static struct i2c_driver htu21_driver = …;
module_i2c_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;
MODULE_IMPORT_NS(…);