#include <linux/bitfield.h>
#include <linux/bitops.h>
#include <linux/bits.h>
#include <linux/err.h>
#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/math.h>
#include <linux/minmax.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/iio/events.h>
#include <linux/iio/iio.h>
#define MCP9600_HOT_JUNCTION …
#define MCP9600_COLD_JUNCTION …
#define MCP9600_STATUS …
#define MCP9600_STATUS_ALERT(x) …
#define MCP9600_ALERT_CFG1 …
#define MCP9600_ALERT_CFG(x) …
#define MCP9600_ALERT_CFG_ENABLE …
#define MCP9600_ALERT_CFG_ACTIVE_HIGH …
#define MCP9600_ALERT_CFG_FALLING …
#define MCP9600_ALERT_CFG_COLD_JUNCTION …
#define MCP9600_ALERT_HYSTERESIS1 …
#define MCP9600_ALERT_HYSTERESIS(x) …
#define MCP9600_ALERT_LIMIT1 …
#define MCP9600_ALERT_LIMIT(x) …
#define MCP9600_ALERT_LIMIT_MASK …
#define MCP9600_DEVICE_ID …
#define MCP9600_DEVICE_ID_MCP9600 …
#define MCP9600_ALERT_COUNT …
#define MCP9600_MIN_TEMP_HOT_JUNCTION_MICRO …
#define MCP9600_MAX_TEMP_HOT_JUNCTION_MICRO …
#define MCP9600_MIN_TEMP_COLD_JUNCTION_MICRO …
#define MCP9600_MAX_TEMP_COLD_JUNCTION_MICRO …
enum mcp9600_alert { … };
static const char * const mcp9600_alert_name[MCP9600_ALERT_COUNT] = …;
static const struct iio_event_spec mcp9600_events[] = …;
#define MCP9600_CHANNELS(hj_num_ev, hj_ev_spec_off, cj_num_ev, cj_ev_spec_off) …
static const struct iio_chan_spec mcp9600_channels[][2] = …;
struct mcp9600_data { … };
static int mcp9600_read(struct mcp9600_data *data,
struct iio_chan_spec const *chan, int *val)
{ … }
static int mcp9600_read_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan, int *val,
int *val2, long mask)
{ … }
static int mcp9600_get_alert_index(int channel2, enum iio_event_direction dir)
{ … }
static int mcp9600_read_event_config(struct iio_dev *indio_dev,
const struct iio_chan_spec *chan,
enum iio_event_type type,
enum iio_event_direction dir)
{ … }
static int mcp9600_write_event_config(struct iio_dev *indio_dev,
const struct iio_chan_spec *chan,
enum iio_event_type type,
enum iio_event_direction dir,
int state)
{ … }
static int mcp9600_read_thresh(struct iio_dev *indio_dev,
const struct iio_chan_spec *chan,
enum iio_event_type type,
enum iio_event_direction dir,
enum iio_event_info info, int *val, int *val2)
{ … }
static int mcp9600_write_thresh(struct iio_dev *indio_dev,
const struct iio_chan_spec *chan,
enum iio_event_type type,
enum iio_event_direction dir,
enum iio_event_info info, int val, int val2)
{ … }
static const struct iio_info mcp9600_info = …;
static irqreturn_t mcp9600_alert_handler(void *private,
enum mcp9600_alert alert,
enum iio_modifier mod,
enum iio_event_direction dir)
{ … }
static irqreturn_t mcp9600_alert1_handler(int irq, void *private)
{ … }
static irqreturn_t mcp9600_alert2_handler(int irq, void *private)
{ … }
static irqreturn_t mcp9600_alert3_handler(int irq, void *private)
{ … }
static irqreturn_t mcp9600_alert4_handler(int irq, void *private)
{ … }
static irqreturn_t (*mcp9600_alert_handler_func[MCP9600_ALERT_COUNT]) (int, void *) = …;
static int mcp9600_probe_alerts(struct iio_dev *indio_dev)
{ … }
static int mcp9600_probe(struct i2c_client *client)
{ … }
static const struct i2c_device_id mcp9600_id[] = …;
MODULE_DEVICE_TABLE(i2c, mcp9600_id);
static const struct of_device_id mcp9600_of_match[] = …;
MODULE_DEVICE_TABLE(of, mcp9600_of_match);
static struct i2c_driver mcp9600_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;