Re: two patches - request for comments

From: Andrew Zabolotny
Date: Wed Jun 02 2004 - 16:32:28 EST


On Wed, 2 Jun 2004 10:15:42 -0700
Greg KH <greg@xxxxxxxxx> wrote:

> > In theory, if we would use the standard power interface, it could use the
> > different levels of power saving, e.g. 0 - controller and LCD on, 1,2 -
> > LCD off, controller on, 3,4 - both off.
> Please use the standard power interface, and use the standard levels of
> power state. That's why we _have_ this driver model in the first
> place...
The problem is that I cannot use the standard power interface because I don't
know how. The patch in question implements class devices, not regular devices.
Class devices don't use the standard power management scheme. Here:

/sys # ls devices/platform/
detach_state power pxa2xx_udc0
mq11xx0 pxa2xx-pcmcia0 pxafb0
mq11xx_udc0 pxa2xx_serial0 pxamci0

None of the above devices implement the backlight and LCD; they use bits from
different devices; in my case several GPIO pins from the mq11xx0 device, a
couple of CPU' GPIO pins (which aren't present in sysfs at all).

Now the mq11xx0 device (which is a System-On-Chip, e.g. a single chip
encomprising a lot of somehow-independent-functions) has a lot of subdevices:

/sys # ls devices/platform/mq11xx0/
detach_state mq11xx_i2s0 mq11xx_spi0 mq11xx_uhc0
mq11xx_fb0 mq11xx_lcd0 mq11xx_udc0 power

The backlight is controlled by a few spare bits from the mq11xx_spi0 device
(which is a SPI bus controller). I don't think it makes sense to create the
backlight device node under /sys/devices/platform/mq11xx0/mq11xx_spi0/;
besides that's on my PDA; on other PDAs they could be located anywhere else,
thus the software will have a major headache to find the backlight/lcd power
controls.

Right now it works this way:

/sys # ls class/backlight/mq11xx_fb0/
brightness max_brightness power
/sys # ls class/lcd/mq11xx_fb0/
contrast enable max_contrast power

I could unify lcd's 'power' and 'enable' attributes into one (they already use
the 'standard' 0-4 power levels), like I stated in one of my previous
messages, but it anyways would be quite different from the current power
management structure.

> > Well, the power interface under drivers/ is available for framebuffer.
> > If it would handle it properly (the framebuffer drivers I've tried
> > don't, alas)
> Then they need to be fixed to do so.
Doh, you don't want me to fix the whole kernel in one patch, don't you? :-)

--
Greetings,
Andrew
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/