linux/drivers/hwmon/tmp102.c

// SPDX-License-Identifier: GPL-2.0-or-later
/* Texas Instruments TMP102 SMBus temperature sensor driver
 *
 * Copyright (C) 2010 Steven King <[email protected]>
 */

#include <linux/delay.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/i2c.h>
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
#include <linux/err.h>
#include <linux/mutex.h>
#include <linux/device.h>
#include <linux/jiffies.h>
#include <linux/regmap.h>
#include <linux/of.h>

#define DRIVER_NAME

#define TMP102_TEMP_REG
#define TMP102_CONF_REG
/* note: these bit definitions are byte swapped */
#define TMP102_CONF_SD
#define TMP102_CONF_TM
#define TMP102_CONF_POL
#define TMP102_CONF_F0
#define TMP102_CONF_F1
#define TMP102_CONF_R0
#define TMP102_CONF_R1
#define TMP102_CONF_OS
#define TMP102_CONF_EM
#define TMP102_CONF_AL
#define TMP102_CONF_CR0
#define TMP102_CONF_CR1
#define TMP102_TLOW_REG
#define TMP102_THIGH_REG

#define TMP102_CONFREG_MASK

#define TMP102_CONFIG_CLEAR
#define TMP102_CONFIG_SET

#define CONVERSION_TIME_MS

struct tmp102 {};

/* convert left adjusted 13-bit TMP102 register value to milliCelsius */
static inline int tmp102_reg_to_mC(s16 val)
{}

/* convert milliCelsius to left adjusted 13-bit TMP102 register value */
static inline u16 tmp102_mC_to_reg(int val)
{}

static int tmp102_read(struct device *dev, enum hwmon_sensor_types type,
		       u32 attr, int channel, long *temp)
{}

static int tmp102_write(struct device *dev, enum hwmon_sensor_types type,
			u32 attr, int channel, long temp)
{}

static umode_t tmp102_is_visible(const void *data, enum hwmon_sensor_types type,
				 u32 attr, int channel)
{}

static const struct hwmon_channel_info * const tmp102_info[] =;

static const struct hwmon_ops tmp102_hwmon_ops =;

static const struct hwmon_chip_info tmp102_chip_info =;

static void tmp102_restore_config(void *data)
{}

static bool tmp102_is_writeable_reg(struct device *dev, unsigned int reg)
{}

static bool tmp102_is_volatile_reg(struct device *dev, unsigned int reg)
{}

static const struct regmap_config tmp102_regmap_config =;

static int tmp102_probe(struct i2c_client *client)
{}

static int tmp102_suspend(struct device *dev)
{}

static int tmp102_resume(struct device *dev)
{}

static DEFINE_SIMPLE_DEV_PM_OPS(tmp102_dev_pm_ops, tmp102_suspend, tmp102_resume);

static const struct i2c_device_id tmp102_id[] =;
MODULE_DEVICE_TABLE(i2c, tmp102_id);

static const struct of_device_id __maybe_unused tmp102_of_match[] =;
MODULE_DEVICE_TABLE(of, tmp102_of_match);

static struct i2c_driver tmp102_driver =;

module_i2c_driver();

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();