[PATCH] fix sonypi/spicctrl set/get brightness support
David Zeuthen
david at fubar.dk
Mon Feb 19 15:26:17 PST 2007
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
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.
> > - Do we need to open the device file all the time? I suppose so, as
> > the driver probably is single opener?
>
> Huh, what were you thinking of? We can't keep it open in an addon, as
> it's not really re-entrant (ie. doesn't like multiple openers).
I wasn't really thinking; I thought it was an addon. Sorry.
> > - 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.
> > - 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.
David
More information about the hal
mailing list