#include <linux/bits.h>
#include <linux/device.h>
#include <linux/err.h>
#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/jiffies.h>
#include <linux/hwmon.h>
#include <linux/kstrtox.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/of.h>
#include <linux/regulator/consumer.h>
#include <linux/slab.h>
#include <linux/workqueue.h>
#define MAX_CHANNELS …
static const unsigned short normal_i2c[] = …;
enum chips { … };
#define LM90_REG_MAN_ID …
#define LM90_REG_CHIP_ID …
#define LM90_REG_CONFIG1 …
#define LM90_REG_CONFIG2 …
#define LM90_REG_CONVRATE …
#define LM90_REG_STATUS …
#define LM90_REG_LOCAL_TEMP …
#define LM90_REG_LOCAL_HIGH …
#define LM90_REG_LOCAL_LOW …
#define LM90_REG_LOCAL_CRIT …
#define LM90_REG_REMOTE_TEMPH …
#define LM90_REG_REMOTE_TEMPL …
#define LM90_REG_REMOTE_OFFSH …
#define LM90_REG_REMOTE_OFFSL …
#define LM90_REG_REMOTE_HIGHH …
#define LM90_REG_REMOTE_HIGHL …
#define LM90_REG_REMOTE_LOWH …
#define LM90_REG_REMOTE_LOWL …
#define LM90_REG_REMOTE_CRIT …
#define LM90_REG_TCRIT_HYST …
#define MAX6657_REG_LOCAL_TEMPL …
#define MAX6696_REG_STATUS2 …
#define MAX6659_REG_REMOTE_EMERG …
#define MAX6659_REG_LOCAL_EMERG …
#define SA56004_REG_LOCAL_TEMPL …
#define LM90_MAX_CONVRATE_MS …
#define TMP451_REG_LOCAL_TEMPL …
#define TMP451_REG_CONALERT …
#define TMP461_REG_CHEN …
#define TMP461_REG_DFC …
#define ADT7481_REG_STATUS2 …
#define ADT7481_REG_CONFIG2 …
#define ADT7481_REG_MAN_ID …
#define ADT7481_REG_CHIP_ID …
#define LM90_HAVE_EXTENDED_TEMP …
#define LM90_HAVE_OFFSET …
#define LM90_HAVE_UNSIGNED_TEMP …
#define LM90_HAVE_REM_LIMIT_EXT …
#define LM90_HAVE_EMERGENCY …
#define LM90_HAVE_EMERGENCY_ALARM …
#define LM90_HAVE_TEMP3 …
#define LM90_HAVE_BROKEN_ALERT …
#define LM90_PAUSE_FOR_CONFIG …
#define LM90_HAVE_CRIT …
#define LM90_HAVE_CRIT_ALRM_SWP …
#define LM90_HAVE_PEC …
#define LM90_HAVE_PARTIAL_PEC …
#define LM90_HAVE_ALARMS …
#define LM90_HAVE_EXT_UNSIGNED …
#define LM90_HAVE_LOW …
#define LM90_HAVE_CONVRATE …
#define LM90_HAVE_REMOTE_EXT …
#define LM90_HAVE_FAULTQUEUE …
#define LM90_STATUS_LTHRM …
#define LM90_STATUS_RTHRM …
#define LM90_STATUS_ROPEN …
#define LM90_STATUS_RLOW …
#define LM90_STATUS_RHIGH …
#define LM90_STATUS_LLOW …
#define LM90_STATUS_LHIGH …
#define LM90_STATUS_BUSY …
#define MAX6696_STATUS2_R2THRM …
#define MAX6696_STATUS2_R2OPEN …
#define MAX6696_STATUS2_R2LOW …
#define MAX6696_STATUS2_R2HIGH …
#define MAX6696_STATUS2_ROT2 …
#define MAX6696_STATUS2_R2OT2 …
#define MAX6696_STATUS2_LOT2 …
static const struct i2c_device_id lm90_id[] = …;
MODULE_DEVICE_TABLE(i2c, lm90_id);
static const struct of_device_id __maybe_unused lm90_of_match[] = …;
MODULE_DEVICE_TABLE(of, lm90_of_match);
struct lm90_params { … };
static const struct lm90_params lm90_params[] = …;
enum lm90_temp_reg_index { … };
struct lm90_data { … };
static inline s32 lm90_write_no_pec(struct i2c_client *client, u8 value)
{ … }
static int lm90_read_reg(struct i2c_client *client, u8 reg)
{ … }
static u8 lm90_write_reg_addr(u8 reg)
{ … }
static int lm90_write_reg(struct i2c_client *client, u8 reg, u8 val)
{ … }
static int lm90_write16(struct i2c_client *client, u8 regh, u8 regl, u16 val)
{ … }
static int lm90_read16(struct i2c_client *client, u8 regh, u8 regl,
bool is_volatile)
{ … }
static int lm90_update_confreg(struct lm90_data *data, u8 config)
{ … }
static int lm90_select_remote_channel(struct lm90_data *data, bool second)
{ … }
static int lm90_write_convrate(struct lm90_data *data, int val)
{ … }
static int lm90_set_convrate(struct i2c_client *client, struct lm90_data *data,
unsigned int interval)
{ … }
static int lm90_set_faultqueue(struct i2c_client *client,
struct lm90_data *data, int val)
{ … }
static int lm90_update_limits(struct device *dev)
{ … }
static void lm90_report_alarms(struct work_struct *work)
{ … }
static int lm90_update_alarms_locked(struct lm90_data *data, bool force)
{ … }
static int lm90_update_alarms(struct lm90_data *data, bool force)
{ … }
static void lm90_alert_work(struct work_struct *__work)
{ … }
static int lm90_update_device(struct device *dev)
{ … }
static int lm90_temp_get_resolution(struct lm90_data *data, int index)
{ … }
static int lm90_temp_from_reg(u32 flags, u16 regval, u8 resolution)
{ … }
static int lm90_get_temp(struct lm90_data *data, int index, int channel)
{ … }
static u16 lm90_temp_to_reg(u32 flags, long val, u8 resolution)
{ … }
static int lm90_set_temp(struct lm90_data *data, int index, int channel, long val)
{ … }
static int lm90_get_temphyst(struct lm90_data *data, int index, int channel)
{ … }
static int lm90_set_temphyst(struct lm90_data *data, long val)
{ … }
static int lm90_get_temp_offset(struct lm90_data *data, int index)
{ … }
static int lm90_set_temp_offset(struct lm90_data *data, int index, int channel, long val)
{ … }
static const u8 lm90_temp_index[MAX_CHANNELS] = …;
static const u8 lm90_temp_min_index[MAX_CHANNELS] = …;
static const u8 lm90_temp_max_index[MAX_CHANNELS] = …;
static const u8 lm90_temp_crit_index[MAX_CHANNELS] = …;
static const u8 lm90_temp_emerg_index[MAX_CHANNELS] = …;
static const s8 lm90_temp_offset_index[MAX_CHANNELS] = …;
static const u16 lm90_min_alarm_bits[MAX_CHANNELS] = …;
static const u16 lm90_max_alarm_bits[MAX_CHANNELS] = …;
static const u16 lm90_crit_alarm_bits[MAX_CHANNELS] = …;
static const u16 lm90_crit_alarm_bits_swapped[MAX_CHANNELS] = …;
static const u16 lm90_emergency_alarm_bits[MAX_CHANNELS] = …;
static const u16 lm90_fault_bits[MAX_CHANNELS] = …;
static int lm90_temp_read(struct device *dev, u32 attr, int channel, long *val)
{ … }
static int lm90_temp_write(struct device *dev, u32 attr, int channel, long val)
{ … }
static umode_t lm90_temp_is_visible(const void *data, u32 attr, int channel)
{ … }
static int lm90_chip_read(struct device *dev, u32 attr, int channel, long *val)
{ … }
static int lm90_chip_write(struct device *dev, u32 attr, int channel, long val)
{ … }
static umode_t lm90_chip_is_visible(const void *data, u32 attr, int channel)
{ … }
static int lm90_read(struct device *dev, enum hwmon_sensor_types type,
u32 attr, int channel, long *val)
{ … }
static int lm90_read_string(struct device *dev, enum hwmon_sensor_types type,
u32 attr, int channel, const char **str)
{ … }
static int lm90_write(struct device *dev, enum hwmon_sensor_types type,
u32 attr, int channel, long val)
{ … }
static umode_t lm90_is_visible(const void *data, enum hwmon_sensor_types type,
u32 attr, int channel)
{ … }
static const char *lm90_detect_lm84(struct i2c_client *client)
{ … }
static const char *lm90_detect_max1617(struct i2c_client *client, int config1)
{ … }
static const char *lm90_detect_national(struct i2c_client *client, int chip_id,
int config1, int convrate)
{ … }
static const char *lm90_detect_on(struct i2c_client *client, int chip_id, int config1,
int convrate)
{ … }
static const char *lm90_detect_analog(struct i2c_client *client, bool common_address,
int chip_id, int config1, int convrate)
{ … }
static const char *lm90_detect_maxim(struct i2c_client *client, bool common_address,
int chip_id, int config1, int convrate)
{ … }
static const char *lm90_detect_nuvoton(struct i2c_client *client, int chip_id,
int config1, int convrate)
{ … }
static const char *lm90_detect_nxp(struct i2c_client *client, bool common_address,
int chip_id, int config1, int convrate)
{ … }
static const char *lm90_detect_gmt(struct i2c_client *client, int chip_id,
int config1, int convrate)
{ … }
static const char *lm90_detect_ti49(struct i2c_client *client, bool common_address,
int chip_id, int config1, int convrate)
{ … }
static const char *lm90_detect_ti(struct i2c_client *client, int chip_id,
int config1, int convrate)
{ … }
static int lm90_detect(struct i2c_client *client, struct i2c_board_info *info)
{ … }
static void lm90_restore_conf(void *_data)
{ … }
static int lm90_init_client(struct i2c_client *client, struct lm90_data *data)
{ … }
static bool lm90_is_tripped(struct i2c_client *client)
{ … }
static irqreturn_t lm90_irq_thread(int irq, void *dev_id)
{ … }
static int lm90_probe_channel_from_dt(struct i2c_client *client,
struct device_node *child,
struct lm90_data *data)
{ … }
static int lm90_parse_dt_channel_info(struct i2c_client *client,
struct lm90_data *data)
{ … }
static const struct hwmon_ops lm90_ops = …;
static int lm90_probe(struct i2c_client *client)
{ … }
static void lm90_alert(struct i2c_client *client, enum i2c_alert_protocol type,
unsigned int flag)
{ … }
static int lm90_suspend(struct device *dev)
{ … }
static int lm90_resume(struct device *dev)
{ … }
static DEFINE_SIMPLE_DEV_PM_OPS(lm90_pm_ops, lm90_suspend, lm90_resume);
static struct i2c_driver lm90_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;