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