1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* sbuslib.h: SBUS fb helper library interfaces */
8 struct fb_var_screeninfo
;
11 struct sbus_mmap_map
{
17 #define SBUS_MMAP_FBSIZE(n) (-n)
18 #define SBUS_MMAP_EMPTY 0x80000000
20 extern void sbusfb_fill_var(struct fb_var_screeninfo
*var
,
21 struct device_node
*dp
, int bpp
);
22 extern int sbusfb_mmap_helper(const struct sbus_mmap_map
*map
,
23 unsigned long physbase
, unsigned long fbsize
,
24 unsigned long iospace
,
25 struct vm_area_struct
*vma
);
26 int sbusfb_ioctl_helper(unsigned long cmd
, unsigned long arg
,
28 int type
, int fb_depth
, unsigned long fb_size
);
29 int sbusfb_compat_ioctl(struct fb_info
*info
, unsigned int cmd
,
33 * Initialize struct fb_ops for SBUS I/O.
36 #define __FB_DEFAULT_SBUS_OPS_RDWR(__prefix) \
37 .fb_read = fb_io_read, \
38 .fb_write = fb_io_write
40 #define __FB_DEFAULT_SBUS_OPS_DRAW(__prefix) \
41 .fb_fillrect = cfb_fillrect, \
42 .fb_copyarea = cfb_copyarea, \
43 .fb_imageblit = cfb_imageblit
46 #define __FB_DEFAULT_SBUS_OPS_IOCTL(__prefix) \
47 .fb_ioctl = __prefix ## _sbusfb_ioctl, \
48 .fb_compat_ioctl = sbusfb_compat_ioctl
50 #define __FB_DEFAULT_SBUS_OPS_IOCTL(__prefix) \
51 .fb_ioctl = __prefix ## _sbusfb_ioctl
54 #define __FB_DEFAULT_SBUS_OPS_MMAP(__prefix) \
55 .fb_mmap = __prefix ## _sbusfb_mmap
57 #define FB_DEFAULT_SBUS_OPS(__prefix) \
58 __FB_DEFAULT_SBUS_OPS_RDWR(__prefix), \
59 __FB_DEFAULT_SBUS_OPS_DRAW(__prefix), \
60 __FB_DEFAULT_SBUS_OPS_IOCTL(__prefix), \
61 __FB_DEFAULT_SBUS_OPS_MMAP(__prefix)
63 #endif /* _SBUSLIB_H */