Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
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/* fbmem.c */
24extern struct class *fb_class;
25extern struct mutex registration_lock;
26extern struct fb_info *registered_fb[FB_MAX];
27extern int num_registered_fb;
28struct fb_info *get_fb_info(unsigned int idx);
29void put_fb_info(struct fb_info *fb_info);
30
31/* fb_procfs.c */
32#if defined(CONFIG_FB_DEVICE)
33int fb_init_procfs(void);
34void fb_cleanup_procfs(void);
35#else
36static inline int fb_init_procfs(void)
37{
38 return 0;
39}
40static inline void fb_cleanup_procfs(void)
41{ }
42#endif
43
44/* fbsysfs.c */
45#if defined(CONFIG_FB_DEVICE)
46int fb_device_create(struct fb_info *fb_info);
47void fb_device_destroy(struct fb_info *fb_info);
48#else
49static inline int fb_device_create(struct fb_info *fb_info)
50{
51 /*
52 * Acquire a reference on the parent device to avoid
53 * unplug operations behind our back. With the fbdev
54 * device enabled, this is performed within register_device().
55 */
56 get_device(fb_info->device);
57
58 return 0;
59}
60static inline void fb_device_destroy(struct fb_info *fb_info)
61{
62 /* Undo the get_device() from fb_device_create() */
63 put_device(fb_info->device);
64}
65#endif
66
67#endif