[PATCH] fix sonypi/spicctrl set/get brightness support

Bastien Nocera hadess at hadess.net
Tue Feb 20 09:04:43 PST 2007


On Mon, 2007-02-19 at 18:26 -0500, David Zeuthen wrote:
> On Mon, 2007-02-19 at 23:18 +0000, Bastien Nocera wrote:
> > >  - it would probably be good with a --with-sonypi build configuration
> > >    parameter and only build this for Linux for now. Would also remove
> > >    all the #ifdef __FreeBSD__ and #ifdef sun conditionals
> > 
> > At least FreeBSD has a similar driver called spic:
> > http://fxr.watson.org/fxr/source/i386/isa/spic.c
> > 
> > Should I name the callout "-sonypic" (for Sony Programmable I/O
> > Controller) instead?
> 
> Probably a good idea to rename it. Should still be a build configuration

Renamed.

> option; I don't expect that Nokia wants it for their builds.. And when
> Joe / others has time he can update and enable it for FreeBSD as well.

It can detect the presence of the device on all supported platforms, as
it uses HAL now.

<snip>
> > >  - Perhaps we need range checking for setting the brightness?
> > 
> > Yeah, just in case.
> 
> Cool; does the range vary? If so, we need to callout to the tool to set
> these as properties before adding the laptop panel itself.

Actually, we don't, as we store it in a uint8, so the range is clipped
to 0-255.

> > >  - I suspect the Bluetooth power control interface will follow and
> > >    will be just an .fdi file?
> > 
> > Not quite. It would also need code to detect the Bluetooth device (can I
> > do HAL calls from the callout?), and a way to pass the bluetooth device
> > USB IDs from the FDI file on a per-laptop model basis. Any ideas?
> 
> Yea, it's safe to interact with the HAL daemon as long as you're not
> invoking non-trivial methods (e.g. methods that are not on the
> standard .Device D-Bus interface) on the device object you were called
> from. You should use the private/direct connection to hald using the
> libhal_ctx_init_direct() call. That way calls won't be routed through
> the system message bus.

Done.

The patches against master (did I get it right this time?) hal-info and
hal attached. Also at https://bugs.freedesktop.org/show_bug.cgi?id=8570

If this is good for everyone, people could start adding their Sony
laptops to the list, as well as adding support for IBM ones.

And I'll add support for switching bluetooth on/off through the
bluez-gnome applet.

Cheers

-- 
Bastien Nocera <hadess at hadess.net> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hal-bluetooth-button-3.patch
Type: text/x-patch
Size: 20994 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/hal/attachments/20070220/6571e95a/hal-bluetooth-button-3-0001.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hal-info-bluetooth-switch.patch
Type: text/x-patch
Size: 1788 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/hal/attachments/20070220/6571e95a/hal-info-bluetooth-switch-0001.bin


More information about the hal mailing list