diff options
Diffstat (limited to 'drivers/video/fbdev/sbuslib.h')
-rw-r--r-- | drivers/video/fbdev/sbuslib.h | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/drivers/video/fbdev/sbuslib.h b/drivers/video/fbdev/sbuslib.h index a6b9a2467646..6466b4cbcd7b 100644 --- a/drivers/video/fbdev/sbuslib.h +++ b/drivers/video/fbdev/sbuslib.h @@ -3,6 +3,11 @@ #ifndef _SBUSLIB_H #define _SBUSLIB_H +struct device_node; +struct fb_info; +struct fb_var_screeninfo; +struct vm_area_struct; + struct sbus_mmap_map { unsigned long voff; unsigned long poff; @@ -14,7 +19,6 @@ struct sbus_mmap_map { extern void sbusfb_fill_var(struct fb_var_screeninfo *var, struct device_node *dp, int bpp); -struct vm_area_struct; extern int sbusfb_mmap_helper(struct sbus_mmap_map *map, unsigned long physbase, unsigned long fbsize, unsigned long iospace, @@ -25,4 +29,35 @@ int sbusfb_ioctl_helper(unsigned long cmd, unsigned long arg, int sbusfb_compat_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg); +/* + * Initialize struct fb_ops for SBUS I/O. + */ + +#define __FB_DEFAULT_SBUS_OPS_RDWR(__prefix) \ + .fb_read = fb_io_read, \ + .fb_write = fb_io_write + +#define __FB_DEFAULT_SBUS_OPS_DRAW(__prefix) \ + .fb_fillrect = cfb_fillrect, \ + .fb_copyarea = cfb_copyarea, \ + .fb_imageblit = cfb_imageblit + +#ifdef CONFIG_COMPAT +#define __FB_DEFAULT_SBUS_OPS_IOCTL(__prefix) \ + .fb_ioctl = __prefix ## _sbusfb_ioctl, \ + .fb_compat_ioctl = sbusfb_compat_ioctl +#else +#define __FB_DEFAULT_SBUS_OPS_IOCTL(__prefix) \ + .fb_ioctl = __prefix ## _sbusfb_ioctl +#endif + +#define __FB_DEFAULT_SBUS_OPS_MMAP(__prefix) \ + .fb_mmap = __prefix ## _sbusfb_mmap + +#define FB_DEFAULT_SBUS_OPS(__prefix) \ + __FB_DEFAULT_SBUS_OPS_RDWR(__prefix), \ + __FB_DEFAULT_SBUS_OPS_DRAW(__prefix), \ + __FB_DEFAULT_SBUS_OPS_IOCTL(__prefix), \ + __FB_DEFAULT_SBUS_OPS_MMAP(__prefix) + #endif /* _SBUSLIB_H */ |