kernel 2.6.18: Confusion about Macintosh backlight configuration
I added the new SysFS backlight interface to PBButtons and struggled
over a bit of the kernel 2.6.18 (stable) configuration. Beside other we
have two options in Device Driver -> Macintosh Drivers:
1. the generic backlight code used for the SysFS interface *and*
2. the direct backlight manipulating routines for older PowerBooks.
This means the kernel itself react to the brightness keys and
change backlight level accordingly. This feature interferes with
user space daemons like pbbuttonsd.
The help text of CONFIG_PMAC_BACKLIGHT suggests that this option is only
needed if I have an old PowerBook and I could say "No" here if I use a
user space daemon. But if someone say "No" to this option he won't get any
backlight control at all (neither SysFS nor PMU).
To give a user space daemon full control over the backlight device, it has
to disable function #2 of CONFIG_PMAC_BACKLIGHT. Otherwise it would rival
with the kernel for any backlight setting.
This all leads to one single valid configuration:
CONFIG_PMAC_BACKLIGHT = YES
CONFIG_PMAC_BACKLIGHT_LEGACY = YES
But If we have no choice anyway, we don't need configuration options.
Therefore here comes my suggestion:
Use this option for the generic backlight code only or compile it
always in and get rid of this option.
Use this option for the old Powerbooks or users that don't want to
use a user space daemon. It should contain all the code that reads
the brightness keys and set the backlight level in kernel space.
Furthermore it should contain PMU_IOC_GRAB_BACKLIGHT to disable this
behaviour during run time.
Should contain only interface parts that would be redundant with the
new SysFS interface like PMU_IOC_GET_BACKLIGHT and PMU_IOC_SET_BACKLIGHT.
This will allow modern systems to be compiled only with
CONFIG_PMAC_BACKLIGHT and a user space daemon does the rest.
I hope my point could be seen. I would really appreciate if the
configuration could be cleaned up. If you have any questions, please
ask. Any option names are only suggestions. Feel free to choose other
names as you like.