]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - include/video/sh_mobile_meram.h
sh_mobile_meram: Use direct function calls for the public API
[mirror_ubuntu-bionic-kernel.git] / include / video / sh_mobile_meram.h
CommitLineData
7caa4342
DHG
1#ifndef __VIDEO_SH_MOBILE_MERAM_H__
2#define __VIDEO_SH_MOBILE_MERAM_H__
3
4/* For sh_mobile_meram_info.addr_mode */
5enum {
6 SH_MOBILE_MERAM_MODE0 = 0,
7 SH_MOBILE_MERAM_MODE1
8};
9
10enum {
11 SH_MOBILE_MERAM_PF_NV = 0,
3fedd2ac
DHG
12 SH_MOBILE_MERAM_PF_RGB,
13 SH_MOBILE_MERAM_PF_NV24
7caa4342
DHG
14};
15
16
17struct sh_mobile_meram_priv;
7caa4342 18
48110050
LP
19/*
20 * struct sh_mobile_meram_info - MERAM platform data
21 * @reserved_icbs: Bitmask of reserved ICBs (for instance used through UIO)
22 */
7caa4342
DHG
23struct sh_mobile_meram_info {
24 int addr_mode;
48110050 25 u32 reserved_icbs;
7caa4342
DHG
26 struct sh_mobile_meram_priv *priv;
27 struct platform_device *pdev;
28};
29
30/* icb config */
d272f428 31struct sh_mobile_meram_icb_cfg {
d272f428 32 unsigned int meram_size; /* MERAM Buffer Size to use */
7caa4342
DHG
33};
34
35struct sh_mobile_meram_cfg {
2a618e03 36 struct sh_mobile_meram_icb_cfg icb[2];
7caa4342
DHG
37};
38
6e729b41
LP
39#if defined(CONFIG_FB_SH_MOBILE_MERAM) || \
40 defined(CONFIG_FB_SH_MOBILE_MERAM_MODULE)
41void *sh_mobile_meram_cache_alloc(struct sh_mobile_meram_info *dev,
42 const struct sh_mobile_meram_cfg *cfg,
43 unsigned int xres, unsigned int yres,
44 unsigned int pixelformat,
45 unsigned int *pitch);
46void sh_mobile_meram_cache_free(struct sh_mobile_meram_info *dev, void *data);
47void sh_mobile_meram_cache_update(struct sh_mobile_meram_info *dev, void *data,
48 unsigned long base_addr_y,
49 unsigned long base_addr_c,
50 unsigned long *icb_addr_y,
51 unsigned long *icb_addr_c);
52#else
53static inline void *
54sh_mobile_meram_cache_alloc(struct sh_mobile_meram_info *dev,
55 const struct sh_mobile_meram_cfg *cfg,
56 unsigned int xres, unsigned int yres,
57 unsigned int pixelformat,
58 unsigned int *pitch)
59{
60 return ERR_PTR(-ENODEV);
61}
62
63static inline void
64sh_mobile_meram_cache_free(struct sh_mobile_meram_info *dev, void *data)
65{
66}
67
68static inline void
69sh_mobile_meram_cache_update(struct sh_mobile_meram_info *dev, void *data,
cdf88b90
LP
70 unsigned long base_addr_y,
71 unsigned long base_addr_c,
72 unsigned long *icb_addr_y,
6e729b41
LP
73 unsigned long *icb_addr_c)
74{
75}
76#endif
7caa4342
DHG
77
78#endif /* __VIDEO_SH_MOBILE_MERAM_H__ */