mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-12-04 21:58:18 +00:00
Many things, most notable the lm78 module
* Some Makefile changes. doc/makefiles documents most of them. * The lm78 module now compiles, but it will still crash. * New module sensors, with general code usable by chip driver modules * i2c-core: added function i2c_adapter_id(), which returns a (low) unique i2c-bus ID. * lm78.h stuff moved into lm78.c or sensors.h git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@19 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
dcf30092e1
commit
6ea68ba7a2
21 files changed
+2169
-224
No files matched your search
@@ -43,3 +43,5 @@ Here come the changes:
|
||||
i2c_detach_client(client);
|
||||
with:
|
||||
client->driver->detach_client(client);
|
||||
|
||||
! i2c-core: function i2c_adapter_id added
|
||||
+6
-3
@@ -29,11 +29,14 @@ I2CTARGETS := $(MODULE_DIR)/i2c-core.o $(MODULE_DIR)/algo-bit.o \
|
||||
# Include all dependency files
|
||||
INCLUDEFILES += $(I2CTARGETS:.o=.d)
|
||||
|
||||
all :: $(I2CTARGETS)
|
||||
all-i2c: $(I2CTARGETS)
|
||||
all :: all-i2c
|
||||
|
||||
install ::
|
||||
install-i2c:
|
||||
$(MKDIR) $(MODDIR)
|
||||
install -o root -g root -m 644 $(I2CTARGETS) $(MODDIR)
|
||||
install :: install-i2c
|
||||
|
||||
clean ::
|
||||
clean-i2c:
|
||||
$(RM) $(I2CTARGETS) $(I2CTARGETS:.o=.d)
|
||||
clean :: clean-i2c
|
||||
@@ -28,13 +28,15 @@ I2CDETECTSOURCES := $(MODULE_DIR)/detect.c
|
||||
# Include all dependency files
|
||||
INCLUDEFILES += $(I2CDETECTSOURCES:.c=.d)
|
||||
|
||||
all :: $(I2CDETECTTARGETS)
|
||||
all-i2c-detect: $(I2CDETECTTARGETS)
|
||||
all :: all-i2c-detect
|
||||
|
||||
# No install rule
|
||||
|
||||
clean ::
|
||||
clean-i2c-detect:
|
||||
$(RM) $(I2CDETECTSOURCES:.c=.d) $(I2CDETECTSOURCES:.c=.o) \
|
||||
$(I2CDETECTTARGETS)
|
||||
clean :: clean-i2c-detect
|
||||
|
||||
# The targets
|
||||
$(MODULE_DIR)/detect: $(MODULE_DIR)/detect.o
|
||||
|
||||
@@ -27,11 +27,14 @@ I2CDRIVERTARGETS := $(MODULE_DIR)/eeprom.o
|
||||
# Include all dependency files
|
||||
INCLUDEFILES += $(I2CDRIVERTARGETS:.o=.d)
|
||||
|
||||
all :: $(I2CDRIVERTARGETS)
|
||||
all-i2c-drivers: $(I2CDRIVERTARGETS)
|
||||
all :: all-i2c-drivers
|
||||
|
||||
install ::
|
||||
install-i2c-drivers:
|
||||
$(MKDIR) $(MODDIR)
|
||||
install -o root -g root -m 644 $(I2CDRIVERTARGETS) $(MODDIR)
|
||||
install :: install-i2c-drivers
|
||||
|
||||
clean ::
|
||||
clean-i2c-drivers:
|
||||
$(RM) $(I2CDRIVERTARGETS) $(I2CDRIVERTARGETS:.o=.d)
|
||||
clean :: clean-i2c-drivers
|
||||
@@ -28,13 +28,15 @@ I2CEEPROMSOURCES := $(MODULE_DIR)/eeprom.c
|
||||
# Include all dependency files
|
||||
INCLUDEFILES += $(I2CEEPROMSOURCES:.c=.d)
|
||||
|
||||
all :: $(I2CEEPROMTARGETS)
|
||||
all-i2c-eeprom: $(I2CEEPROMTARGETS)
|
||||
all :: all-i2c-eeprom
|
||||
|
||||
# No install rule
|
||||
|
||||
clean ::
|
||||
clean-i2c-eeprom:
|
||||
$(RM) $(I2CEEPROMSOURCES:.c=.d) $(I2CEEPROMSOURCES:.c=.o) \
|
||||
$(I2CEEPROMTARGETS)
|
||||
clean :: clean-i2c-eeprom
|
||||
|
||||
# The targets
|
||||
$(MODULE_DIR)/eeprom: $(MODULE_DIR)/eeprom.o
|
||||
|
||||
+11
-1
@@ -17,7 +17,7 @@
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
/* ------------------------------------------------------------------------- */
|
||||
#define RCSID "$Id: i2c-core.c,v 1.3 1998/11/19 03:07:18 frodo Exp $"
|
||||
#define RCSID "$Id: i2c-core.c,v 1.4 1998/11/27 22:02:09 frodo Exp $"
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
#include <linux/module.h>
|
||||
@@ -435,6 +435,16 @@ int i2c_probe(struct i2c_client *client, int low_addr, int hi_addr)
|
||||
return (i <= hi_addr) ? i : -1;
|
||||
}
|
||||
|
||||
int i2c_adapter_id(struct i2c_adapter *adap)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < I2C_ADAP_MAX; i++)
|
||||
if (adap == adapters[i])
|
||||
return i;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
#ifdef MODULE
|
||||
MODULE_AUTHOR("Simon G. Vogl <simon@tk.uni-linz.ac.at>");
|
||||
MODULE_DESCRIPTION("I2C-Bus main module");
|
||||
|
||||
@@ -254,6 +254,10 @@ extern int i2c_probe(struct i2c_client *client, int low_addr, int hi_addr);
|
||||
extern int i2c_control(struct i2c_client *,unsigned int, unsigned long);
|
||||
|
||||
|
||||
/* This call returns a unique low identifier for each registered adapter,
|
||||
or -1 if the adapter was not regisitered. */
|
||||
extern int i2c_adapter_id(struct i2c_adapter *adap);
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user