summaryrefslogtreecommitdiffstats
path: root/include/linux/fb.h
diff options
context:
space:
mode:
authorMichael Hanselmann <linux-kernel@hansmi.ch>2006-06-25 05:47:08 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-25 10:00:59 -0700
commit5474c120aafe78ca54bf272f7a01107c42da2b21 (patch)
treec1b002a27703ce92c816bfb9844752186e33d403 /include/linux/fb.h
parent17660bdd5c1f1a165273c1a59cb5b87670a81cc4 (diff)
[PATCH] Rewritten backlight infrastructure for portable Apple computers
This patch contains a total rewrite of the backlight infrastructure for portable Apple computers. Backward compatibility is retained. A sysfs interface allows userland to control the brightness with more steps than before. Userland is allowed to upload a brightness curve for different monitors, similar to Mac OS X. [akpm@osdl.org: add needed exports] Signed-off-by: Michael Hanselmann <linux-kernel@hansmi.ch> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Richard Purdie <rpurdie@rpsys.net> Cc: "Antonino A. Daplas" <adaplas@pol.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/fb.h')
-rw-r--r--include/linux/fb.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/linux/fb.h b/include/linux/fb.h
index 315d89740dd..f1281687e54 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -1,6 +1,7 @@
#ifndef _LINUX_FB_H
#define _LINUX_FB_H
+#include <linux/backlight.h>
#include <asm/types.h>
/* Definitions of frame buffers */
@@ -366,6 +367,12 @@ struct fb_cursor {
struct fb_image image; /* Cursor image */
};
+#ifdef CONFIG_FB_BACKLIGHT
+/* Settings for the generic backlight code */
+#define FB_BACKLIGHT_LEVELS 128
+#define FB_BACKLIGHT_MAX 0xFF
+#endif
+
#ifdef __KERNEL__
#include <linux/fs.h>
@@ -756,6 +763,21 @@ struct fb_info {
struct fb_cmap cmap; /* Current cmap */
struct list_head modelist; /* mode list */
struct fb_videomode *mode; /* current mode */
+
+#ifdef CONFIG_FB_BACKLIGHT
+ /* Lock ordering:
+ * bl_mutex (protects bl_dev and bl_curve)
+ * bl_dev->sem (backlight class)
+ */
+ struct mutex bl_mutex;
+
+ /* assigned backlight device */
+ struct backlight_device *bl_dev;
+
+ /* Backlight level curve */
+ u8 bl_curve[FB_BACKLIGHT_LEVELS];
+#endif
+
struct fb_ops *fbops;
struct device *device;
struct class_device *class_device; /* sysfs per device attrs */
@@ -895,6 +917,7 @@ extern struct fb_info *framebuffer_alloc(size_t size, struct device *dev);
extern void framebuffer_release(struct fb_info *info);
extern int fb_init_class_device(struct fb_info *fb_info);
extern void fb_cleanup_class_device(struct fb_info *head);
+extern void fb_bl_default_curve(struct fb_info *fb_info, u8 off, u8 min, u8 max);
/* drivers/video/fbmon.c */
#define FB_MAXTIMINGS 0