linux/drivers/hwmon/asc7621.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * asc7621.c - Part of lm_sensors, Linux kernel modules for hardware monitoring
 * Copyright (c) 2007, 2010 George Joseph  <[email protected]>
 */

#include <linux/module.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>

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

enum asc7621_type {};

#define INTERVAL_HIGH
#define INTERVAL_LOW
#define PRI_NONE
#define PRI_LOW
#define PRI_HIGH
#define FIRST_CHIP
#define LAST_CHIP

struct asc7621_chip {};

static struct asc7621_chip asc7621_chips[] =;

/*
 * Defines the highest register to be used, not the count.
 * The actual count will probably be smaller because of gaps
 * in the implementation (unused register locations).
 * This define will safely set the array size of both the parameter
 * and data arrays.
 * This comes from the data sheet register description table.
 */
#define LAST_REGISTER

struct asc7621_data {};

/*
 * Macro to get the parent asc7621_param structure
 * from a sensor_device_attribute passed into the
 * show/store functions.
 */
#define to_asc7621_param(_sda)

/*
 * Each parameter to be retrieved needs an asc7621_param structure
 * allocated.  It contains the sensor_device_attribute structure
 * and the control info needed to retrieve the value from the register map.
 */
struct asc7621_param {};

/*
 * This is the map that ultimately indicates whether we'll be
 * retrieving a register value or not, and at what frequency.
 */
static u8 asc7621_register_priorities[255];

static struct asc7621_data *asc7621_update_device(struct device *dev);

static inline u8 read_byte(struct i2c_client *client, u8 reg)
{}

static inline int write_byte(struct i2c_client *client, u8 reg, u8 data)
{}

/*
 * Data Handlers
 * Each function handles the formatting, storage
 * and retrieval of like parameters.
 */

#define SETUP_SHOW_DATA_PARAM(d, a)

#define SETUP_STORE_DATA_PARAM(d, a)

/*
 * u8 is just what it sounds like...an unsigned byte with no
 * special formatting.
 */
static ssize_t show_u8(struct device *dev, struct device_attribute *attr,
		       char *buf)
{}

static ssize_t store_u8(struct device *dev, struct device_attribute *attr,
			const char *buf, size_t count)
{}

/*
 * Many of the config values occupy only a few bits of a register.
 */
static ssize_t show_bitmask(struct device *dev,
			    struct device_attribute *attr, char *buf)
{}

static ssize_t store_bitmask(struct device *dev,
			     struct device_attribute *attr,
			     const char *buf, size_t count)
{}

/*
 * 16 bit fan rpm values
 * reported by the device as the number of 11.111us periods (90khz)
 * between full fan rotations.  Therefore...
 * RPM = (90000 * 60) / register value
 */
static ssize_t show_fan16(struct device *dev,
			  struct device_attribute *attr, char *buf)
{}

static ssize_t store_fan16(struct device *dev,
			   struct device_attribute *attr, const char *buf,
			   size_t count)
{}

/*
 * Voltages are scaled in the device so that the nominal voltage
 * is 3/4ths of the 0-255 range (i.e. 192).
 * If all voltages are 'normal' then all voltage registers will
 * read 0xC0.
 *
 * The data sheet provides us with the 3/4 scale value for each voltage
 * which is stored in in_scaling.  The sda->index parameter value provides
 * the index into in_scaling.
 *
 * NOTE: The chip expects the first 2 inputs be 2.5 and 2.25 volts
 * respectively. That doesn't mean that's what the motherboard provides. :)
 */

static const int asc7621_in_scaling[] =;

static ssize_t show_in10(struct device *dev, struct device_attribute *attr,
			 char *buf)
{}

/* 8 bit voltage values (the mins and maxs) */
static ssize_t show_in8(struct device *dev, struct device_attribute *attr,
			char *buf)
{}

static ssize_t store_in8(struct device *dev, struct device_attribute *attr,
			 const char *buf, size_t count)
{}

static ssize_t show_temp8(struct device *dev,
			  struct device_attribute *attr, char *buf)
{}

static ssize_t store_temp8(struct device *dev,
			   struct device_attribute *attr, const char *buf,
			   size_t count)
{}

/*
 * Temperatures that occupy 2 bytes always have the whole
 * number of degrees in the MSB with some part of the LSB
 * indicating fractional degrees.
 */

/*   mmmmmmmm.llxxxxxx */
static ssize_t show_temp10(struct device *dev,
			   struct device_attribute *attr, char *buf)
{}

/*   mmmmmm.ll */
static ssize_t show_temp62(struct device *dev,
			   struct device_attribute *attr, char *buf)
{}

static ssize_t store_temp62(struct device *dev,
			    struct device_attribute *attr, const char *buf,
			    size_t count)
{}

/*
 * The aSC7621 doesn't provide an "auto_point2".  Instead, you
 * specify the auto_point1 and a range.  To keep with the sysfs
 * hwmon specs, we synthesize the auto_point_2 from them.
 */

static const u32 asc7621_range_map[] =;

static ssize_t show_ap2_temp(struct device *dev,
			     struct device_attribute *attr, char *buf)
{}

static ssize_t store_ap2_temp(struct device *dev,
			      struct device_attribute *attr,
			      const char *buf, size_t count)
{}

static ssize_t show_pwm_ac(struct device *dev,
			   struct device_attribute *attr, char *buf)
{}

static ssize_t store_pwm_ac(struct device *dev,
			    struct device_attribute *attr,
			    const char *buf, size_t count)
{}

static ssize_t show_pwm_enable(struct device *dev,
			       struct device_attribute *attr, char *buf)
{}

static ssize_t store_pwm_enable(struct device *dev,
				struct device_attribute *attr,
				const char *buf, size_t count)
{}

static const u32 asc7621_pwm_freq_map[] =;

static ssize_t show_pwm_freq(struct device *dev,
			     struct device_attribute *attr, char *buf)
{}

static ssize_t store_pwm_freq(struct device *dev,
			      struct device_attribute *attr,
			      const char *buf, size_t count)
{}

static const u32 asc7621_pwm_auto_spinup_map[] =;

static ssize_t show_pwm_ast(struct device *dev,
			    struct device_attribute *attr, char *buf)
{}

static ssize_t store_pwm_ast(struct device *dev,
			     struct device_attribute *attr,
			     const char *buf, size_t count)
{}

static const u32 asc7621_temp_smoothing_time_map[] =;

static ssize_t show_temp_st(struct device *dev,
			    struct device_attribute *attr, char *buf)
{}

static ssize_t store_temp_st(struct device *dev,
			     struct device_attribute *attr,
			     const char *buf, size_t count)
{}

/*
 * End of data handlers
 *
 * These defines do nothing more than make the table easier
 * to read when wrapped at column 80.
 */

/*
 * Creates a variable length array inititalizer.
 * VAA(1,3,5,7) would produce {1,3,5,7}
 */
#define VAA(args...)

#define PREAD(name, n, pri, rm, rl, m, s, r)

#define PWRITE(name, n, pri, rm, rl, m, s, r)

/*
 * PWRITEM assumes that the initializers for the .msb, .lsb, .mask and .shift
 * were created using the VAA macro.
 */
#define PWRITEM(name, n, pri, rm, rl, m, s, r)

static struct asc7621_param asc7621_params[] =;

static struct asc7621_data *asc7621_update_device(struct device *dev)
{}

/*
 * Standard detection and initialization below
 *
 * Helper function that checks if an address is valid
 * for a particular chip.
 */

static inline int valid_address_for_chip(int chip_type, int address)
{}

static void asc7621_init_client(struct i2c_client *client)
{}

static int
asc7621_probe(struct i2c_client *client)
{}

static int asc7621_detect(struct i2c_client *client,
			  struct i2c_board_info *info)
{}

static void asc7621_remove(struct i2c_client *client)
{}

static const struct i2c_device_id asc7621_id[] =;

MODULE_DEVICE_TABLE(i2c, asc7621_id);

static struct i2c_driver asc7621_driver =;

static int __init sm_asc7621_init(void)
{}

static void __exit sm_asc7621_exit(void)
{}

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

module_init();
module_exit(sm_asc7621_exit);