Commit Graph
33 Commits
Author SHA1 Message Date
Jean Delvare a82c6b0476 Mass reindent, coding style and whitespace cleanups.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4736 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-31 14:42:20 +00:00
Jean Delvare 5524486161 Add support for hardware monitoring chips on SPI buses.
SPI bus statements in the configuration file are not yet supported, as
SPI buses don't have a name attribute yet, it's not possible to identify
them and thus no substitution is possible.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4689 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-19 15:07:05 +00:00
Jean Delvare f1cc941e29 Contrary to what the comment says, sensors_proc_bus_count may be a
perfectly valid bus number. We need to use a different value for
chip configuration entries we want to ignore.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4688 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-19 15:05:52 +00:00
Jean Delvare a74addb5d4 Support more bus types (part 2 of 2). Originally libsensors was very
i2c-centric. Make it more neutral so that we can cleanly support
additional bus types such as SPI or One-Wire.

This second part updates sensors_bus to use sensors_bus_id. Thanks
to Mark M. Hoffman for showing me how the configuration file
parser could be modified to support that change.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4687 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-19 15:04:29 +00:00
Jean Delvare 7ee15371df Support more bus types (part 1 of 2). Originally libsensors was very
i2c-centric. Make it more neutral so that we can cleanly support
additional bus types such as SPI or One-Wire.

This first part introduces sensors_bus_id, and updates
sensors_chip_name to use it.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4686 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-19 15:03:50 +00:00
Jean Delvare da7fbf5b70 Reindent and cleanup.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4678 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-16 16:18:18 +00:00
Jean Delvare f430b0991a Chip types can no longer contain dashes. This makes it possible to
rewrite sensors_parse_chip_name() with a simpler algorithm. The new
code is smaller by about one third, and twice as fast on average
(5 times as fast in the most frequent case "foo-*".)

This closes ticket #2221.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4677 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-16 10:06:35 +00:00
Jean Delvare edb42b3c16 Add a new function to libsensors doing the opposite of
sensors_parse_chip_name(). sensors_snprintf_chip_name() converts
a chip name from its internal representation to a human readable
string. So far, each user program had to reimplement this function.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4676 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-16 10:04:57 +00:00
Jean Delvare 493d9b27f5 Use strtoul() instead of parsing integers on our own.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4675 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-16 09:58:44 +00:00
Jean Delvare e9fccf7d01 Don't handle the isa bus in sensors_parse_i2cbus_name(). We really
don't need to, as there is a single ISA bus, there's no need for
substituting anything.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4674 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-16 09:57:56 +00:00
Jean Delvare 8896ba3b1f Rename sensors_chip_name.busname to path, as this is what we are using
it for by now.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4673 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-16 09:56:07 +00:00
Jean Delvare b52225ffc0 Drop support for "dummy" bus type. The kernel no longer supports
such fake i2c buses, so neither should we. Instead, non-i2c buses are
handled explicitly.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4672 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-16 09:54:53 +00:00
Jean Delvare f905e5f242 Delete LM_DATE and libsensors_date.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4601 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-07-10 19:38:14 +00:00
Jean Delvare 92b5982180 With the new dynamic chip features enumeration code, the sensors_proc_chips
and sensors_chip_features_list arrays tend to track the same information.
So it's much more simple, and more efficient, to have a single array. I
decided to keep sensors_proc_chips, because it already has memory management
helpers. One nice side effect is that the arbitrary limit to the number of
supported chips is now gone. Another one is that some of the memory leaks
were fixed.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4510 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-06-28 14:39:34 +00:00
Jean Delvare 063f4b91d4 Use complete chip names (prefix + bus + address) as the keys of
sensors_chip_features_list[]. Using only the prefix (as was done before)
makes it impossible to properly support multiple chips with the same prefix
but a different feature set.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4508 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-06-28 12:09:00 +00:00
Jean Delvare 8fdfa3f19d Move the few lines of code remaining in chips.c to data.c, and finally
delete chips.c. RIP.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4507 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-06-28 09:53:01 +00:00
Jean Delvare 8138489a72 struct sensors_proc_chips_entry now has a single member, so we may
as well use this member directly for slightly more simple code.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4474 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-06-26 11:33:09 +00:00
Jean Delvare 24f6b62c3f Delete all remnants of algorithm names.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4465 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-06-25 14:21:01 +00:00
Rudolf Marek 3027d75a12 Add PCI bus support
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4098 7894878c-1315-0410-8ee3-d5d059ff63e0
2006-08-19 15:23:10 +00:00
Mark M. Hoffman 2c5441a2db (mmh)
This patch moves the chip and bus lists from lib/proc.c to lib/data.c.
The variables were already declared in lib/data.h.  Motivation: when
support for kernel 2.4.x becomes optional, lib/proc.c may not even be
compiled into the library... but these variables are still needed.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@3090 7894878c-1315-0410-8ee3-d5d059ff63e0
2005-09-18 18:28:51 +00:00
Jean Delvare 27e2a62bab Fix bus matching mechanism which had always been broken for Linux
2.6. Original patch from Karsten Petersen.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@3076 7894878c-1315-0410-8ee3-d5d059ff63e0
2005-09-10 09:29:35 +00:00
Mark D. Studebaker 4046d36cd8 add version and date strings
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2537 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-05-16 14:25:20 +00:00
Jean Delvare 44ff677255 Fix memory leak.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2088 7894878c-1315-0410-8ee3-d5d059ff63e0
2003-11-23 21:20:57 +00:00
Jean Delvare fd5a4dff38 Better warning removal (less code change).
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1826 7894878c-1315-0410-8ee3-d5d059ff63e0
2003-06-30 14:00:29 +00:00
Jean Delvare 807aa000b1 GCC 3.2 warnings fixed.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1825 7894878c-1315-0410-8ee3-d5d059ff63e0
2003-06-29 12:39:10 +00:00
Mark D. Studebaker 2a03ea8e15 big hack for add'l dummy adaps.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1607 7894878c-1315-0410-8ee3-d5d059ff63e0
2002-11-16 03:23:34 +00:00
Frodo Looijaard 24792039f6 Adrian's copyright patch applied
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@207 7894878c-1315-0410-8ee3-d5d059ff63e0
1999-02-08 22:50:29 +00:00
Frodo Looijaard faa996f454 Moved some library functions around, to put them in more logical files.
No external changes.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@119 7894878c-1315-0410-8ee3-d5d059ff63e0
1998-12-25 21:51:59 +00:00
Frodo Looijaard 1c12665831 Expanded expressions, slightly new syntax
An expression can now refer to the value it has to compute (@), but also to
other values. This is now perfectly valid as an expression:
  vid + in_min - in_max * 2 / @
Not that this is very sensible, but you get the idea. Please install the
new example config file, or replace all old 'val' occurences with '@'.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@107 7894878c-1315-0410-8ee3-d5d059ff63e0
1998-12-24 01:13:44 +00:00
Frodo Looijaard 849acbe439 More libary stuff
The bus translation functions.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@101 7894878c-1315-0410-8ee3-d5d059ff63e0
1998-12-22 01:25:25 +00:00
Frodo Looijaard f26b52021b More library extensions
Most notably, config file line numbers are now stored, so we can now generate
better error messages.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@98 7894878c-1315-0410-8ee3-d5d059ff63e0
1998-12-21 14:14:25 +00:00
Frodo Looijaard 1779b684c1 More library stuff
Nice init and cleanup functions.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@97 7894878c-1315-0410-8ee3-d5d059ff63e0
1998-12-20 21:57:39 +00:00
Frodo Looijaard 730efd78ca More library files
This brings the archive into synch with my harddisk...

Everything in the lib directory should compile without problems (yes, even
without warnings even if WARN=1). It is not well-tested, though, and there
are some minor functions which must still be added. It is now almost
usable.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@95 7894878c-1315-0410-8ee3-d5d059ff63e0
1998-12-20 16:54:03 +00:00