#include <linux/bitfield.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/err.h>
#include <linux/gpio/consumer.h>
#include <linux/i2c.h>
#include <linux/iopoll.h>
#include <linux/jiffies.h>
#include <linux/kernel.h>
#include <linux/limits.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/math64.h>
#include <linux/pm_runtime.h>
#include <linux/regmap.h>
#include <linux/regulator/consumer.h>
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>
#define MLX90632_ADDR_RAM …
#define MLX90632_ADDR_EEPROM …
#define MLX90632_EE_CTRL …
#define MLX90632_EE_I2C_ADDR …
#define MLX90632_EE_VERSION …
#define MLX90632_EE_P_R …
#define MLX90632_EE_P_G …
#define MLX90632_EE_P_T …
#define MLX90632_EE_P_O …
#define MLX90632_EE_Aa …
#define MLX90632_EE_Ab …
#define MLX90632_EE_Ba …
#define MLX90632_EE_Bb …
#define MLX90632_EE_Ca …
#define MLX90632_EE_Cb …
#define MLX90632_EE_Da …
#define MLX90632_EE_Db …
#define MLX90632_EE_Ea …
#define MLX90632_EE_Eb …
#define MLX90632_EE_Fa …
#define MLX90632_EE_Fb …
#define MLX90632_EE_Ga …
#define MLX90632_EE_Gb …
#define MLX90632_EE_Ka …
#define MLX90632_EE_Ha …
#define MLX90632_EE_Hb …
#define MLX90632_EE_MEDICAL_MEAS1 …
#define MLX90632_EE_MEDICAL_MEAS2 …
#define MLX90632_EE_EXTENDED_MEAS1 …
#define MLX90632_EE_EXTENDED_MEAS2 …
#define MLX90632_EE_EXTENDED_MEAS3 …
#define MLX90632_REG_I2C_ADDR …
#define MLX90632_REG_CONTROL …
#define MLX90632_CFG_PWR_MASK …
#define MLX90632_CFG_MTYP_MASK …
#define MLX90632_CFG_SOB_MASK …
#define MLX90632_PWR_STATUS(ctrl_val) …
#define MLX90632_PWR_STATUS_HALT …
#define MLX90632_PWR_STATUS_SLEEP_STEP …
#define MLX90632_PWR_STATUS_STEP …
#define MLX90632_PWR_STATUS_CONTINUOUS …
#define MLX90632_EE_RR …
#define MLX90632_REFRESH_RATE(ee_val) …
#define MLX90632_REFRESH_RATE_STATUS(refresh_rate) …
#define MLX90632_MTYP_MEDICAL …
#define MLX90632_MTYP_EXTENDED …
#define MLX90632_MTYP_STATUS(ctrl_val) …
#define MLX90632_MTYP_STATUS_MEDICAL …
#define MLX90632_MTYP_STATUS_EXTENDED …
#define MLX90632_REG_I2C_CMD …
#define MLX90632_REG_STATUS …
#define MLX90632_STAT_BUSY …
#define MLX90632_STAT_EE_BUSY …
#define MLX90632_STAT_BRST …
#define MLX90632_STAT_CYCLE_POS …
#define MLX90632_STAT_DATA_RDY …
#define MLX90632_RAM_1(meas_num) …
#define MLX90632_RAM_2(meas_num) …
#define MLX90632_RAM_3(meas_num) …
#define MLX90632_RAM_DSP5_EXTENDED_AMBIENT_1 …
#define MLX90632_RAM_DSP5_EXTENDED_AMBIENT_2 …
#define MLX90632_RAM_DSP5_EXTENDED_OBJECT_1 …
#define MLX90632_RAM_DSP5_EXTENDED_OBJECT_2 …
#define MLX90632_RAM_DSP5_EXTENDED_OBJECT_3 …
#define MLX90632_RAM_DSP5_EXTENDED_OBJECT_4 …
#define MLX90632_RAM_DSP5_EXTENDED_OBJECT_5 …
#define MLX90632_RAM_DSP5_EXTENDED_OBJECT_6 …
#define MLX90632_ID_MEDICAL …
#define MLX90632_ID_CONSUMER …
#define MLX90632_ID_EXTENDED …
#define MLX90632_ID_MASK …
#define MLX90632_DSP_VERSION …
#define MLX90632_DSP_MASK …
#define MLX90632_RESET_CMD …
#define MLX90632_REF_12 …
#define MLX90632_REF_3 …
#define MLX90632_MAX_MEAS_NUM …
#define MLX90632_SLEEP_DELAY_MS …
#define MLX90632_EXTENDED_LIMIT …
#define MLX90632_MEAS_MAX_TIME …
struct mlx90632_data { … };
static const struct regmap_range mlx90632_volatile_reg_range[] = …;
static const struct regmap_access_table mlx90632_volatile_regs_tbl = …;
static const struct regmap_range mlx90632_read_reg_range[] = …;
static const struct regmap_access_table mlx90632_readable_regs_tbl = …;
static const struct regmap_range mlx90632_no_write_reg_range[] = …;
static const struct regmap_access_table mlx90632_writeable_regs_tbl = …;
static const struct regmap_config mlx90632_regmap = …;
static int mlx90632_pwr_set_sleep_step(struct regmap *regmap)
{ … }
static int mlx90632_pwr_continuous(struct regmap *regmap)
{ … }
static void mlx90632_reset_delay(void)
{ … }
static int mlx90632_get_measurement_time(struct regmap *regmap, u16 meas)
{ … }
static int mlx90632_calculate_dataset_ready_time(struct mlx90632_data *data)
{ … }
static int mlx90632_perform_measurement(struct mlx90632_data *data)
{ … }
static int mlx90632_perform_measurement_burst(struct mlx90632_data *data)
{ … }
static int mlx90632_set_meas_type(struct mlx90632_data *data, u8 type)
{ … }
static int mlx90632_channel_new_select(int perform_ret, uint8_t *channel_new,
uint8_t *channel_old)
{ … }
static int mlx90632_read_ambient_raw(struct regmap *regmap,
s16 *ambient_new_raw, s16 *ambient_old_raw)
{ … }
static int mlx90632_read_object_raw(struct regmap *regmap,
int perform_measurement_ret,
s16 *object_new_raw, s16 *object_old_raw)
{ … }
static int mlx90632_read_all_channel(struct mlx90632_data *data,
s16 *ambient_new_raw, s16 *ambient_old_raw,
s16 *object_new_raw, s16 *object_old_raw)
{ … }
static int mlx90632_read_ambient_raw_extended(struct regmap *regmap,
s16 *ambient_new_raw, s16 *ambient_old_raw)
{ … }
static int mlx90632_read_object_raw_extended(struct regmap *regmap, s16 *object_new_raw)
{ … }
static int mlx90632_read_all_channel_extended(struct mlx90632_data *data, s16 *object_new_raw,
s16 *ambient_new_raw, s16 *ambient_old_raw)
{ … }
static int mlx90632_read_ee_register(struct regmap *regmap, u16 reg_lsb,
s32 *reg_value)
{ … }
static s64 mlx90632_preprocess_temp_amb(s16 ambient_new_raw,
s16 ambient_old_raw, s16 Gb)
{ … }
static s64 mlx90632_preprocess_temp_obj(s16 object_new_raw, s16 object_old_raw,
s16 ambient_new_raw,
s16 ambient_old_raw, s16 Ka)
{ … }
static s64 mlx90632_preprocess_temp_obj_extended(s16 object_new_raw, s16 ambient_new_raw,
s16 ambient_old_raw, s16 Ka)
{ … }
static s32 mlx90632_calc_temp_ambient(s16 ambient_new_raw, s16 ambient_old_raw,
s32 P_T, s32 P_R, s32 P_G, s32 P_O, s16 Gb)
{ … }
static s32 mlx90632_calc_temp_object_iteration(s32 prev_object_temp, s64 object,
s64 TAdut, s64 TAdut4, s32 Fa, s32 Fb,
s32 Ga, s16 Ha, s16 Hb,
u16 emissivity)
{ … }
static s64 mlx90632_calc_ta4(s64 TAdut, s64 scale)
{ … }
static s32 mlx90632_calc_temp_object(s64 object, s64 ambient, s32 Ea, s32 Eb,
s32 Fa, s32 Fb, s32 Ga, s16 Ha, s16 Hb,
u16 tmp_emi)
{ … }
static s32 mlx90632_calc_temp_object_extended(s64 object, s64 ambient, s64 reflected,
s32 Ea, s32 Eb, s32 Fa, s32 Fb, s32 Ga,
s16 Ha, s16 Hb, u16 tmp_emi)
{ … }
static int mlx90632_calc_object_dsp105(struct mlx90632_data *data, int *val)
{ … }
static int mlx90632_calc_ambient_dsp105(struct mlx90632_data *data, int *val)
{ … }
static int mlx90632_get_refresh_rate(struct mlx90632_data *data,
int *refresh_rate)
{ … }
static const int mlx90632_freqs[][2] = …;
static int mlx90632_pm_interraction_wakeup(struct mlx90632_data *data)
{ … }
static int mlx90632_read_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *channel, int *val,
int *val2, long mask)
{ … }
static int mlx90632_write_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *channel, int val,
int val2, long mask)
{ … }
static int mlx90632_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 mlx90632_channels[] = …;
static const struct iio_info mlx90632_info = …;
static void mlx90632_sleep(void *_data)
{ … }
static int mlx90632_suspend(struct mlx90632_data *data)
{ … }
static int mlx90632_wakeup(struct mlx90632_data *data)
{ … }
static void mlx90632_disable_regulator(void *_data)
{ … }
static int mlx90632_enable_regulator(struct mlx90632_data *data)
{ … }
static int mlx90632_probe(struct i2c_client *client)
{ … }
static const struct i2c_device_id mlx90632_id[] = …;
MODULE_DEVICE_TABLE(i2c, mlx90632_id);
static const struct of_device_id mlx90632_of_match[] = …;
MODULE_DEVICE_TABLE(of, mlx90632_of_match);
static int mlx90632_pm_suspend(struct device *dev)
{ … }
static int mlx90632_pm_resume(struct device *dev)
{ … }
static int mlx90632_pm_runtime_suspend(struct device *dev)
{ … }
static const struct dev_pm_ops mlx90632_pm_ops = …;
static struct i2c_driver mlx90632_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;