#include <linux/bitfield.h>
#include <linux/delay.h>
#include <linux/err.h>
#include <linux/hwmon.h>
#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of_device.h>
#include <linux/slab.h>
#include <linux/types.h>
#define HS3001_WAKEUP_TIME …
#define HS3001_8BIT_RESOLUTION …
#define HS3001_10BIT_RESOLUTION …
#define HS3001_12BIT_RESOLUTION …
#define HS3001_14BIT_RESOLUTION …
#define HS3001_RESPONSE_LENGTH …
#define HS3001_FIXPOINT_ARITH …
#define HS3001_MASK_HUMIDITY_0X3FFF …
#define HS3001_MASK_STATUS_0XC0 …
#define HS3001_DATA_VALID …
#define HS3001_DATA_STALE …
struct hs3001_data { … };
static int hs3001_extract_temperature(u16 raw)
{ … }
static u32 hs3001_extract_humidity(u16 raw)
{ … }
static int hs3001_data_fetch_command(struct i2c_client *client,
struct hs3001_data *data)
{ … }
static umode_t hs3001_is_visible(const void *data, enum hwmon_sensor_types type,
u32 attr, int channel)
{ … }
static int hs3001_read(struct device *dev, enum hwmon_sensor_types type,
u32 attr, int channel, long *val)
{ … }
static const struct hwmon_channel_info *hs3001_info[] = …;
static const struct hwmon_ops hs3001_hwmon_ops = …;
static const struct hwmon_chip_info hs3001_chip_info = …;
static const struct i2c_device_id hs3001_ids[] = …;
MODULE_DEVICE_TABLE(i2c, hs3001_ids);
static const struct of_device_id hs3001_of_match[] = …;
MODULE_DEVICE_TABLE(of, hs3001_of_match);
static int hs3001_probe(struct i2c_client *client)
{ … }
static struct i2c_driver hs3001_i2c_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;