LCD brightness capability question

Richard Hughes hughsient at gmail.com
Mon Apr 17 03:47:34 PDT 2006


On Mon, 2006-04-17 at 11:33 +0200, Jan Jockusch wrote:
> Hello list members,
> 
> I don't feel very comfortable bugging all members with a possibly stupid 
> question, but here it goes:

Don't worry!

> My tablet PC allows brightness setting via 
> /proc/acpi/video/VGA/LCD/brightness. It reports possible levels and 
> current level.
> 
> I am aware that HALs autodetection cannot handle this because there are 
> many machines with different methods of handling /proc/acpi/video.

Ohh, there's lots of compatibility code in there for other machines
already, that do weird and wacky things.

> But HAL doesn't rely 100% on autodetection, or does it?

No, for LCD stuff it probes stuff in /proc/acpi directly as the ACPI
stuff is a bit of a mess in the kernel right now. When some of the lcd
driver stuff in
http://kernel.org/pub/linux/kernel/people/mochel/patches/acpi/driver-model/ gets merged linus this problem gets a whole lot easier and we get *standards* to follow with a nice API to use.

When this is merged, and the new kernel options have been around for a
while (months?), and HAL depends on this new kernel, then we can get rid
of a whole load of this /proc stuff. Until then, we use the scripts to
"get things working".

> I thought the 
> idea is to have many different sources of hardware detection 
> information. Now, being an experienced programmer, I might be able to 
> provide an external detection/notification/set-get program for my 
> display which I would then install on this machine. Then, my 
> gnome-power-manager would be able to handle my non-autodetectable, 
> non-standard LCD display. I might do this, if I knew where to look for 
> information on the right hooks, configuration files or API docs to write 
> such a program.
> 
> Could any of you clarify? Or point me to docs to enlighten (and get rid 
> of) me?

See below..

> So far, LCD brightness control seems to be handled in one rather 
> monolithic acpi.c file inside the compiled hald. I'm reluctant to patch 
> in there. An external property/method addition seems much more 
> appropriate to handle special hardware.

You want to look
at /usr/share/hal/scripts/hal-system-lcd-set-brightness, although you do
need some stuff in acpi.c to pick up the type and add the correct
capability. I can help you with this.

> I'd be glad to contribute my work for other people with the same or 
> similar hardware problems.
> 
> Greetings from Germany, and thank you for your efforts!

No problem, all I need from you is:

* The command as root you use to change the lcd brightness, for instance
mine is:

echo "brightness: 4" > /proc/acpi/toshiba/lcd

* The number of brightness states, e.g. my toshiba goes from brightness
0-7 so it has 8 states.

* The command as root you use to get the current brightness, which for
you is probably "cat /proc/acpi/video/VGA/LCD/brightness"

* The make and model of your laptop.

Thanks,

Richard.



More information about the hal mailing list