mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-11-25 20:28:21 +00:00
(Kyösti) Cleanups
Copy sysctl enums to chip drivers from sensors.h for now, as seen in drivers included in 2.5 tree. File no longer included from kernel side. Apply i2c-proc change in CVS tagged -km2. Partial clean and sort of includes everywhere. Add i2c-dev.h, as a partial copy from i2c. Add to sensors.h from i2c-proc.h to compile things. Remove i2c-isa.h. Reflect header file changes to lib/ and prog/. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1705 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
d2e650b473
commit
1cfe63804a
68 files changed
+1609
-879
No files matched your search
+40
-18
@@ -18,19 +18,18 @@
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#include <linux/version.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/proc_fs.h>
|
||||
#include <linux/ioport.h>
|
||||
#include <linux/sysctl.h>
|
||||
#include <asm/errno.h>
|
||||
#include <asm/io.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/i2c.h>
|
||||
#include "version.h"
|
||||
#include "sensors.h"
|
||||
#include <linux/i2c-proc.h>
|
||||
#include <linux/init.h>
|
||||
#include <asm/errno.h>
|
||||
#include <asm/io.h>
|
||||
#include "version.h"
|
||||
|
||||
MODULE_LICENSE("GPL");
|
||||
|
||||
@@ -197,8 +196,6 @@ static int lm78_attach_adapter(struct i2c_adapter *adapter);
|
||||
static int lm78_detect(struct i2c_adapter *adapter, int address,
|
||||
unsigned short flags, int kind);
|
||||
static int lm78_detach_client(struct i2c_client *client);
|
||||
static int lm78_command(struct i2c_client *client, unsigned int cmd,
|
||||
void *arg);
|
||||
|
||||
static int lm78_read_value(struct i2c_client *client, u8 register);
|
||||
static int lm78_write_value(struct i2c_client *client, u8 register,
|
||||
@@ -227,12 +224,46 @@ static struct i2c_driver lm78_driver = {
|
||||
.flags = I2C_DF_NOTIFY,
|
||||
.attach_adapter = lm78_attach_adapter,
|
||||
.detach_client = lm78_detach_client,
|
||||
.command = lm78_command,
|
||||
};
|
||||
|
||||
static int lm78_id = 0;
|
||||
|
||||
/* The /proc/sys entries */
|
||||
|
||||
/* -- SENSORS SYSCTL START -- */
|
||||
#define LM78_SYSCTL_IN0 1000 /* Volts * 100 */
|
||||
#define LM78_SYSCTL_IN1 1001
|
||||
#define LM78_SYSCTL_IN2 1002
|
||||
#define LM78_SYSCTL_IN3 1003
|
||||
#define LM78_SYSCTL_IN4 1004
|
||||
#define LM78_SYSCTL_IN5 1005
|
||||
#define LM78_SYSCTL_IN6 1006
|
||||
#define LM78_SYSCTL_FAN1 1101 /* Rotations/min */
|
||||
#define LM78_SYSCTL_FAN2 1102
|
||||
#define LM78_SYSCTL_FAN3 1103
|
||||
#define LM78_SYSCTL_TEMP 1200 /* Degrees Celcius * 10 */
|
||||
#define LM78_SYSCTL_VID 1300 /* Volts * 100 */
|
||||
#define LM78_SYSCTL_FAN_DIV 2000 /* 1, 2, 4 or 8 */
|
||||
#define LM78_SYSCTL_ALARMS 2001 /* bitvector */
|
||||
|
||||
#define LM78_ALARM_IN0 0x0001
|
||||
#define LM78_ALARM_IN1 0x0002
|
||||
#define LM78_ALARM_IN2 0x0004
|
||||
#define LM78_ALARM_IN3 0x0008
|
||||
#define LM78_ALARM_IN4 0x0100
|
||||
#define LM78_ALARM_IN5 0x0200
|
||||
#define LM78_ALARM_IN6 0x0400
|
||||
#define LM78_ALARM_FAN1 0x0040
|
||||
#define LM78_ALARM_FAN2 0x0080
|
||||
#define LM78_ALARM_FAN3 0x0800
|
||||
#define LM78_ALARM_TEMP 0x0010
|
||||
#define LM78_ALARM_BTI 0x0020
|
||||
#define LM78_ALARM_CHAS 0x1000
|
||||
#define LM78_ALARM_FIFO 0x2000
|
||||
#define LM78_ALARM_SMI_IN 0x4000
|
||||
|
||||
/* -- SENSORS SYSCTL END -- */
|
||||
|
||||
/* These files are created for each detected LM78. This is just a template;
|
||||
though at first sight, you might think we could use a statically
|
||||
allocated list, we need some way to get back to the parent - which
|
||||
@@ -414,8 +445,7 @@ int lm78_detect(struct i2c_adapter *adapter, int address,
|
||||
/* Register a new directory entry with module sensors */
|
||||
if ((i = i2c_register_entry(new_client,
|
||||
type_name,
|
||||
lm78_dir_table_template,
|
||||
THIS_MODULE)) < 0) {
|
||||
lm78_dir_table_template)) < 0) {
|
||||
err = i;
|
||||
goto ERROR4;
|
||||
}
|
||||
@@ -459,14 +489,6 @@ static int lm78_detach_client(struct i2c_client *client)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* No commands defined yet */
|
||||
static int lm78_command(struct i2c_client *client, unsigned int cmd, void *arg)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* The SMBus locks itself, but ISA access must be locked explicitely!
|
||||
We don't want to lock the whole ISA bus, so we lock each client
|
||||
separately.
|
||||
|
||||
Reference in new issue
Block a user