[Debian-eeepc-devel] eeepc-acpi-scripts bits for testing

Darren Salt linux at youmustbejoking.demon.co.uk
Wed May 27 23:55:56 UTC 2009


I demand that Santi Béjar may or may not have written...

> 2009/5/27 Darren Salt <linux at youmustbejoking.demon.co.uk>:
>> I demand that Santi Béjar may or may not have written...
[snip]
>>> So now I've tested it, and it works somehow. The problem is that I cannot
>>> set cpufv=2, it is stuck at cpufv=1 so it doesn't cycle between the three
>>> (or two) values. (I can change it from 0 to 1 with the key).
>> Hmm. That sounds like the BIOS and/or hardware only supports two states;
>> what hardware? (I'm guessing one of the Celeron-based ones, since all
>> three states are useable on my 901.)

> 701 4G with the lastest BIOS, 1302.

This patch (locally committed, tested only on my 901) should fix things.

diff --git a/etc/acpi/lib/shengine.sh b/etc/acpi/lib/shengine.sh
index ba5d540..0481a55 100644
--- a/etc/acpi/lib/shengine.sh
+++ b/etc/acpi/lib/shengine.sh
@@ -3,6 +3,8 @@
 # to be sourced
 
 SHENGINE_CTL=/sys/devices/platform/eeepc/cpufv
+SHENGINE_LIMIT="$(cat "$SHENGINE_CTL" 2>/dev/null)"
+SHENGINE_LIMIT=$(( ${SHENGINE_LIMIT:-768} >> 8 ))
 
 get_shengine()
 {
@@ -16,7 +18,7 @@ cycle_shengine()
 {
     if [ -e "$SHENGINE_CTL" ]; then
 	get_shengine
-	echo $(( ($? + 1) % 3)) > "$SHENGINE_CTL"
+	echo $(( ($? + 1) % $SHENGINE_LIMIT)) > "$SHENGINE_CTL"
     fi
     get_shengine
 }

-- 
| Darren Salt      | linux at youmustbejoking | nr. Ashington, | Doon
| Debian GNU/Linux | or ds    ,demon,co,uk    | Northumberland | Army
|   <URL:http://www.youmustbejoking.demon.co.uk/> (PGP 2.6, GPG keys)

Ban the bomb. Save the world for conventional warfare.



More information about the Debian-eeepc-devel mailing list