/* * adt7475 - Thermal sensor driver for the ADT7475 chip and derivatives * Copyright (C) 2007-2008, Advanced Micro Devices, Inc. * Copyright (C) 2008 Jordan Crouse <jordan@cosmicpenguin.net> * Copyright (C) 2008 Hans de Goede <hdegoede@redhat.com> * Copyright (C) 2009 Jean Delvare <khali@linux-fr.org> * * Derived from the lm83 driver by Jean Delvare * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */#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>/* Indexes for the sysfs hooks */#define INPUT 0#define MIN 1#define MAX 2#define CONTROL 3#define OFFSET 3#define AUTOMIN 4#define THERM 5#define HYSTERSIS 6/* These are unique identifiers for the sysfs functions - unlike the numbers above, these are not also indexes into an array*/#define ALARM 9#define FAULT 10/* 7475 Common Registers */#define REG_DEVREV2 0x12 /* ADT7490 only */#define REG_VTT 0x1E /* ADT7490 only */#define REG_EXTEND3 0x1F /* ADT7490 only */#define REG_VOLTAGE_BASE 0x20#define REG_TEMP_BASE 0x25#define REG_TACH_BASE 0x28#define REG_PWM_BASE 0x30#define REG_PWM_MAX_BASE 0x38#define REG_DEVID 0x3D#define REG_VENDID 0x3E#define REG_DEVID2 0x3F#define REG_STATUS1 0x41#define REG_STATUS2 0x42#define REG_VOLTAGE_MIN_BASE 0x44#define REG_VOLTAGE_MAX_BASE 0x45#define REG_TEMP_MIN_BASE 0x4E#define REG_TEMP_MAX_BASE 0x4F#define REG_TACH_MIN_BASE 0x54#define REG_PWM_CONFIG_BASE 0x5C#define REG_TEMP_TRANGE_BASE 0x5F#define REG_PWM_MIN_BASE 0x64#define REG_TEMP_TMIN_BASE 0x67#define REG_TEMP_THERM_BASE 0x6A#define REG_REMOTE1_HYSTERSIS 0x6D#define REG_REMOTE2_HYSTERSIS 0x6E#define REG_TEMP_OFFSET_BASE 0x70#define REG_CONFIG2 0x73#define REG_EXTEND1 0x76#define REG_EXTEND2 0x77#define REG_CONFIG3 0x78#define REG_CONFIG5 0x7C#define REG_CONFIG4 0x7D