162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
262306a36Sopenharmony_ci/* sbuslib.h: SBUS fb helper library interfaces */
362306a36Sopenharmony_ci#ifndef _SBUSLIB_H
462306a36Sopenharmony_ci#define _SBUSLIB_H
562306a36Sopenharmony_ci
662306a36Sopenharmony_cistruct sbus_mmap_map {
762306a36Sopenharmony_ci	unsigned long voff;
862306a36Sopenharmony_ci	unsigned long poff;
962306a36Sopenharmony_ci	unsigned long size;
1062306a36Sopenharmony_ci};
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_ci#define SBUS_MMAP_FBSIZE(n) (-n)
1362306a36Sopenharmony_ci#define SBUS_MMAP_EMPTY	0x80000000
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_ciextern void sbusfb_fill_var(struct fb_var_screeninfo *var,
1662306a36Sopenharmony_ci			    struct device_node *dp, int bpp);
1762306a36Sopenharmony_cistruct vm_area_struct;
1862306a36Sopenharmony_ciextern int sbusfb_mmap_helper(struct sbus_mmap_map *map,
1962306a36Sopenharmony_ci			      unsigned long physbase, unsigned long fbsize,
2062306a36Sopenharmony_ci			      unsigned long iospace,
2162306a36Sopenharmony_ci			      struct vm_area_struct *vma);
2262306a36Sopenharmony_ciint sbusfb_ioctl_helper(unsigned long cmd, unsigned long arg,
2362306a36Sopenharmony_ci			struct fb_info *info,
2462306a36Sopenharmony_ci			int type, int fb_depth, unsigned long fb_size);
2562306a36Sopenharmony_ciint sbusfb_compat_ioctl(struct fb_info *info, unsigned int cmd,
2662306a36Sopenharmony_ci			unsigned long arg);
2762306a36Sopenharmony_ci
2862306a36Sopenharmony_ci#endif /* _SBUSLIB_H */
29