Commit Graph
34 Commits
Author SHA1 Message Date
Jean Delvare 4c88142226 No need to explicitly discard subclients. With the hwmon class, they won't
even be found. For earlier kernels, they will be discarded anyway because
they expose zero feature.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4638 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-07-22 10:13:19 +00:00
Jean Delvare 98110858fe Discard devices with zero feature.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4637 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-07-21 09:28:12 +00:00
Jean Delvare f302998cd2 Fix a memory leak in sensors_read_one_sysfs_chip() when an error occurs.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4636 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-07-21 08:44:31 +00:00
Jean Delvare c5b2eabf08 Now that sensors_feature_get_type() is an internal function, we can
adjust it to fit our needs better:

* Call sensors_feature_get_type() before allocating memory for the
feature name. The allocation will be reverted for all sysfs files
which are not valid libsensors attributes, and there can be a lot
of these. So this saves a few memory allocations. But this means
that we want to pass a simple string to sensors_feature_get_type()
rather than a struct sensors_feature_data. This also means that
sensors_feature_get_type() gets the raw attribute name ("_input"
not stripped.)

* Get the channel number from sensors_feature_get_type() too. We
get it for free from sscanf(), so it's more efficient to return it
than to parse it again in sensors_read_dynamic_chip().


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4630 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-07-19 20:49:29 +00:00
Jean Delvare 70317e1a0e The way we use sensors_feature_get_type() is rather suboptimal. It is
first called during the library initialization to generate the feature
tables. Then it is called again by sensors itself. This is because we
do not store the result the first time. I propose that we add a type
field to struct sensors_feature_data, where libsensors would store
the result of sensors_feature_get_type(). That way, the application
can get the information without calling sensors_feature_get_type()
again.

This change has the following benefits:
* Obviously, a small speed-up.
* sensors_feature_get_type() can be removed from the public interface.
  This means that we can turn it into something that fits the
  libsensors needs better, allowing for more optimizations (see next
  patches.)

Note: the patch looks bigger that it really is, because I had to move
definitions around in sensors.h.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4629 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-07-19 20:46:09 +00:00
Jean Delvare fd6fc535ab No special treatment is needed for the name attribute.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4616 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-07-16 12:08:00 +00:00
Jean Delvare 9cd9debba9 Add support for multiple VID values. Untested as I don't have a chip with
multiple VIDs, but these exist. This closes ticket #2223.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4554 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-07-05 16:09:40 +00:00
Jean Delvare 7a2ab38ecf Move sensors_proc_read and sensors_proc_write to sysfs.c, and rename them
to something more in line with what they do.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4553 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-07-05 15:03:22 +00:00
Jean Delvare b79274babd Add some more warning flags, and fix these warnings.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4545 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-07-03 16:03:22 +00:00
Jean Delvare 7cc03f5029 Drop VRM reporting and selection support from libsensors. Since kernel
2.6.9, the right VID conversion formula is selected automatically
depending on the CPU model, so the user shouldn't have to care.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4543 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-07-03 13:22:28 +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 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 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 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 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 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
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 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
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 6270cf381a libsensors: Drop support for algorithm names.
I2C algorithms no longer have names in Linux 2.6, and anyway they are
implementation details user-space doesn't care about. No third party
application is known to have ever used this particular feature of
libsensors. "sensord" and "sensors" no longer do.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4208 7894878c-1315-0410-8ee3-d5d059ff63e0
2006-10-13 19:55:41 +00:00
Jean Delvare 94fa667c46 libsensors: Missing sysfs busses and classes are not errors. This tends
to confuse users a lot, to report the lack of hwmon driver as an error.
prog/sensors: Clearer error messages when no sensors are found. The
most frequent cause is a lack of drivers, not procfs/sysfs problems.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4159 7894878c-1315-0410-8ee3-d5d059ff63e0
2006-09-19 10:01:12 +00:00
Jean Delvare a026e09bd5 Chop newline at the end of adapter name.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4138 7894878c-1315-0410-8ee3-d5d059ff63e0
2006-09-03 13:05:26 +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
Jean Delvare 3c3999f9f0 lib/sysfs.c: Fix no sensors being reported as an error.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4041 7894878c-1315-0410-8ee3-d5d059ff63e0
2006-06-06 11:23:59 +00:00
Jean Delvare 70bb3c495e Fix device scan when no i2c support exists or no i2c bus driver
is loaded.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@3261 7894878c-1315-0410-8ee3-d5d059ff63e0
2006-02-25 21:32:26 +00:00
Jean Delvare 337ffc5729 Add support for the new platform drivers (Linux 2.6, sysfs).
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@3224 7894878c-1315-0410-8ee3-d5d059ff63e0
2006-01-09 19:55:18 +00:00
Mark M. Hoffman 85a0c8ccb2 (mmh)
This patch replaces the I2C chip enumeration (through sysfs) in lib/proc.c
with new functions in lib/sysfs (using libsysfs).  The patch also updates
the init code accordingly.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@3095 7894878c-1315-0410-8ee3-d5d059ff63e0
2005-09-18 20:38:19 +00:00
Mark M. Hoffman c277761d15 (mmh)
This patch replaces the I2C bus enumeration (through sysfs) in lib/proc.c
with a new function in lib/sysfs (using libsysfs).  The patch also updates
the init code accordingly.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@3094 7894878c-1315-0410-8ee3-d5d059ff63e0
2005-09-18 20:37:42 +00:00
Mark M. Hoffman 87fba1c487 (mmh)
This patch adds the files lib/sysfs.h and lib/sysfs.c, beginning with a rewrite
of the sysfs detection code (using libsyfs).  In the process, I replaced two
poorly named globals with better names, and moved them to sysfs.c.  The sysfs
detection now happens very early during library init, rather than later.

The long term plan is for the two global variables to disappear anyway, as
everything to do with sysfs should get moved into lib/sysfs.c.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@3093 7894878c-1315-0410-8ee3-d5d059ff63e0
2005-09-18 20:30:44 +00:00