[ltp] [ANN] tp_smapi 0.24-test1
Shem Multinymous
linux-thinkpad@linux-thinkpad.org
Tue, 1 Aug 2006 00:41:41 +0300
Hi all,
I've prepared an expeirmental version of tp_smapi, to test several
significant changes and features. Test reports would be greatly
appreciated!
Just do "make load" or "make load HDAPS=1" as usual. There are some
new hdaps attributes to try out. There are a few quirks necessary for
testing new code; in particular, "make patch" is temporarily disabled.
It will be restored later.
This test version is not suitable for packaging in distributions. For
that, please use the latest stable version, namely 0.22.
https://sourceforge.net/project/showfiles.php?group_id=1212&package_id=171579
http://thinkwiki.org/wiki/tp_smapi
0.24-test1 2006-07-31
---------------------
Changes to loading, whitelisting and building:
- Detection of the embedded controller (needed for all our modules) is now
done according to OEM Strings in the DMI information. If the EC is not
mentioned there (you can check it in 'dmidecode' too) you'll get a
"tp_base: no ThinkPad embedded controller!" message in dmesg and the
modules won't load. If tp_smapi used to work and was broken by this,
please report. A few known exceptions are already
- The above wants the following kernel patch (soon to be included in -mm):
diff/dmi-decode-and-save-oem-string-information.patch
If this patch is not already applied to the current kernel, the Makefile
and tp_base.c default to an ugly kludge where the DMI information is
hardcoded into your driver instead of being read in runtime. You'll get
a warning about it, but it will work nicely. Just don't run the compiled
modules on a different machine.
Sorry for the mess, but we need to exercise the DMI check code.
- "make patch" is temporarily broken, due to the above.
- hdaps: Ignore the "initial mode latch" during init, we're not using it and
Lenovo keeps adding new ones.
Changes to hdaps functionality:
- hdaps: New attribute /sys/devices/platform/hdaps/sampling_rate.
This determines how frequently of accelerometer state refresh, independently
of userspace polling (i.e., reading the position attribute more frequently
than this will yield duplicate readouts). Default=50.
- Multiple hdaps applications can now run without stealing each other's data.
Set /sys/devices/platform/hdaps/sampling_rate to the highest rate required
by any app.
- hdaps: New attribute /sys/devices/platform/hdaps/oversampling_ratio.
When set to X, the embedded controller is told to do physical accelerometer
measurements at a rate that is X times higher than the rate at which
the driver reads those measurements (i.e., X*sampling_rate). This
reduces sample phase difference is, and useful for the running average
filter (see next). Default=5.
- hdaps: New attribute /sys/devices/platform/hdaps/running_avg_filter_order.
When set to X, reported readouts will be the average of the last X physical
accelerometer measurements. Current firmware allows 1<=X<=8. Setting to a
high value decreases readout fluctuations. The averaging is handled
by the embedded controller, so no CPU resources are used.
Default=2 (this implicit in previous versions).
- hdaps: New attribute /sys/devices/platform/hdaps/fake_data_mode (write only).
If set to 1, enables a test mode where the physical accelerometer readouts
are replaced with an incrementing counter. This is useful for checking the
regularity of the sampling interval and driver<->userspace communication.
Changes to tp_smapi functionality:
- tp_smapi: Removed the units ("mV", "mWh" etc.) from all /sys readouts, to
follow kernel convention.
- tp_smapi: /sys/devices/platform/smapi/BAT?/dump now contains additional
data lines (but we don't know what they mean). Default=0.
- tp_smapi: /sys/devices/platform/smapi/BAT?/dump contains some unused values;
they're now omitted (replaced by "--") instead of showing semi-random junk.
Other changes:
- tp_smapi: fixed signness bug in current_now and current_avg when
discharging (thanks to Pavel Machek!).
- hdaps: Turn off power and EC polling upon suspend or module unload.
- hdaps: Check more EC function return values.
- hdaps: Refactored some functions.
- tp_base: Test EC on module load and refuse loading if EC not found.
- tp_base, hdaps, tp_smapi: changed args passing and made it more concise.
- tp_smapi: cleaned up attribute macros.
- tp_smapi: cleaned up smapi retry loop.
- tp_smapi: removed smapi_write and dropped outAX param from smapi_request.
- tp_smapi: improved comments.
- tp_base: moved comments from tp_base.h to tp_base.c.
Many of the above changes were suggested or contributed by
Henrique de Moraes Holschuh.