#include <linux/bits.h>
#include <linux/err.h>
#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/hwmon.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/slab.h>
static const unsigned short normal_i2c[] = …;
#define MAX31730_REG_TEMP …
#define MAX31730_REG_CONF …
#define MAX31730_STOP …
#define MAX31730_EXTRANGE …
#define MAX31730_REG_TEMP_OFFSET …
#define MAX31730_TEMP_OFFSET_BASELINE …
#define MAX31730_REG_OFFSET_ENABLE …
#define MAX31730_REG_TEMP_MAX …
#define MAX31730_REG_TEMP_MIN …
#define MAX31730_REG_STATUS_HIGH …
#define MAX31730_REG_STATUS_LOW …
#define MAX31730_REG_CHANNEL_ENABLE …
#define MAX31730_REG_TEMP_FAULT …
#define MAX31730_REG_MFG_ID …
#define MAX31730_MFG_ID …
#define MAX31730_REG_MFG_REV …
#define MAX31730_MFG_REV …
#define MAX31730_TEMP_MIN …
#define MAX31730_TEMP_MAX …
struct max31730_data { … };
static inline long max31730_reg_to_mc(s16 temp)
{ … }
static int max31730_write_config(struct max31730_data *data, u8 set_mask,
u8 clr_mask)
{ … }
static int max31730_set_enable(struct i2c_client *client, int reg,
u8 *confdata, int channel, bool enable)
{ … }
static int max31730_set_offset_enable(struct max31730_data *data, int channel,
bool enable)
{ … }
static int max31730_set_channel_enable(struct max31730_data *data, int channel,
bool enable)
{ … }
static int max31730_read(struct device *dev, enum hwmon_sensor_types type,
u32 attr, int channel, long *val)
{ … }
static int max31730_write(struct device *dev, enum hwmon_sensor_types type,
u32 attr, int channel, long val)
{ … }
static umode_t max31730_is_visible(const void *data,
enum hwmon_sensor_types type,
u32 attr, int channel)
{ … }
static const struct hwmon_channel_info * const max31730_info[] = …;
static const struct hwmon_ops max31730_hwmon_ops = …;
static const struct hwmon_chip_info max31730_chip_info = …;
static void max31730_remove(void *data)
{ … }
static int
max31730_probe(struct i2c_client *client)
{ … }
static const struct i2c_device_id max31730_ids[] = …;
MODULE_DEVICE_TABLE(i2c, max31730_ids);
static const struct of_device_id __maybe_unused max31730_of_match[] = …;
MODULE_DEVICE_TABLE(of, max31730_of_match);
static bool max31730_check_reg_temp(struct i2c_client *client,
int reg)
{ … }
static int max31730_detect(struct i2c_client *client,
struct i2c_board_info *info)
{ … }
static int max31730_suspend(struct device *dev)
{ … }
static int max31730_resume(struct device *dev)
{ … }
static DEFINE_SIMPLE_DEV_PM_OPS(max31730_pm_ops, max31730_suspend, max31730_resume);
static struct i2c_driver max31730_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;