From: Edward Macfarlane Smith <snowfire@blueyonder.co.uk>
To: cpufreq@www.linux.org.uk
Subject: How to control the speed?
Date: Mon, 23 Jun 2003 00:47:09 +0100 [thread overview]
Message-ID: <200306230047.09481.snowfire@blueyonder.co.uk> (raw)
I'm writing a little graphical utility to allow you to specify the default speed when switching between AC and battery, and also the screen brightness. At the moment it's specifically for my Sony Z1SP, so it will probably end up a mix of ACPI/cpufreq/sonypi.
Currently I've got the screen brightness working as it can make some ioctl calls to /dev/sonypi.
I was wondering if there are any ioctls for setting the speed using cpufreq or should I just open "/proc/cpufreq" and write a string to it?. I'd also like to know how to read the possible speeds, again in an ioctl.
Currently I've just got scripts that get run by acipd.
e.g.
mains_power() {
states=`gawk "/count/ { print \\$3 }" /proc/acpi/processor/CPU0/performance`
((states--))
min_speed=`gawk "/P$states/ { print \\$2 }" /proc/acpi/processor/CPU0/performance`
max_speed=`gawk "/P0:/ { print \\$2 }" /proc/acpi/processor/CPU0/performance`
echo -n 0:$min_speed"000:"$max_speed"000:performance" > /proc/cpufreq
spicctrl -b 255
}
btw I'm trying to get this working on a 2.4 series kernel. I'm currently using 2.4.21-ac1 with the extra back port patch I sent last week so that cpuinfo reports the right stuff.
It may all be documented really well somewhere but I haven't found it yet, so if someone could point me in the right direction that would be much appreciated.
Once I get something useful I'll make it available to anyone (so far only the slider for brightness works!) who wants it.
Regards,
Edward
next reply other threads:[~2003-06-22 23:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-06-22 23:47 Edward Macfarlane Smith [this message]
2003-06-23 13:53 ` How to control the speed? Dominik Brodowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200306230047.09481.snowfire@blueyonder.co.uk \
--to=snowfire@blueyonder.co.uk \
--cc=cpufreq@www.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox