driver: add dev_name inline
[barebox-mini2440.git] / include / fb.h
blob595e1bb1f222bf2f553ca807284f2ff421d29487
1 #ifndef __FB_H
2 #define __FB_H
4 #include <ioctl.h>
5 #include <param.h>
7 #define FB_VISUAL_TRUECOLOR 2 /* True color */
8 #define FB_VISUAL_PSEUDOCOLOR 3 /* Pseudo color (like atari) */
9 #define FB_VISUAL_DIRECTCOLOR 4 /* Direct color */
10 #define FB_VISUAL_STATIC_PSEUDOCOLOR 5 /* Pseudo color readonly */
12 struct fb_videomode {
13 const char *name; /* optional */
14 u32 refresh; /* optional */
15 u32 xres;
16 u32 yres;
17 u32 pixclock;
18 u32 left_margin;
19 u32 right_margin;
20 u32 upper_margin;
21 u32 lower_margin;
22 u32 hsync_len;
23 u32 vsync_len;
24 u32 sync;
25 u32 vmode;
26 u32 flag;
29 /* Interpretation of offset for color fields: All offsets are from the right,
30 * inside a "pixel" value, which is exactly 'bits_per_pixel' wide (means: you
31 * can use the offset as right argument to <<). A pixel afterwards is a bit
32 * stream and is written to video memory as that unmodified.
34 * For pseudocolor: offset and length should be the same for all color
35 * components. Offset specifies the position of the least significant bit
36 * of the pallette index in a pixel value. Length indicates the number
37 * of available palette entries (i.e. # of entries = 1 << length).
39 struct fb_bitfield {
40 u32 offset; /* beginning of bitfield */
41 u32 length; /* length of bitfield */
42 u32 msb_right; /* != 0 : Most significant bit is */
43 /* right */
46 struct fb_info;
48 struct fb_ops {
49 /* set color register */
50 int (*fb_setcolreg)(unsigned regno, unsigned red, unsigned green,
51 unsigned blue, unsigned transp, struct fb_info *info);
52 void (*fb_enable)(struct fb_info *info);
53 void (*fb_disable)(struct fb_info *info);
56 struct fb_info {
57 struct fb_videomode *mode;
59 struct fb_ops *fbops;
60 struct device_d dev; /* This is this fb device */
61 struct param_d param_enable;
62 char enable_string[1];
64 void *screen_base;
66 void *priv;
68 struct cdev cdev;
70 u32 xres; /* visible resolution */
71 u32 yres;
72 u32 bits_per_pixel; /* guess what */
74 u32 grayscale; /* != 0 Graylevels instead of colors */
76 struct fb_bitfield red; /* bitfield in fb mem if true color, */
77 struct fb_bitfield green; /* else only length is significant */
78 struct fb_bitfield blue;
79 struct fb_bitfield transp; /* transparency */
82 int register_framebuffer(struct fb_info *info);
84 #define FBIOGET_SCREENINFO _IOR('F', 1, loff_t)
85 #define FBIO_ENABLE _IO('F', 2)
86 #define FBIO_DISABLE _IO('F', 3)
88 #endif /* __FB_H */