[PATCH] command line options for hald-addon-acpi

David Zeuthen david at fubar.dk
Thu Aug 4 07:25:51 PDT 2005


Hi,

Sorry for the delay,

On Tue, 2005-08-02 at 23:14 +0200, Timo Hoenig wrote:
> Hi,
> 
> On Tue, 2005-08-02 at 16:24 -0400, David Zeuthen wrote:
> > On Tue, 2005-08-02 at 22:15 +0200, Timo Hoenig wrote:
>  
> > > Do we want to integrate support of specific notebook drivers into HAL
> > > nevertheless?  If yes, should we support interfaces of non-mainline
> > > drivers, too?
> > 
> > Yes, I think we want that, AFAIK, the generic ACPI interfaces don't
> > really work on any laptop I know but I could be wrong.
> 
> I have a several systems which work fine (= you can adjust the screen
> brightness) with the generic video driver.

Out of curiosity is it possible to detect for which systems this work in
a robust manner? Or do you need to key off things in e.g. the SMBIOS
(dmidecode)

> > I know that the
> > latest experimental version of ibm-acpi supports this and I've got a T41
> > so I can do that actually =).
> 
> Supports what?

ibm-acpi 0.11 with experimental=1

[root at daxter acpi]# cat /proc/acpi/ibm/brightness
level:          7
commands:       up, down
commands:       level <level> (<level> is 0-7)

> > However, first we need to define the external interface, but I think
> > that's not too difficult (just expose the interface
> > org.freedesktop.Hal.LaptopScreen with methods SetBrightness(..) and some
> > properties. It just requires some work to get the right interface...
> 
>       * void SetBrightness(int)
> 
>         Either we take
>         
>               * absolute values (usually about eight to 15 brightness
>                 levels are available)
>         or
>         
>               * relative values (map absolute levels to 0 to 100)
> 
>         I vote for the latter to ease the development of applications
>         which use this interface.

Will, I'd go for the absolute actually but I'm not too attached to it.
Should also just require to export properties a'la

 laptop_screen.brightness_num_steps = 8

to convey the fact that SetBrightness(int value) can take
value=0,1,2,...,7. In addition we could have 

 int SetBrightnessPercentage(int percentage)

I'd suggest to do that.

> 
> 
>       * int GetBrightness(void)
> 
>         Same as above. Either return absolute or relative values

and GetBrightnessPercentage() ? Probably we could do without both
methods and just export properties?

        
>       * void IncreaseBrightness(void)
>         
>         Increase by one brightness level depending on the given system.
>         
>       * void DecreaseBrightness(void)
> 
>         Decrease by one brightness level depending on the given system.
> 
> I've recently wrote code for these things which should be pretty easy to
> integrate into HAL once we agree about the design of the interface.

Sounds good though I'd think these would just be simple shell-scripts,
e.g. we'd distribute

  ibm-acpi-set-brightness.sh
  ibm-acpi-get-brightness.sh
  toshiba-acpi-set-brightness.sh
  toshiba-acpi-get-brightness.sh
  generic-acpi-set-brightness.sh
  generic-acpi-get-brightness.sh

and just match in .fdi files on certain properties (we would need to put
some property like system.linux.acpi_extras=ibm|toshiba etcc) to select
the right ones? This would be dead-simple I think...

The way I'd do this is to put all this in the hal spec, specifically

 - what properties do we export
 - what interfaces/methods do we export (plus what exceptions)

Also worhtwhile thinking whether it should be laptop-screen specific or
whether we should be even more generic and just call it a Monitor (and
in the future make this work (via X.org/dri/fbdev drivers) for generic
display monitors too. My hunch feeling is that we should just make it
laptop-screen specific....

> A decent design for *very* system specific interface would be cool, too.
> Think of:
> 
>       * keyboard light on the top of the screen of many IBM laptops
>       * funky LEDs on ASUS laptops
>       * any other function provided by the system specific ACPI drivers

This could be interesting too but I think the LCD brightness is a good
place to start?

Cheers,
David



_______________________________________________
hal mailing list
hal at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/hal



More information about the Hal mailing list