#include <linux/bitfield.h>
#include <linux/bits.h>
#include <linux/err.h>
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
#include <linux/i2c.h>
#include <linux/regmap.h>
#include <linux/util_macros.h>
#define REG_CR1 …
#define CR1_HYST …
#define CR1_DRV …
#define CR1_TEMP_SRC …
#define REG_CR2 …
#define CR2_STBY …
#define CR2_ALERTS …
#define CR2_DFC …
#define REG_CR3 …
#define REG_PWMR …
#define REG_PWMV …
#define REG_STATUS …
#define STATUS_ALARM_CRIT(ch) …
#define STATUS_ALARM_MAX(ch) …
#define STATUS_RDFA …
#define REG_TACH(ch) …
#define REG_TEMP_INPUT(ch) …
#define REG_TEMP_MAX(ch) …
#define REG_TEMP_CRIT(ch) …
#define TEMP11_FROM_REG(reg) …
#define TEMP11_TO_REG(val) …
#define LUT_SIZE …
#define REG_LUT(index) …
struct max31760_state { … };
static bool max31760_volatile_reg(struct device *dev, unsigned int reg)
{ … }
static const struct regmap_config regmap_config = …;
static const int max31760_pwm_freq[] = …;
static int tach_to_rpm(u16 tach)
{ … }
static int max31760_read(struct device *dev, enum hwmon_sensor_types type,
u32 attr, int channel, long *val)
{ … }
static int max31760_write(struct device *dev, enum hwmon_sensor_types type,
u32 attr, int channel, long val)
{ … }
static const struct hwmon_channel_info * const max31760_info[] = …;
static umode_t max31760_is_visible(const void *data,
enum hwmon_sensor_types type,
u32 attr, int channel)
{ … }
static int max31760_read_string(struct device *dev,
enum hwmon_sensor_types type,
u32 attr, int channel, const char **str)
{ … }
static const struct hwmon_ops max31760_hwmon_ops = …;
static const struct hwmon_chip_info max31760_chip_info = …;
static ssize_t lut_show(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t lut_store(struct device *dev,
struct device_attribute *devattr,
const char *buf, size_t count)
{ … }
static ssize_t pwm1_auto_point_temp_hyst_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t pwm1_auto_point_temp_hyst_store(struct device *dev,
struct device_attribute *attr,
const char *buf,
size_t count)
{ … }
static DEVICE_ATTR_RW(pwm1_auto_point_temp_hyst);
static void max31760_create_lut_nodes(struct max31760_state *state)
{ … }
static int max31760_probe(struct i2c_client *client)
{ … }
static const struct of_device_id max31760_of_match[] = …;
MODULE_DEVICE_TABLE(of, max31760_of_match);
static const struct i2c_device_id max31760_id[] = …;
MODULE_DEVICE_TABLE(i2c, max31760_id);
static int max31760_suspend(struct device *dev)
{ … }
static int max31760_resume(struct device *dev)
{ … }
static DEFINE_SIMPLE_DEV_PM_OPS(max31760_pm_ops, max31760_suspend,
max31760_resume);
static struct i2c_driver max31760_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_SOFTDEP(…) …;
MODULE_VERSION(…) …;
MODULE_LICENSE(…) …;