#include <linux/module.h>
#include <linux/hwmon-sysfs.h>
#include <linux/platform_device.h>
#define DRVNAME "i5k_amb"
#define I5K_REG_AMB_BASE_ADDR 0x48
#define I5K_REG_AMB_LEN_ADDR 0x50
#define I5K_REG_CHAN0_PRESENCE_ADDR 0x64
#define I5K_REG_CHAN1_PRESENCE_ADDR 0x66
#define AMB_REG_TEMP_MIN_ADDR 0x80
#define AMB_REG_TEMP_MID_ADDR 0x81
#define AMB_REG_TEMP_MAX_ADDR 0x82
#define AMB_REG_TEMP_STATUS_ADDR 0x84
#define AMB_REG_TEMP_ADDR 0x85
#define AMB_CONFIG_SIZE 2048
#define AMB_FUNC_3_OFFSET 768
static unsigned long amb_reg_temp_status(unsigned int amb)
return AMB_FUNC_3_OFFSET + AMB_REG_TEMP_STATUS_ADDR +
static unsigned long amb_reg_temp_min(unsigned int amb)
return AMB_FUNC_3_OFFSET + AMB_REG_TEMP_MIN_ADDR +
static unsigned long amb_reg_temp_mid(unsigned int amb)
return AMB_FUNC_3_OFFSET + AMB_REG_TEMP_MID_ADDR +
static unsigned long amb_reg_temp_max(unsigned int amb)
return AMB_FUNC_3_OFFSET + AMB_REG_TEMP_MAX_ADDR +
static unsigned long amb_reg_temp(unsigned int amb)
return AMB_FUNC_3_OFFSET + AMB_REG_TEMP_ADDR +
#define MAX_MEM_CHANNELS 4
#define MAX_AMBS_PER_CHANNEL 16
#define MAX_AMBS (MAX_MEM_CHANNELS * \
#define REAL_MAX_AMBS_PER_CHANNEL 15