lkml.org 
[lkml]   [2004]   [Jul]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Backlight and LCD module patches [2]
On 06/17/04 13:35:17, Andrew Zabolotny wrote:
>
> This patch adds lcd and backlight driver classes so that the
> lowlevel lcd and backlight power controls can be separated from
> framebuffer drivers.
>

What about something like this patch? It still needs a little work.

The problem I see is that we would like something like a bus to match
together class devices. What would be really nice is something like
this.

struct class_match {
struct class *class1;
struct class *class2;

int (*match)(struct class_device *dev1, struct class_device *dev2);
};

This class match structure would be very similar to a bus, in that it
matches together two classes instead of matching a device to a driver.
All the class code would have to do is call the match function for all
possible combinations of class devices in class1 and in class2. If
match returned true, then it would create symbolic links between the
two.

So for example, one class would be named fb and one class be named lcd.
When we match two devices, they would symlink to each other like so.
/sys/class/lcd/foo/fb is a symlink to /sys/class/fb/bar and /sys/class/
fb/bar/lcd is a symlink to /sys/class/lcd/foo.

The provided match function would have to take care of actually linking
the two devices together (that is, giving the fb_info device a pointer
to the actual lcd_properties class or storing the pointer to the
fb_info structure in the lcd_device structure or whatever).

If we had this class_match structure, we could elminate the matching
code I added to this patch.

Lastly, wouldn't it be better to create a drivers/video/lcd directory
so that all the lcd drivers can go in there and not clutter up the main
drivers/video directory?

John
\
 
 \ /
  Last update: 2005-03-22 14:04    [W:0.090 / U:0.220 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site