linux/drivers/hwmon/lm75.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * lm75.c - Part of lm_sensors, Linux kernel modules for hardware
 *	 monitoring
 * Copyright (c) 1998, 1999  Frodo Looijaard <[email protected]>
 */

#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"

/*
 * This driver handles the LM75 and compatible digital temperature sensors.
 */

enum lm75_type {};

/**
 * struct lm75_params - lm75 configuration parameters.
 * @config_reg_16bits:	Configure register size is 2 bytes.
 * @set_mask:		Bits to set in configuration register when configuring
 *			the chip.
 * @clr_mask:		Bits to clear in configuration register when configuring
 *			the chip.
 * @default_resolution:	Default number of bits to represent the temperature
 *			value.
 * @resolution_limits:	Limit register resolution. Optional. Should be set if
 *			the resolution of limit registers does not match the
 *			resolution of the temperature register.
 * @resolutions:	List of resolutions associated with sample times.
 *			Optional. Should be set if num_sample_times is larger
 *			than 1, and if the resolution changes with sample times.
 *			If set, number of entries must match num_sample_times.
 * @default_sample_time:Sample time to be set by default.
 * @num_sample_times:	Number of possible sample times to be set. Optional.
 *			Should be set if the number of sample times is larger
 *			than one.
 * @sample_times:	All the possible sample times to be set. Mandatory if
 *			num_sample_times is larger than 1. If set, number of
 *			entries must match num_sample_times.
 * @alarm:		Alarm bit is supported.
 */

struct lm75_params {};

/* Addresses scanned */
static const unsigned short normal_i2c[] =;

/* The LM75 registers */
#define LM75_REG_TEMP
#define LM75_REG_CONF
#define LM75_REG_HYST
#define LM75_REG_MAX
#define PCT2075_REG_IDLE

/* Each client has this additional data */
struct lm75_data {};

/*-----------------------------------------------------------------------*/

static const u8 lm75_sample_set_masks[] =;

#define LM75_SAMPLE_CLEAR_MASK

/* The structure below stores the configuration values of the supported devices.
 * In case of being supported multiple configurations, the default one must
 * always be the first element of the array
 */
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

/* Return 0 if detection is successful, -ENODEV otherwise */
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 /* CONFIG_PM */

static struct i2c_driver lm75_driver =;

module_i2c_driver();

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