mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-11-08 16:11:26 +00:00
Start of i2c-bus, a module for displaying i2c bus information in /proc
Nothing much here yet, except some code to create /proc/bus/i2c. Should work for kernels 2.0 and 2.1 (please test). Other notable things: printk statements in all modules made to have to same 'look'. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@15 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
4d0ef54c3c
commit
c26eff1184
13 files changed
+332
-34
No files matched your search
+1
-1
@@ -23,7 +23,7 @@ MODULE_DIR := src
|
||||
# Regrettably, even 'simply expanded variables' will not put their currently
|
||||
# defined value verbatim into the command-list of rules...
|
||||
SRCTARGETS := $(MODULE_DIR)/smbus.o $(MODULE_DIR)/piix4.o $(MODULE_DIR)/isa.o \
|
||||
$(MODULE_DIR)/lm78.o
|
||||
$(MODULE_DIR)/lm78.o $(MODULE_DIR)/i2c-bus.o
|
||||
|
||||
# Include all dependency files
|
||||
INCLUDEFILES += $(SRCTARGETS:.o=.d)
|
||||
|
||||
@@ -75,7 +75,7 @@ static int isa_initialized;
|
||||
int isa_master_xfer (struct isa_adapter *adap, struct i2c_msg msgs[],
|
||||
int num)
|
||||
{
|
||||
printk("isa_master_xfer called for adapter `%s' "
|
||||
printk("isa.o: isa_master_xfer called for adapter `%s' "
|
||||
"(no i2c level access possible!)\n",
|
||||
adap->name);
|
||||
return 0;
|
||||
@@ -84,7 +84,7 @@ int isa_master_xfer (struct isa_adapter *adap, struct i2c_msg msgs[],
|
||||
/* Algorithm slave_send call-back implementation. Can't do that... */
|
||||
int isa_slave_send (struct isa_adapter *adap, char *data, int len)
|
||||
{
|
||||
printk("isa_slave_send called for adapter `%s' "
|
||||
printk("isa.o: isa_slave_send called for adapter `%s' "
|
||||
"(no i2c level access possible!)\n",
|
||||
adap->name);
|
||||
return 0;
|
||||
@@ -93,7 +93,7 @@ int isa_slave_send (struct isa_adapter *adap, char *data, int len)
|
||||
/* Algorithm slave_recv call-back implementation. Can't do that... */
|
||||
int isa_slave_recv (struct isa_adapter *adap, char *data, int len)
|
||||
{
|
||||
printk("isa_slave_recv called for adapter `%s' "
|
||||
printk("isa.o: isa_slave_recv called for adapter `%s' "
|
||||
"(no i2c level access possible!)\n",
|
||||
adap->name);
|
||||
return 0;
|
||||
@@ -131,7 +131,7 @@ int isa_init(void)
|
||||
#endif
|
||||
isa_initialized = 0;
|
||||
if ((res = isa_add_algorithm(&isa_algorithm))) {
|
||||
printk("isa.o: Algorithm registration failed, module isa.o not inserted\n");
|
||||
printk("isa.o: Algorithm registration failed, module not inserted.\n");
|
||||
isa_cleanup();
|
||||
return res;
|
||||
}
|
||||
@@ -141,12 +141,12 @@ int isa_init(void)
|
||||
isa_adapter.algo = &isa_algorithm;
|
||||
if ((res = isa_add_adapter(&isa_adapter))) {
|
||||
printk("isa.o: Adapter registration failed, "
|
||||
"module isa.o is not inserted\n");
|
||||
"module isa.o is not inserted\n.");
|
||||
isa_cleanup();
|
||||
return res;
|
||||
}
|
||||
isa_initialized++;
|
||||
printk("isa.o: ISA bus access for i2c modules initialized\n");
|
||||
printk("isa.o: ISA bus access for i2c modules initialized.\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -156,7 +156,7 @@ int isa_cleanup(void)
|
||||
if (isa_initialized >= 2)
|
||||
{
|
||||
if ((res = isa_del_adapter(&isa_adapter))) {
|
||||
printk("isa.o: isa_del_adapter failed, module not removed\n");
|
||||
printk("isa.o: Adapter deregistration failed, module not removed.\n");
|
||||
return res;
|
||||
} else
|
||||
isa_initialized--;
|
||||
@@ -164,7 +164,7 @@ int isa_cleanup(void)
|
||||
if (isa_initialized >= 1)
|
||||
{
|
||||
if ((res = isa_del_algorithm(&isa_algorithm))) {
|
||||
printk("isa.o: isa_del_algorithm failed, module not removed\n");
|
||||
printk("isa.o: Algorithm deregistration failed, module not removed.\n");
|
||||
return res;
|
||||
} else
|
||||
isa_initialized--;
|
||||
|
||||
@@ -65,7 +65,7 @@ int piix4_init(void)
|
||||
#endif
|
||||
piix4_initialized = 0;
|
||||
if ((res = piix4_setup())) {
|
||||
printk("piix4.o: PIIX4 not detected, module not inserted\n");
|
||||
printk("piix4.o: PIIX4 not detected, module not inserted.\n");
|
||||
piix4_cleanup();
|
||||
return res;
|
||||
}
|
||||
@@ -75,7 +75,7 @@ int piix4_init(void)
|
||||
piix4_adapter.algo = &smbus_algorithm;
|
||||
piix4_adapter.smbus_access = &piix4_access;
|
||||
if ((res = smbus_add_adapter(&piix4_adapter))) {
|
||||
printk("piix4.o: smbus_add_adapter failed, module not inserted\n");
|
||||
printk("piix4.o: Adapter registration failed, module not inserted.\n");
|
||||
piix4_cleanup();
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
compar.h - A Linux module for reading sensor data.
|
||||
Copyright (c) 1998 Frodo Looijaard <frodol@dds.nl>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#ifndef SENSORS_COMPAT_H
|
||||
#define SENSORS_COMPAT_H
|
||||
|
||||
/* This useful macro is not defined in the 2.0 kernels */
|
||||
|
||||
#include <linux/version.h>
|
||||
#ifndef KERNEL_VERSION
|
||||
#define KERNEL_VERSION(a,b,c) (((a) << 16) | ((b) << 8) | (c))
|
||||
#endif
|
||||
|
||||
#ifdef MODULE
|
||||
#include <linux/module.h>
|
||||
#ifndef MODULE_AUTHOR
|
||||
#define MODULE_AUTHOR(whatever)
|
||||
#endif
|
||||
#ifndef MODULE_DESCRIPTION
|
||||
#define MODULE_DESCRIPTION(whatever)
|
||||
#endif
|
||||
#endif /* def MODULE */
|
||||
|
||||
#endif /* SENSORS_COMPAT_H */
|
||||
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
compar.h - A Linux module for reading sensor data.
|
||||
Copyright (c) 1998 Frodo Looijaard <frodol@dds.nl>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#ifndef SENSORS_COMPAT_H
|
||||
#define SENSORS_COMPAT_H
|
||||
|
||||
/* This useful macro is not defined in the 2.0 kernels */
|
||||
|
||||
#include <linux/version.h>
|
||||
#ifndef KERNEL_VERSION
|
||||
#define KERNEL_VERSION(a,b,c) (((a) << 16) | ((b) << 8) | (c))
|
||||
#endif
|
||||
|
||||
#ifdef MODULE
|
||||
#include <linux/module.h>
|
||||
#ifndef MODULE_AUTHOR
|
||||
#define MODULE_AUTHOR(whatever)
|
||||
#endif
|
||||
#ifndef MODULE_DESCRIPTION
|
||||
#define MODULE_DESCRIPTION(whatever)
|
||||
#endif
|
||||
#endif /* def MODULE */
|
||||
|
||||
#endif /* SENSORS_COMPAT_H */
|
||||
+5
-5
@@ -114,7 +114,7 @@ s32 smbus_access_i2c(struct i2c_adapter * adapter, u8 addr, char read_write,
|
||||
int smbus_master_xfer (struct smbus_adapter *adap, struct i2c_msg msgs[],
|
||||
int num)
|
||||
{
|
||||
printk("smbus_master_xfer called for adapter `%s' "
|
||||
printk("smbus.o: smbus_master_xfer called for adapter `%s' "
|
||||
"(no i2c level access possible!)\n",
|
||||
adap->name);
|
||||
return 0;
|
||||
@@ -123,7 +123,7 @@ int smbus_master_xfer (struct smbus_adapter *adap, struct i2c_msg msgs[],
|
||||
/* Algorithm slave_send call-back implementation. Can't do that... */
|
||||
int smbus_slave_send (struct smbus_adapter *adap, char *data, int len)
|
||||
{
|
||||
printk("smbus_slave_send called for adapter `%s' "
|
||||
printk("smbus.o: smbus_slave_send called for adapter `%s' "
|
||||
"(no i2c level access possible!)\n",
|
||||
adap->name);
|
||||
return 0;
|
||||
@@ -132,7 +132,7 @@ int smbus_slave_send (struct smbus_adapter *adap, char *data, int len)
|
||||
/* Algorithm slave_recv call-back implementation. Can't do that... */
|
||||
int smbus_slave_recv (struct smbus_adapter *adap, char *data, int len)
|
||||
{
|
||||
printk("smbus_slave_recv called for adapter `%s' "
|
||||
printk("smbus.o: smbus_slave_recv called for adapter `%s' "
|
||||
"(no i2c level access possible!)\n",
|
||||
adap->name);
|
||||
return 0;
|
||||
@@ -163,7 +163,7 @@ int smbus_init(void)
|
||||
int res;
|
||||
printk("smbus.o version %s (%s)\n",LM_VERSION,LM_DATE);
|
||||
if ((res = smbus_add_algorithm(&smbus_algorithm)))
|
||||
printk("Module smbus.o not inserted!\n");
|
||||
printk("smbus.o: Algorithm registration failed, module not inserted.\n");
|
||||
else
|
||||
printk("smbus.o initialized\n");
|
||||
return res;
|
||||
@@ -173,7 +173,7 @@ int smbus_cleanup(void)
|
||||
{
|
||||
int res;
|
||||
if ((res = smbus_del_algorithm(&smbus_algorithm)))
|
||||
printk("Module smbus.o could not be removed cleanly!\n");
|
||||
printk("smbus.o: Algorithm deregistration failed, module not removed\n");
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user