#include <linux/device.h>
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/i2c.h>
#include <linux/pm_runtime.h>
#include <linux/crc8.h>
#include <linux/mutex.h>
#include <linux/delay.h>
#include <linux/log2.h>
#include <linux/math64.h>
#include <linux/regulator/consumer.h>
#include <linux/iio/iio.h>
#define ICP10100_ID_REG_GET(_reg) …
#define ICP10100_ID_REG …
#define ICP10100_RESPONSE_WORD_LENGTH …
#define ICP10100_CRC8_WORD_LENGTH …
#define ICP10100_CRC8_POLYNOMIAL …
#define ICP10100_CRC8_INIT …
enum icp10100_mode { … };
struct icp10100_state { … };
struct icp10100_command { … };
static const struct icp10100_command icp10100_cmd_soft_reset = …;
static const struct icp10100_command icp10100_cmd_read_id = …;
static const struct icp10100_command icp10100_cmd_read_otp = …;
static const struct icp10100_command icp10100_cmd_measure[] = …;
static const uint8_t icp10100_switch_mode_otp[] = …;
DECLARE_CRC8_TABLE(icp10100_crc8_table);
static inline int icp10100_i2c_xfer(struct i2c_adapter *adap,
struct i2c_msg *msgs, int num)
{ … }
static int icp10100_send_cmd(struct icp10100_state *st,
const struct icp10100_command *cmd,
__be16 *buf, size_t buf_len)
{ … }
static int icp10100_read_cal_otp(struct icp10100_state *st)
{ … }
static int icp10100_init_chip(struct icp10100_state *st)
{ … }
static int icp10100_get_measures(struct icp10100_state *st,
uint32_t *pressure, uint16_t *temperature)
{ … }
static uint32_t icp10100_get_pressure(struct icp10100_state *st,
uint32_t raw_pressure, uint16_t raw_temp)
{ … }
static int icp10100_read_raw_measures(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int *val, int *val2)
{ … }
static int icp10100_read_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int *val, int *val2, long mask)
{ … }
static int icp10100_read_avail(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
const int **vals, int *type, int *length,
long mask)
{ … }
static int icp10100_write_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int val, int val2, long mask)
{ … }
static int icp10100_write_raw_get_fmt(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
long mask)
{ … }
static const struct iio_info icp10100_info = …;
static const struct iio_chan_spec icp10100_channels[] = …;
static int icp10100_enable_regulator(struct icp10100_state *st)
{ … }
static void icp10100_disable_regulator_action(void *data)
{ … }
static void icp10100_pm_disable(void *data)
{ … }
static int icp10100_probe(struct i2c_client *client)
{ … }
static int icp10100_suspend(struct device *dev)
{ … }
static int icp10100_resume(struct device *dev)
{ … }
static DEFINE_RUNTIME_DEV_PM_OPS(icp10100_pm, icp10100_suspend, icp10100_resume,
NULL);
static const struct of_device_id icp10100_of_match[] = …;
MODULE_DEVICE_TABLE(of, icp10100_of_match);
static const struct i2c_device_id icp10100_id[] = …;
MODULE_DEVICE_TABLE(i2c, icp10100_id);
static struct i2c_driver icp10100_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;