All of lore.kernel.org
 help / color / mirror / Atom feed
* How to control the speed?
@ 2003-06-22 23:47 Edward Macfarlane Smith
  2003-06-23 13:53 ` Dominik Brodowski
  0 siblings, 1 reply; 2+ messages in thread
From: Edward Macfarlane Smith @ 2003-06-22 23:47 UTC (permalink / raw)
  To: cpufreq

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How to control the speed?
  2003-06-22 23:47 How to control the speed? Edward Macfarlane Smith
@ 2003-06-23 13:53 ` Dominik Brodowski
  0 siblings, 0 replies; 2+ messages in thread
From: Dominik Brodowski @ 2003-06-23 13:53 UTC (permalink / raw)
  To: Edward Macfarlane Smith; +Cc: cpufreq

On Mon, Jun 23, 2003 at 12:47:09AM +0100, Edward Macfarlane Smith wrote:
> 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.

In 2.5., this is easily possible [scaling_available_frequencies in the
corresponding sysfs directory], for 2.4., there is no such file but one of
the cpufreq daemons has some code in it to detect the speeds nonetheless.

All interfaces to cpufreq are either /proc files - sysctl's [sort of
deprecated] or sysfs files [2.5. only, though]

	Dominik

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-06-23 13:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-22 23:47 How to control the speed? Edward Macfarlane Smith
2003-06-23 13:53 ` Dominik Brodowski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.