From: Michael Hanselmann <hidden> Date: 2006-08-27 12:30:32
This driver provides an interface to the keyboard backlight on Oct 2005
PowerBooks, which have the backlight behind the PMU. This driver doesn't
support the I²C variant used in earlier PowerBooks.
Signed-off-by: Michael Hanselmann <redacted>
---
diff -Nrup --exclude-from linux-exclude-from linux-2.6.18-rc4-git1.orig/drivers/macintosh/Kconfig linux-2.6.18-rc4-git1/drivers/macintosh/Kconfig
@@ -99,6 +99,14 @@ config ADB_PMU_LED_IDEThisoptionmakesthefrontLEDdefaulttotheIDEtriggersothatitblinksonIDEactivity.+configADB_PMU_ALS_LED+bool"Support for keyboard backlight"+depends onADB_PMU+selectNEW_LEDS+selectLEDS_CLASS+help+SupportforthekeyboardbacklightonOct2005PowerBooks.+configPMAC_SMUbool"Support for SMU based PowerMacs"depends onPPC_PMAC64
From: Benjamin Herrenschmidt <benh@kernel.crashing.org> Date: 2006-08-27 22:34:42
On Sun, 2006-08-27 at 14:30 +0200, Michael Hanselmann wrote:
This driver provides an interface to the keyboard backlight on Oct 2005
PowerBooks, which have the backlight behind the PMU. This driver doesn't
support the I²C variant used in earlier PowerBooks.
Signed-off-by: Michael Hanselmann <redacted>
Why would we need a driver ? Userland can emit PMU commands directly...
At least, if we do a driver, it should provide a common interface to
both PMU and i2c based LMUs
Ben.
From: Michael Hanselmann <hidden> Date: 2006-08-27 23:07:19
On Mon, Aug 28, 2006 at 08:34:23AM +1000, Benjamin Herrenschmidt wrote:
Why would we need a driver ? Userland can emit PMU commands directly...
Drivers are there to abstract hardware. Userland shouldn't know about
hardware specific commands (PMU commands in this case).
It would make it much simpler for programs to use these devices, because
not each of them has to implement everything needed to locate the device
and control it.
pbbuttonsd supports both the I²C and PMU variant. The code is a mess
there and a generic driver would help to clean it up. And yes, I'm
partly responsible for it, since I supplied the original patch for the
PMU keyboard backlight support in pbbuttonsd.
Maybe controlling the keyboard backlight could be moved to its own
program anyway, because the algorithm used by pbbuttonsd isn't appealing
to all people. But those are just ideas.
Oh, and using the LED class allows users to attach it to some trigger.
Maybe someone wants to use it as the IDE LED. :-)
At least, if we do a driver, it should provide a common interface to
both PMU and i2c based LMUs
Yeah, I figured after sending it. You'll hear again from me once I got
my hands on an I²C backlight. Something like the AMS driver would be
nice.
From: Benjamin Herrenschmidt <benh@kernel.crashing.org> Date: 2006-08-27 23:11:18
On Mon, 2006-08-28 at 01:07 +0200, Michael Hanselmann wrote:
On Mon, Aug 28, 2006 at 08:34:23AM +1000, Benjamin Herrenschmidt wrote:
quoted
Why would we need a driver ? Userland can emit PMU commands directly...
Drivers are there to abstract hardware. Userland shouldn't know about
hardware specific commands (PMU commands in this case).
This is a bit of a broad statement :) If I were to follow you, thinks
like USB scanner or printer drivers should all be in the kernel :)
Well... they happen not to be.
Only drivers providing services to the kernel itself (block,
network, ...) or doing things like direct DMA, interrupts, etc... that
aren't useable from an exposed userland interfaces need to be in the
kernel.
It would make it much simpler for programs to use these devices, because
not each of them has to implement everything needed to locate the device
and control it.
Then the best is to do a library.
pbbuttonsd supports both the I²C and PMU variant. The code is a mess
there and a generic driver would help to clean it up. And yes, I'm
partly responsible for it, since I supplied the original patch for the
PMU keyboard backlight support in pbbuttonsd.
Maybe controlling the keyboard backlight could be moved to its own
program anyway, because the algorithm used by pbbuttonsd isn't appealing
to all people. But those are just ideas.
Yeah, separate program or library would do the trick just fine. Also,
your driver doesn't handle reading the light sensors, does it ?
Oh, and using the LED class allows users to attach it to some trigger.
Maybe someone wants to use it as the IDE LED. :-)
That would be just insane :)
quoted
At least, if we do a driver, it should provide a common interface to
both PMU and i2c based LMUs
Yeah, I figured after sending it. You'll hear again from me once I got
my hands on an I²C backlight. Something like the AMS driver would be
nice.
I still think this has little to do in the kernel ...
Ben.
From: Michael Hanselmann <hidden> Date: 2006-08-27 23:24:57
On Mon, Aug 28, 2006 at 09:11:03AM +1000, Benjamin Herrenschmidt wrote:
quoted
Drivers are there to abstract hardware. Userland shouldn't know about
hardware specific commands (PMU commands in this case).
This is a bit of a broad statement :) If I were to follow you, thinks
like USB scanner or printer drivers should all be in the kernel :)
Well... they happen not to be.
True. But then again, a printer driver does little more than configuring
a single PWM value.
If there wasn't an I²C variant, we could even export these things as PMU
sub-devices. But there is one and a driver could easily hide these
differences from userland, because they simply don't matter there.
Then the best is to do a library.
There was some effort ongoing on that a few months ago (at least on
IRC). Was there anything coming out of it?
Yeah, separate program or library would do the trick just fine. Also,
your driver doesn't handle reading the light sensors, does it ?
No, it doesn't. The light sensor is a different device and doesn't
belong into a LED driver. I plan to do a driver for it separately.
So the target is to have one driver for backlight and one for sensors,
each handling the I²C and PMU variants. MacBooks have some other
variant, which could be included, theoretically. Lacking the hardware, I
can't do that, tough.
The main reason I did not do all at once is that I feared a discussion
like we have it now. I'm not going to invest much time for unused code
anymore like I did with the ctrl+click patch.
Greets,
Michael