#include <linux/delay.h>
#include <linux/err.h>
#include <linux/gpio/consumer.h>
#include <linux/i2c.h>
#include <linux/jiffies.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/pm_runtime.h>
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>
#define MLX90614_OP_RAM …
#define MLX90614_OP_EEPROM …
#define MLX90614_OP_SLEEP …
#define MLX90615_OP_EEPROM …
#define MLX90615_OP_RAM …
#define MLX90615_OP_SLEEP …
#define MLX90614_CONFIG_IIR_SHIFT …
#define MLX90614_CONFIG_IIR_MASK …
#define MLX90614_CONFIG_DUAL_SHIFT …
#define MLX90614_CONFIG_DUAL_MASK …
#define MLX90614_CONFIG_FIR_SHIFT …
#define MLX90614_CONFIG_FIR_MASK …
#define MLX90615_CONFIG_IIR_SHIFT …
#define MLX90615_CONFIG_IIR_MASK …
#define MLX90614_TIMING_EEPROM …
#define MLX90614_TIMING_WAKEUP …
#define MLX90614_TIMING_STARTUP …
#define MLX90615_TIMING_WAKEUP …
#define MLX90614_AUTOSLEEP_DELAY …
#define MLX90614_CONST_OFFSET_DEC …
#define MLX90614_CONST_OFFSET_REM …
#define MLX90614_CONST_SCALE …
#define MLX90614_CONST_FIR …
#define field_get(_mask, _reg) …
#define field_prep(_mask, _val) …
struct mlx_chip_info { … };
struct mlx90614_data { … };
static s32 mlx90614_write_word(const struct i2c_client *client, u8 command,
u16 value)
{ … }
static inline s32 mlx90614_iir_search(const struct i2c_client *client,
int value)
{ … }
#ifdef CONFIG_PM
static int mlx90614_power_get(struct mlx90614_data *data, bool startup)
{ … }
static void mlx90614_power_put(struct mlx90614_data *data)
{ … }
#else
static inline int mlx90614_power_get(struct mlx90614_data *data, bool startup)
{
return 0;
}
static inline void mlx90614_power_put(struct mlx90614_data *data)
{
}
#endif
static int mlx90614_read_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *channel, int *val,
int *val2, long mask)
{ … }
static int mlx90614_write_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *channel, int val,
int val2, long mask)
{ … }
static int mlx90614_write_raw_get_fmt(struct iio_dev *indio_dev,
struct iio_chan_spec const *channel,
long mask)
{ … }
static int mlx90614_read_avail(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
const int **vals, int *type, int *length,
long mask)
{ … }
static const struct iio_chan_spec mlx90614_channels[] = …;
static const struct iio_info mlx90614_info = …;
#ifdef CONFIG_PM
static int mlx90614_sleep(struct mlx90614_data *data)
{ … }
static int mlx90614_wakeup(struct mlx90614_data *data)
{ … }
static struct gpio_desc *mlx90614_probe_wakeup(struct i2c_client *client)
{ … }
#else
static inline int mlx90614_sleep(struct mlx90614_data *data)
{
return -ENOSYS;
}
static inline int mlx90614_wakeup(struct mlx90614_data *data)
{
return -ENOSYS;
}
static inline struct gpio_desc *mlx90614_probe_wakeup(struct i2c_client *client)
{
return NULL;
}
#endif
static int mlx90614_probe_num_ir_sensors(struct i2c_client *client)
{ … }
static int mlx90614_probe(struct i2c_client *client)
{ … }
static void mlx90614_remove(struct i2c_client *client)
{ … }
static const struct mlx_chip_info mlx90614_chip_info = …;
static const struct mlx_chip_info mlx90615_chip_info = …;
static const struct i2c_device_id mlx90614_id[] = …;
MODULE_DEVICE_TABLE(i2c, mlx90614_id);
static const struct of_device_id mlx90614_of_match[] = …;
MODULE_DEVICE_TABLE(of, mlx90614_of_match);
static int mlx90614_pm_suspend(struct device *dev)
{ … }
static int mlx90614_pm_resume(struct device *dev)
{ … }
static int mlx90614_pm_runtime_suspend(struct device *dev)
{ … }
static int mlx90614_pm_runtime_resume(struct device *dev)
{ … }
static const struct dev_pm_ops mlx90614_pm_ops = …;
static struct i2c_driver mlx90614_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;