vmalloc: fix __GFP_HIGHMEM usage for vmalloc_32 on 32b systems
[linux/fpc-iii.git] / include / video / sh_mobile_meram.h
blobf4efc21e205d3567018de73ec3f2680e38bacee5
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __VIDEO_SH_MOBILE_MERAM_H__
3 #define __VIDEO_SH_MOBILE_MERAM_H__
5 /* For sh_mobile_meram_info.addr_mode */
6 enum {
7 SH_MOBILE_MERAM_MODE0 = 0,
8 SH_MOBILE_MERAM_MODE1
9 };
11 enum {
12 SH_MOBILE_MERAM_PF_NV = 0,
13 SH_MOBILE_MERAM_PF_RGB,
14 SH_MOBILE_MERAM_PF_NV24
18 struct sh_mobile_meram_priv;
21 * struct sh_mobile_meram_info - MERAM platform data
22 * @reserved_icbs: Bitmask of reserved ICBs (for instance used through UIO)
24 struct sh_mobile_meram_info {
25 int addr_mode;
26 u32 reserved_icbs;
27 struct sh_mobile_meram_priv *priv;
28 struct platform_device *pdev;
31 /* icb config */
32 struct sh_mobile_meram_icb_cfg {
33 unsigned int meram_size; /* MERAM Buffer Size to use */
36 struct sh_mobile_meram_cfg {
37 struct sh_mobile_meram_icb_cfg icb[2];
40 #if defined(CONFIG_FB_SH_MOBILE_MERAM) || \
41 defined(CONFIG_FB_SH_MOBILE_MERAM_MODULE)
42 unsigned long sh_mobile_meram_alloc(struct sh_mobile_meram_info *meram_dev,
43 size_t size);
44 void sh_mobile_meram_free(struct sh_mobile_meram_info *meram_dev,
45 unsigned long mem, size_t size);
46 void *sh_mobile_meram_cache_alloc(struct sh_mobile_meram_info *dev,
47 const struct sh_mobile_meram_cfg *cfg,
48 unsigned int xres, unsigned int yres,
49 unsigned int pixelformat,
50 unsigned int *pitch);
51 void sh_mobile_meram_cache_free(struct sh_mobile_meram_info *dev, void *data);
52 void sh_mobile_meram_cache_update(struct sh_mobile_meram_info *dev, void *data,
53 unsigned long base_addr_y,
54 unsigned long base_addr_c,
55 unsigned long *icb_addr_y,
56 unsigned long *icb_addr_c);
57 #else
58 static inline unsigned long
59 sh_mobile_meram_alloc(struct sh_mobile_meram_info *meram_dev, size_t size)
61 return 0;
64 static inline void
65 sh_mobile_meram_free(struct sh_mobile_meram_info *meram_dev,
66 unsigned long mem, size_t size)
70 static inline void *
71 sh_mobile_meram_cache_alloc(struct sh_mobile_meram_info *dev,
72 const struct sh_mobile_meram_cfg *cfg,
73 unsigned int xres, unsigned int yres,
74 unsigned int pixelformat,
75 unsigned int *pitch)
77 return ERR_PTR(-ENODEV);
80 static inline void
81 sh_mobile_meram_cache_free(struct sh_mobile_meram_info *dev, void *data)
85 static inline void
86 sh_mobile_meram_cache_update(struct sh_mobile_meram_info *dev, void *data,
87 unsigned long base_addr_y,
88 unsigned long base_addr_c,
89 unsigned long *icb_addr_y,
90 unsigned long *icb_addr_c)
93 #endif
95 #endif /* __VIDEO_SH_MOBILE_MERAM_H__ */