]> git.karo-electronics.de Git - karo-tx-linux.git/blob - include/video/sh_mobile_meram.h
fbdev: sh_mobile_meram: Allocate ICBs automatically
[karo-tx-linux.git] / include / video / sh_mobile_meram.h
1 #ifndef __VIDEO_SH_MOBILE_MERAM_H__
2 #define __VIDEO_SH_MOBILE_MERAM_H__
3
4 /* For sh_mobile_meram_info.addr_mode */
5 enum {
6         SH_MOBILE_MERAM_MODE0 = 0,
7         SH_MOBILE_MERAM_MODE1
8 };
9
10 enum {
11         SH_MOBILE_MERAM_PF_NV = 0,
12         SH_MOBILE_MERAM_PF_RGB,
13         SH_MOBILE_MERAM_PF_NV24
14 };
15
16
17 struct sh_mobile_meram_priv;
18 struct sh_mobile_meram_ops;
19
20 /*
21  * struct sh_mobile_meram_info - MERAM platform data
22  * @reserved_icbs: Bitmask of reserved ICBs (for instance used through UIO)
23  */
24 struct sh_mobile_meram_info {
25         int                             addr_mode;
26         u32                             reserved_icbs;
27         struct sh_mobile_meram_ops      *ops;
28         struct sh_mobile_meram_priv     *priv;
29         struct platform_device          *pdev;
30 };
31
32 /* icb config */
33 struct sh_mobile_meram_icb_cfg {
34         unsigned int marker_icb;        /* ICB # for Marker ICB */
35         unsigned int cache_icb;         /* ICB # for Cache ICB */
36         unsigned int meram_size;        /* MERAM Buffer Size to use */
37 };
38
39 struct sh_mobile_meram_cfg {
40         struct sh_mobile_meram_icb_cfg icb[2];
41 };
42
43 struct module;
44 struct sh_mobile_meram_ops {
45         struct module   *module;
46         /* register usage of meram */
47         void *(*meram_register)(struct sh_mobile_meram_info *meram_dev,
48                                 const struct sh_mobile_meram_cfg *cfg,
49                                 unsigned int xres, unsigned int yres,
50                                 unsigned int pixelformat,
51                                 unsigned long base_addr_y,
52                                 unsigned long base_addr_c,
53                                 unsigned long *icb_addr_y,
54                                 unsigned long *icb_addr_c,
55                                 unsigned int *pitch);
56
57         /* unregister usage of meram */
58         int (*meram_unregister)(struct sh_mobile_meram_info *meram_dev,
59                                 void *data);
60
61         /* update meram settings */
62         int (*meram_update)(struct sh_mobile_meram_info *meram_dev,
63                             void *data,
64                             unsigned long base_addr_y,
65                             unsigned long base_addr_c,
66                             unsigned long *icb_addr_y,
67                             unsigned long *icb_addr_c);
68 };
69
70 #endif /* __VIDEO_SH_MOBILE_MERAM_H__  */