Commit Graph
386 Commits
Author SHA1 Message Date
Jean Delvare dced776a12 Use sscanf instead of regex to match the feature names. This is much faster.
As a side effect, this fixes a memory leak (the regex engine data was never
freed.)


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4538 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-07-03 08:18:21 +00:00
Jean Delvare cc1700958b Fix the description of the mode field.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4525 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-06-29 12:30:58 +00:00
Jean Delvare e780d22d03 Simplify the code setting the feature mode.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4521 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-06-29 12:11:43 +00:00
Jean Delvare 78d9053547 There are no sensor* sysfs files.
The VID value is in cpu*_vid, not vid.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4520 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-06-29 11:46:20 +00:00
Jean Delvare 0c46611b20 Drop two unused macros.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4519 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-06-29 08:21:38 +00:00
Jean Delvare 1de056f9bf Negative magnitudes are no longer supported.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4518 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-06-29 08:16:24 +00:00
Jean Delvare e08eabe33c We no longer need alternative sysfs file names and magnitudes, as they are
the real name and magnitude now.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4513 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-06-28 18:19:58 +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 32b1b71245 Feature names are now dynamically allocated -> no const.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4509 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-06-28 13:35:46 +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 75d55dc5ae Delete the chip-specific code from libsensors. It's about time to get
the generic code to work.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4506 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-06-28 09:38:31 +00:00
Jean Delvare 3e69b5182a No longer need to include "kernel/sensors.h".
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4501 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-06-28 07:29:43 +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 6c7effca88 libsensors: Kill procfs and sysctl support, part 2.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4473 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-06-26 10:06:46 +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
Jean Delvare f00aef9271 Return with an explicit error code/message if sysfs isn't mounted.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4464 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-06-25 13:58:55 +00:00
Jean Delvare f8c7f20bf1 No longer need to include general.h.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4463 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-06-25 13:39:55 +00:00
Jean Delvare fea1d9a1bb libsensors: Kill procfs support, part 1.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4462 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-06-25 13:32:27 +00:00
Jean Delvare c8b02ddfa3 Install libsensors as libsensors.so.4, and sensors as sensors3. This makes
it possible to install both the old and the new libsensors and sensors,
making testing much easier. sensors3 will be renamed back to sensors before
we release.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4461 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-06-25 11:39:08 +00:00
Jean Delvare 85393f35b6 Always build libsensors with sysfs support.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4458 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-06-25 08:18:47 +00:00
Jean Delvare 768be0b9c0 Drop SENSORS_FEATURE_TEMP_LIM, it doesn't correspond to anything in the
standard sysfs interface.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4428 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-05-29 16:49:06 +00:00
Jean Delvare 33a3d6fba2 Drop SENSORS_FEATURE_TEMP_OVER, SENSORS_FEATURE_TEMP_HIGH and
SENSORS_FEATURE_TEMP_LOW, they don't correspond to anything in the
standard sysfs interface.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4427 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-05-29 16:23:19 +00:00
Jean Delvare 139afe6665 Disable specific support for the ds1621, lm90 and f71805f drivers.
I tested that the generic support works fine for these devices.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4424 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-05-28 15:02:18 +00:00
Jean Delvare a08cf956fb Fixes to the dynamic chip support:
* Fix the handling of temperature hysteresis. Hysteresis is not a
  temperature limit by itself, but a property of temperature limit.
* Handle per-limit temperature alarms.
With these fixes, the ADM1032 is properly supported by the new code.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4423 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-05-28 14:22:58 +00:00
Jean Delvare 1bd9212065 Fill the magnitude field of dynamically generated device entries.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4420 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-05-28 12:38:28 +00:00
Jean Delvare 5a38143c5e libsensors: Drop support for non-sensor drivers: ddcmon and eeprom.
These should never have been supported to start with, and no longer
are in practice with recent 2.6 kernels.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4403 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-05-13 15:02:44 +00:00
Jean Delvare e8861069b2 sensors.conf.8: Update the chip statement section.
* Drop outdated reference to /proc/sys/dev/sensors
* Bus type can be pci
* Make the examples more realistic


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4374 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-04-20 13:36:43 +00:00
Hans de Goede bd74aa2390 -rewrite dyn chip code, it now uses sensors_feature_get_type() to
identify sysfs entries. Reasons for this rewrite / bugs fixed:
 -Don't give features like alarms / sensor type / fault flag a
  compute mapping only a normal mapping
 -Don't generate features for sysfs entries like uvent, modalias, etc.
  instead only generate features for features known by
  sensors_feature_get_type()
 -Sort the list of found features logically instead of sorted in alphabet order
  of the sysfs entry. So now it starts with all in entries, then all fan and
  then all temp. Just like the order of most entries in lib/chips.c. Also
  this means that it now contains in0 - in10 in that order and not in0, in10,
  in1 - in9


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4368 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-04-10 11:51:07 +00:00
Hans de Goede 16408d8665 -comment abituguru entry in lib/chips.c and prog/sensors/main.c, as the
abituguru seems to work well with the new dynamic chip support and generic
 chip printroutines. note: the abituguru code should be completly removed in
 the future.
-comment k8temp entry in lib/chips.c and prog/sensors/main.c, as the
 k8temp seems to work well with the new dynamic chip support and generic
 chip printroutines. note: the k8temp code should be completly removed in
 the future.
-make the match for the subtype exact instead of a strncmp, otherwise
 an alarm_enable flag gets classified as an alarm, leading to all sensors who
 have their alarm enabled getting an alarm reported, as the alarm_enabled gets
 read as alarm.
-and do the same for the _input match to check if this is a main or subfeature


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4367 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-04-09 18:07:07 +00:00
Hans de Goede ba5140b3d8 Generic chip support / get featuretype fixes just received from Bob Schlarmann, as the version I committed wasn't the latest version
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4366 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-04-09 17:48:57 +00:00
Hans de Goede 78a521b1a8 Some fixes for problems with the dyn chip support / generic printing routines which showed up while testing with the abituguru driver
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4364 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-04-09 14:52:28 +00:00
Hans de Goede 05087736f8 add sensors_feature_get_type method, by Bob Schlarmann and Luuk Kleiweg
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4360 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-04-09 14:40:05 +00:00
Hans de Goede 666fe95cdb dynamicly generate a sensors_chip_features_list entry for unknown chips based on their sysfs entries, by Bob Schlarmann and Luuk Kleiweg
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4359 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-04-09 14:09:21 +00:00
Mark M. Hoffman c5ffa7b635 Merge from trunk (4303:4355) out to 3.0.0 branch.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4357 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-04-03 12:55:30 +00:00
Philip Edelbrock b71ee14a2d Prep for 2.10.2 release.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4297 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-01-15 23:30:51 +00:00
Mark M. Hoffman 6968eb16fe The sensors library relied on one structure having an identical layout in
memory as part of another structure.  This rather large patch fixes that by
making the smaller piece an explicit member of the larger.

I brought this patch into sync with the latest SVN, and tested it by comparing
objects files from the tree pre- and post- patch.

The remaining 99% of the credit goes to Bob Schlärmann <bob2@dsv.nl> for
creating the original patch... thanks Bob!

* Bob Schlärmann <bob2@dsv.nl> [2006-12-24 18:29:39 +0100]:
> The following patch changes all of the lib/chips.c entries and any function
> that uses sensors_chip_feature. Most of the conversion was done through a
> perl script, so if you don't agree with the syntax it'll be easy to change.



git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4287 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-01-09 02:46:13 +00:00
Mark M. Hoffman 7bb9db17d8 Run regression tests under valgrind, if it is available.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4275 7894878c-1315-0410-8ee3-d5d059ff63e0
2006-12-30 06:04:06 +00:00
Mark M. Hoffman c510d7934f The caller of sensors_yylex() is responsible for free()'ing NAME strings.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4274 7894878c-1315-0410-8ee3-d5d059ff63e0
2006-12-30 04:43:37 +00:00
Mark M. Hoffman a938571fc5 Fix a memory leak in the scanner that occurs when we're missing a closing quote
before an immediate EOF.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4273 7894878c-1315-0410-8ee3-d5d059ff63e0
2006-12-30 04:08:40 +00:00
Jean Delvare 73922b2883 Add user-space support for the ADM1029. Patch contributed by
Corentin Labbe.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4270 7894878c-1315-0410-8ee3-d5d059ff63e0
2006-12-22 21:11:07 +00:00
Jean Delvare 6af70f2828 libsensors: Get the i2c adapter names from the class device's "name"
attribute, falling back to the device's "name" attribute for
compatibility only. This change is needed to match ongoing cleanups in
Linux 2.6's i2c-core. i2c adapters will soon be class devices only, the
legacy i2c_adapter devices and driver are being removed.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4267 7894878c-1315-0410-8ee3-d5d059ff63e0
2006-12-21 08:24:01 +00:00
Jean Delvare 0a36a5daa3 Better parse error messages.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4266 7894878c-1315-0410-8ee3-d5d059ff63e0
2006-12-21 07:48:08 +00:00
Jean Delvare 6310ee1f03 Add support for the w83627dhg. Original patch by David Holl.
This closes ticket #2157.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4264 7894878c-1315-0410-8ee3-d5d059ff63e0
2006-12-18 07:43:00 +00:00
Mark M. Hoffman 72889cb191 Two minor cleanups: 1) remove the yymore() calls, they're no longer necessary;
and 2) make the quoted escape sequence rules a little more compact.  The first
cleanup is said to yield a slight speedup according to the flex manual - I
didn't bother to measure it.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4236 7894878c-1315-0410-8ee3-d5d059ff63e0
2006-11-12 18:36:15 +00:00
Mark M. Hoffman dcdd19ed72 The scanner regression test cases for error conditions in quoted strings
uncovered three different bugs.  This changeset fixes them all.  It also
updates the sensors.conf(5) man page to be unambiguous regarding the
requirement for whitespace between elements.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4235 7894878c-1315-0410-8ee3-d5d059ff63e0
2006-11-12 18:24:55 +00:00
Mark M. Hoffman 68558575ad Add error conditions for quoted names to scanner regression test.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4234 7894878c-1315-0410-8ee3-d5d059ff63e0
2006-11-12 18:21:43 +00:00
Mark M. Hoffman 04cd960539 Add quoted names to scanner regression test. Note: no tests for octal
escapes yet... it's possible we'll just kill support for those (I hope).


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4233 7894878c-1315-0410-8ee3-d5d059ff63e0
2006-11-12 15:32:59 +00:00
Jean Delvare 53cb805e44 Add user-space support for the Fintek F71872F/FG (chip name f71872f).
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4232 7894878c-1315-0410-8ee3-d5d059ff63e0
2006-11-12 13:17:32 +00:00
Mark M. Hoffman 9c3a817633 Merge scanner-opt-branch (r4121:r4221) to trunk.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4222 7894878c-1315-0410-8ee3-d5d059ff63e0
2006-10-26 11:50:27 +00:00