Bug#281952: additional /proc/device-tree patch for this issue. ...

Sven Luther Sven Luther <sven.luther@wanadoo.fr>, 281952@bugs.debian.org
Sun, 23 Jan 2005 14:51:34 +0100


On Sun, Jan 23, 2005 at 01:13:01PM +0100, Juergen Kreileder wrote:
> Sven Luther <sven.luther@wanadoo.fr> writes:
> 
> > On Sun, Jan 23, 2005 at 12:37:50PM +0100, Juergen Kreileder wrote:
> >> It's a via-pmu: 
> >
> > Ok, so where is the problem ? The /dev/pmu stuff would be accessible
> > in acme/control-center/whatever-it-is, nd everyone will be happy ?
> > Unless you are telling me that you don't have blacklight control for
> > this one ?
> 
> It doesn't have a backlight control.

Ok.

> > Ah. So, you are not using a debian kernel, and there is no reason to
> > support you at all :)
> 
> Hehe :-)
> (Using the kernel provided by Debian would mean wasting 2GB of memory
> on my machine.)

So you are using a 64bit kernel, or is there anything else in particular you
have a problem with ? 

> > Well, we need to test this from userland, not kernelland.
> 
> It shouldn't be too hard to find "backlight" in device-tree.

Indeed.

/me boots my ibook to check ...

Mmm, indeed. The following alogirthm is a rafinement of the current setup in
CVS :

  1) if there is no /proc/device-tree/aliases/via-pmu, we quit.
  2) if there is no /proc/device-tree/aliases/mac-io (should never be the case
     if there is a via-pmu i think), we quit too.
  3) if there is no /proc/device-tree/`cat /proc/device-tree/aliases/mac-io`/backlight
     we quit too, since there is no fblevel stuff available in /dev/pmu.
  => obvious problem is if there is a backlight without via-pmu, or if the
     backlight is not on node mac-io.  I doubt this happens for now, and we
     can fix those cases later if they show up.

And then, we continue with the normal stuff : 

  4) if there is no /dev/pmu, we warn the user silently and quit.
  5) if /dev/pmu is not writable, we warn the user silently, and quit.
  6) if it passes upto here, we do the fblevel stuff.
  7) we add a mention to the above in README.Debian, including an example on
     how to make /dev/pmu usable with and without udev. Also a warning on the
     security risks involved.

Does this sound acceptable ? 

> >> ,----
> >> |         bk_node = find_devices("backlight");
> >
> > Ok, so there is maybe a blacklight device somewhere in /proc/devices
> > ?
> 
> Yes. (At least I think so, I only have one machine and that doesn't
> have any backlight control.)

Ok.

> > But these don't have a /dev/pmu ? Or do they have it ? 
> 
> via-pmu.c uses register_backlight_controller from pmac_backlight.c, so
> this should cover machines with via-pmu.

Indeed.

Friendly,

Sven Luther