Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / drivers / video / fbdev / sbuslib.h
blobe9af2dc93f94942bbde104705b0d81d06329c4c8
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* sbuslib.h: SBUS fb helper library interfaces */
3 #ifndef _SBUSLIB_H
4 #define _SBUSLIB_H
6 struct device_node;
7 struct fb_info;
8 struct fb_var_screeninfo;
9 struct vm_area_struct;
11 struct sbus_mmap_map {
12 unsigned long voff;
13 unsigned long poff;
14 unsigned long size;
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,
27 struct fb_info *info,
28 int type, int fb_depth, unsigned long fb_size);
29 int sbusfb_compat_ioctl(struct fb_info *info, unsigned int cmd,
30 unsigned long arg);
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
45 #ifdef CONFIG_COMPAT
46 #define __FB_DEFAULT_SBUS_OPS_IOCTL(__prefix) \
47 .fb_ioctl = __prefix ## _sbusfb_ioctl, \
48 .fb_compat_ioctl = sbusfb_compat_ioctl
49 #else
50 #define __FB_DEFAULT_SBUS_OPS_IOCTL(__prefix) \
51 .fb_ioctl = __prefix ## _sbusfb_ioctl
52 #endif
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 */