#include <linux/module.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/slab.h>
#include <linux/jiffies.h>
#include <linux/i2c.h>
#include <linux/hwmon.h>
#include <linux/err.h>
#include <linux/of.h>
#include <linux/regmap.h>
#include <linux/util_macros.h>
#include <linux/regulator/consumer.h>
#include "lm75.h"
enum lm75_type { … };
struct lm75_params { … };
static const unsigned short normal_i2c[] = …;
#define LM75_REG_TEMP …
#define LM75_REG_CONF …
#define LM75_REG_HYST …
#define LM75_REG_MAX …
#define PCT2075_REG_IDLE …
struct lm75_data { … };
static const u8 lm75_sample_set_masks[] = …;
#define LM75_SAMPLE_CLEAR_MASK …
static const struct lm75_params device_params[] = …;
static inline long lm75_reg_to_mc(s16 temp, u8 resolution)
{ … }
static int lm75_write_config(struct lm75_data *data, u16 set_mask,
u16 clr_mask)
{ … }
static int lm75_read_config(struct lm75_data *data)
{ … }
static irqreturn_t lm75_alarm_handler(int irq, void *private)
{ … }
static int lm75_read(struct device *dev, enum hwmon_sensor_types type,
u32 attr, int channel, long *val)
{ … }
static int lm75_write_temp(struct device *dev, u32 attr, long temp)
{ … }
static int lm75_update_interval(struct device *dev, long val)
{ … }
static int lm75_write_chip(struct device *dev, u32 attr, long val)
{ … }
static int lm75_write(struct device *dev, enum hwmon_sensor_types type,
u32 attr, int channel, long val)
{ … }
static umode_t lm75_is_visible(const void *data, enum hwmon_sensor_types type,
u32 attr, int channel)
{ … }
static const struct hwmon_channel_info * const lm75_info[] = …;
static const struct hwmon_ops lm75_hwmon_ops = …;
static const struct hwmon_chip_info lm75_chip_info = …;
static bool lm75_is_writeable_reg(struct device *dev, unsigned int reg)
{ … }
static bool lm75_is_volatile_reg(struct device *dev, unsigned int reg)
{ … }
static const struct regmap_config lm75_regmap_config = …;
static void lm75_disable_regulator(void *data)
{ … }
static void lm75_remove(void *data)
{ … }
static int lm75_probe(struct i2c_client *client)
{ … }
static const struct i2c_device_id lm75_ids[] = …;
MODULE_DEVICE_TABLE(i2c, lm75_ids);
static const struct of_device_id __maybe_unused lm75_of_match[] = …;
MODULE_DEVICE_TABLE(of, lm75_of_match);
#define LM75A_ID …
static int lm75_detect(struct i2c_client *new_client,
struct i2c_board_info *info)
{ … }
#ifdef CONFIG_PM
static int lm75_suspend(struct device *dev)
{ … }
static int lm75_resume(struct device *dev)
{ … }
static const struct dev_pm_ops lm75_dev_pm_ops = …;
#define LM75_DEV_PM_OPS …
#else
#define LM75_DEV_PM_OPS …
#endif
static struct i2c_driver lm75_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;