linux/drivers/hwmon/w83l785ts.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * w83l785ts.c - Part of lm_sensors, Linux kernel modules for hardware
 *               monitoring
 * Copyright (C) 2003-2009  Jean Delvare <[email protected]>
 *
 * Inspired from the lm83 driver. The W83L785TS-S is a sensor chip made
 * by Winbond. It reports a single external temperature with a 1 deg
 * resolution and a 3 deg accuracy. Datasheet can be obtained from
 * Winbond's website at:
 *   http://www.winbond-usa.com/products/winbond_products/pdfs/PCIC/W83L785TS-S.pdf
 *
 * Ported to Linux 2.6 by Wolfgang Ziegler <[email protected]> and Jean Delvare
 * <[email protected]>.
 *
 * Thanks to James Bolt <[email protected]> for benchmarking the read
 * error handling mechanism.
 */

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

/* How many retries on register read error */
#define MAX_RETRIES

/*
 * Address to scan
 * Address is fully defined internally and cannot be changed.
 */

static const unsigned short normal_i2c[] =;

/*
 * The W83L785TS-S registers
 * Manufacturer ID is 0x5CA3 for Winbond.
 */

#define W83L785TS_REG_MAN_ID1
#define W83L785TS_REG_MAN_ID2
#define W83L785TS_REG_CHIP_ID
#define W83L785TS_REG_CONFIG
#define W83L785TS_REG_TYPE
#define W83L785TS_REG_TEMP
#define W83L785TS_REG_TEMP_OVER

/*
 * Conversions
 * The W83L785TS-S uses signed 8-bit values.
 */

#define TEMP_FROM_REG(val)

/*
 * Functions declaration
 */

static int w83l785ts_probe(struct i2c_client *client);
static int w83l785ts_detect(struct i2c_client *client,
			    struct i2c_board_info *info);
static void w83l785ts_remove(struct i2c_client *client);
static u8 w83l785ts_read_value(struct i2c_client *client, u8 reg, u8 defval);
static struct w83l785ts_data *w83l785ts_update_device(struct device *dev);

/*
 * Driver data (common to all clients)
 */

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

static struct i2c_driver w83l785ts_driver =;

/*
 * Client data (each client gets its own)
 */

struct w83l785ts_data {};

/*
 * Sysfs stuff
 */

static ssize_t show_temp(struct device *dev, struct device_attribute *devattr,
	char *buf)
{}

static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, show_temp, NULL, 0);
static SENSOR_DEVICE_ATTR(temp1_max, S_IRUGO, show_temp, NULL, 1);

/*
 * Real code
 */

/* Return 0 if detection is successful, -ENODEV otherwise */
static int w83l785ts_detect(struct i2c_client *client,
			    struct i2c_board_info *info)
{}

static int w83l785ts_probe(struct i2c_client *client)
{}

static void w83l785ts_remove(struct i2c_client *client)
{}

static u8 w83l785ts_read_value(struct i2c_client *client, u8 reg, u8 defval)
{}

static struct w83l785ts_data *w83l785ts_update_device(struct device *dev)
{}

module_i2c_driver();

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