2
0
mirror of https://github.com/lm-sensors/lm-sensors synced 2025-08-30 22:05:11 +00:00
Commit Graph

3771 Commits

Author SHA1 Message Date
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
6bf63e0f7a License fix.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4670 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-15 08:23:38 +00:00
Jean Delvare
3b25c8dc22 Pass structures by reference in sensors and sensord, again for a
small performance gain and better consistency with the new
libsensors API.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4668 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-13 20:19:44 +00:00
Jean Delvare
d9ec11a6c7 Pass the structures by reference inside libsensors. Again a small
performance gain, and this makes the internal code consistent with the
public functions.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4667 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-13 20:16:42 +00:00
Jean Delvare
3bab00fff9 Change the libsensors API so that all structures are passed by
reference. This is more efficient that way.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4666 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-13 20:16:03 +00:00
Hans de Goede
69757bcc20 Add FSC Heimdall, Poseidon II detection, change Poseidon I label from just plain Poseidon to Poseidon I
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4665 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-13 20:11:02 +00:00
Jean Delvare
6a49d8c88a Discard legacy comment.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4663 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-12 19:54:40 +00:00
Jean Delvare
625e4944c5 Add detection of the Winbond W83L786NR/NG/R/G and W83L771W/G chips.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4661 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-12 19:41:33 +00:00
Jean Delvare
a98987dcc6 List the upcoming adt7470 driver.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4656 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-12 16:31:43 +00:00
Jean Delvare
fbdb5dba87 The libsensors test suite doesn't use iconv.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4655 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-12 15:44:35 +00:00
Jean Delvare
e689752228 Don't probe i2c-isa as if it were a regular i2c bus. This bug was
introduced when getting rid of the i2cdetect dependency. I had
forgotten that i2c-isa was not listed in class i2c-dev but was
still listed in class i2c-adapter.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4650 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-10 17:33:43 +00:00
Jean Delvare
1b51800541 Delete sensors_do_all_sets(). I couldn't find any application using it,
and sensors_do_chip_sets() can be used instead if really needed.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4648 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-09 08:43:40 +00:00
Jean Delvare
5fb9a1689f Don't export sensors_chip_name_has_wildcards(). I don't know of any
application using it, and I can't think of any use case for it outside
of libsensors. I'm not even sure if the inside calls are all legitimate.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4647 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-09 08:39:41 +00:00
Jean Delvare
eaec35491e Now that sensors_get_ignored() is an internal function, we can change
its prototype to suit our needs better.

* Pass the chip name by address.
* Pass the feature directly rather than its number.
* Switch to a sane convention for the returned value.
* Don't check for errors that can't happen.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4646 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-07-24 08:22:03 +00:00
Jean Delvare
9896986247 We no longer need sensors_get_label_and_valid(), as it does hardly
more than sensors_get_label(). This allows for some cleanups.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4645 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-07-24 08:21:23 +00:00
Jean Delvare
e9c8c5fb06 Let libsensors handle ignore statements by itself, rather than
delegating the task to the user applications.

For now, I am calling sensors_get_ignored() in
sensors_get_all_features(), because this is the least intrusive way.
This is in no way optimal though, it would be better to not add
ignored features to the feature list in the first place. However,
doing so would require that the configuration file is read before
sysfs is scanned for features, which isn't currently the case. So
this improvement is left for later.

Note that this patch adds a small cost in terms of performance. This
is because we now honor ignore statements on all features (main ones
and subfeatures) while in practice "sensors" was only checking for
main features. It would be trivial to stop checking for subfeatures,
but it seems to me that supporting ignore on subfeatures is a good
move, as the user may actually want to ignore a specific subfeature.
Individual alarms come to mind. This will also be handy to debug the
generic print code in "sensors".


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4644 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-07-24 08:20:53 +00:00
Jean Delvare
6505fef0fd The way we build the feature lists guarantees that subfeatures always
immediately follow their main feature. This makes it possible to simplify
sensors_get_all_features() quite a bit. We no longer need to maintain
separate pointers for the last main feature and the last subfeature,
we can simply walk the list linearly.

Note that I am still not entirely happy with this API. It was obviously
designed for debugging purposes (sensors -u) and without performance
concernes nor interface cleanliness in mind. I believe that we want to
tag main features and subfeatures as such, and let the application ask
specifically for the list of main features, and for each feature, for
its list of subfeatures (i.e. two functions instead of one.)


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4643 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-07-24 08:19:59 +00:00
Jean Delvare
a62ee5bac2 Speed up sensors_get_ignored() a bit. We can return as soon as an ignore
statement is found to match, even if it isn't an exact match.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4642 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-07-22 12:51:57 +00:00
Jean Delvare
462e7d81df Unify error reporting messages. Fix a memory leak in error path.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4639 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-07-22 12:25:15 +00:00
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
834cd70e14 Drop redundant test.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4632 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-07-20 19:09:00 +00:00
Jean Delvare
5d33dd3e68 Minor optimizations to sensors_feature_get_type():
* We no longer support any single type, so no need to handle this case.
* We can start looking for "_" at offset 3 rather than the beginning
  of the string (the shortest valid prefix is "in0", 3 characters.)


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4631 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-07-19 20:50:17 +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
ac5ae18fe7 Drop the package target.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4628 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-07-19 16:59:16 +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
d73a25b166 Don't sort the same list twice.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4611 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-07-14 16:32:56 +00:00
Jean Delvare
c100b4f38b Don't add non-sensor I2C chips to the list of detected I2C chips. Even
if we discard them later, their presence in the list can prevent the
"no sensors found" event from triggering. It also causes the script to
suggest loading i2c bus drivers which are not needed for hardware
monitoring.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4610 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-07-14 16:29:52 +00:00
Jean Delvare
91d6d664ed Fix broken links to Analog Devices website.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4607 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-07-13 14:53:31 +00:00
Jean Delvare
356e03f000 Add missing static marker.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4605 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-07-13 11:05:43 +00:00
Jean Delvare
02b58be2e8 Add Fintek F71806FG and F71862FG detection.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4604 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-07-10 21:09:32 +00:00
Jean Delvare
7b8fdf0188 Advertise and document libsensors_version.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4602 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-07-10 19:55:06 +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
Hans de Goede
d5d0476273 remove f71882fg example config fan2-4 ignore lines and add labels, fix typo in Battery label
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4600 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-07-09 12:54:54 +00:00
Jean Delvare
e45b873981 Delete unused function sensors_get_sub_feature_by_type().
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4598 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-07-09 11:20:47 +00:00
Jean Delvare
867b8453f2 Add more known SMSC Super IO chips to sensors-detect. Also sort
the list of SMSC chips by chip name. Patch from Juerg Haefliger.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4597 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-07-08 20:54:33 +00:00
Hans de Goede
712748f659 Handle chips who return the beta value as temp sensor type
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4595 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-07-08 18:59:16 +00:00
Jean Delvare
a2b7c5b0b1 Drop reference to mkdev.sh.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4594 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-07-08 12:01:23 +00:00
Jean Delvare
a83ef92c9a Delete mkdev.sh. i2c device nodes are created by devfs or udev on most
2.6 kernel-based systems, for others they should have been created at
system installation time. If they are missing, sensors-detect will run
MAKEDEV to create them.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4593 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-07-08 12:00:55 +00:00
Jean Delvare
982afbce24 Only write integer values to pwm files.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4591 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-07-08 11:17:26 +00:00
Jean Delvare
cd0b8c3489 Delete fancontrol.pl. The reason given when it was added was that the
bash implementation was spawning too many child processes, and that
was true, but this has been addressed since. And I don't particularly
enjoy maintaining two scripts doing exactly the same thing.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4590 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-07-08 10:13:11 +00:00
Jean Delvare
759098c8f8 Use linear interpolation instead of quadratic to choose PWM values.
This is simpler and will work better in most cases. For example this
should address at least part of ticket #2224. It seems that quadratic
was used to lower the average noise level, but I don't think this is a
valid reason. The new MINPWM and MAXPWM parameters will also let the
user control the noise level if really needed.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4589 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-07-08 10:04:48 +00:00