1/* SPDX-License-Identifier: GPL-2.0 */
2
3#ifndef _FB_INTERNAL_H
4#define _FB_INTERNAL_H
5
6#include <linux/device.h>
7#include <linux/fb.h>
8#include <linux/mutex.h>
9
10/* fb_devfs.c */
11#if defined(CONFIG_FB_DEVICE)
12int fb_register_chrdev(void);
13void fb_unregister_chrdev(void);
14#else
15static inline int fb_register_chrdev(void)
16{
17 return 0;
18}
19static inline void fb_unregister_chrdev(void)
20{ }
21#endif
22
23/* fb_logo.c */
24#if defined(CONFIG_LOGO)
25extern bool ;
26extern int fb_logo_count;
27int (struct fb_info *fb_info, int rotate);
28int (struct fb_info *fb_info, int rotate);
29#else
30static inline int fb_prepare_logo(struct fb_info *info, int rotate)
31{
32 return 0;
33}
34static inline int fb_show_logo(struct fb_info *info, int rotate)
35{
36 return 0;
37}
38#endif /* CONFIG_LOGO */
39
40/* fbmem.c */
41extern struct class *fb_class;
42extern struct mutex registration_lock;
43extern struct fb_info *registered_fb[FB_MAX];
44extern int num_registered_fb;
45struct fb_info *get_fb_info(unsigned int idx);
46void put_fb_info(struct fb_info *fb_info);
47
48/* fb_procfs.c */
49#if defined(CONFIG_FB_DEVICE)
50int fb_init_procfs(void);
51void fb_cleanup_procfs(void);
52#else
53static inline int fb_init_procfs(void)
54{
55 return 0;
56}
57static inline void fb_cleanup_procfs(void)
58{ }
59#endif
60
61/* fbsysfs.c */
62#if defined(CONFIG_FB_DEVICE)
63int fb_device_create(struct fb_info *fb_info);
64void fb_device_destroy(struct fb_info *fb_info);
65#else
66static inline int fb_device_create(struct fb_info *fb_info)
67{
68 /*
69 * Acquire a reference on the parent device to avoid
70 * unplug operations behind our back. With the fbdev
71 * device enabled, this is performed within register_device().
72 */
73 get_device(fb_info->device);
74
75 return 0;
76}
77static inline void fb_device_destroy(struct fb_info *fb_info)
78{
79 /* Undo the get_device() from fb_device_create() */
80 put_device(fb_info->device);
81}
82#endif
83
84#endif
85

source code of linux/drivers/video/fbdev/core/fb_internal.h