#include <linux/bitfield.h>
#include <linux/bits.h>
#include <linux/completion.h>
#include <linux/delay.h>
#include <linux/hwmon.h>
#include <linux/i2c.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/module.h>
#include <linux/regulator/consumer.h>
#define CC2_START_CM …
#define CC2_START_NOM …
#define CC2_R_ALARM_H_ON …
#define CC2_R_ALARM_H_OFF …
#define CC2_R_ALARM_L_ON …
#define CC2_R_ALARM_L_OFF …
#define CC2_RW_OFFSET …
#define CC2_W_ALARM_H_ON …
#define CC2_W_ALARM_H_OFF …
#define CC2_W_ALARM_L_ON …
#define CC2_W_ALARM_L_OFF …
#define CC2_STATUS_FIELD …
#define CC2_STATUS_VALID_DATA …
#define CC2_STATUS_STALE_DATA …
#define CC2_STATUS_CMD_MODE …
#define CC2_RESPONSE_FIELD …
#define CC2_RESPONSE_BUSY …
#define CC2_RESPONSE_ACK …
#define CC2_RESPONSE_NACK …
#define CC2_ERR_CORR_EEPROM …
#define CC2_ERR_UNCORR_EEPROM …
#define CC2_ERR_RAM_PARITY …
#define CC2_ERR_CONFIG_LOAD …
#define CC2_EEPROM_SIZE …
#define CC2_EEPROM_DATA_LEN …
#define CC2_MEASUREMENT_DATA_LEN …
#define CC2_RH_DATA_FIELD …
#define CC2_POWER_CYCLE_MS …
#define CC2_STARTUP_TO_DATA_MS …
#define CC2_RESP_START_CM_US …
#define CC2_RESP_EEPROM_R_US …
#define CC2_RESP_EEPROM_W_MS …
#define CC2_STARTUP_TIME_US …
#define CC2_RH_MAX …
#define CC2_CM_RETRIES …
struct cc2_rh_alarm_info { … };
struct cc2_data { … };
enum cc2_chan_addr { … };
static long cc2_rh_convert(u16 data)
{ … }
static u16 cc2_rh_to_reg(long data)
{ … }
static long cc2_temp_convert(u16 data)
{ … }
static int cc2_enable(struct cc2_data *data)
{ … }
static void cc2_disable(struct cc2_data *data)
{ … }
static int cc2_cmd_response_diagnostic(struct device *dev, u8 status)
{ … }
static int cc2_read_command_status(struct i2c_client *client)
{ … }
static int cc2_command_mode_start(struct cc2_data *data)
{ … }
static int cc2_command_mode_finish(struct cc2_data *data)
{ … }
static int cc2_write_reg(struct cc2_data *data, u8 reg, u16 val)
{ … }
static int cc2_read_reg(struct cc2_data *data, u8 reg, u16 *val)
{ … }
static int cc2_get_reg_val(struct cc2_data *data, u8 reg, long *val)
{ … }
static int cc2_data_fetch(struct i2c_client *client,
enum hwmon_sensor_types type, long *val)
{ … }
static int cc2_read_measurement(struct cc2_data *data,
enum hwmon_sensor_types type, long *val)
{ … }
static int cc2_measurement(struct cc2_data *data, enum hwmon_sensor_types type,
long *val)
{ … }
static int cc2_read_hyst_and_measure(struct cc2_data *data, u8 reg,
long *hyst, long *measurement)
{ … }
static umode_t cc2_is_visible(const void *data, enum hwmon_sensor_types type,
u32 attr, int channel)
{ … }
static irqreturn_t cc2_ready_interrupt(int irq, void *data)
{ … }
static irqreturn_t cc2_low_interrupt(int irq, void *data)
{ … }
static irqreturn_t cc2_high_interrupt(int irq, void *data)
{ … }
static int cc2_humidity_min_alarm_status(struct cc2_data *data, long *val)
{ … }
static int cc2_humidity_max_alarm_status(struct cc2_data *data, long *val)
{ … }
static int cc2_read(struct device *dev, enum hwmon_sensor_types type, u32 attr,
int channel, long *val)
{ … }
static int cc2_write(struct device *dev, enum hwmon_sensor_types type, u32 attr,
int channel, long val)
{ … }
static int cc2_request_ready_irq(struct cc2_data *data, struct device *dev)
{ … }
static int cc2_request_alarm_irqs(struct cc2_data *data, struct device *dev)
{ … }
static const struct hwmon_channel_info *cc2_info[] = …;
static const struct hwmon_ops cc2_hwmon_ops = …;
static const struct hwmon_chip_info cc2_chip_info = …;
static int cc2_probe(struct i2c_client *client)
{ … }
static void cc2_remove(struct i2c_client *client)
{ … }
static const struct i2c_device_id cc2_id[] = …;
MODULE_DEVICE_TABLE(i2c, cc2_id);
static const struct of_device_id cc2_of_match[] = …;
MODULE_DEVICE_TABLE(of, cc2_of_match);
static struct i2c_driver cc2_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;