blob: 6755e3f89a363f70ea0d09a6e7ba64b7fbcc4e0e [file] [log] [blame]
Damian7caa4342011-05-18 11:10:07 +00001#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,
Damian3fedd2a2011-05-18 11:10:08 +000012 SH_MOBILE_MERAM_PF_RGB,
13 SH_MOBILE_MERAM_PF_NV24
Damian7caa4342011-05-18 11:10:07 +000014};
15
16
17struct sh_mobile_meram_priv;
18struct sh_mobile_meram_ops;
19
20struct sh_mobile_meram_info {
21 int addr_mode;
22 struct sh_mobile_meram_ops *ops;
23 struct sh_mobile_meram_priv *priv;
24 struct platform_device *pdev;
25};
26
27/* icb config */
Laurent Pinchartd272f422011-09-19 11:40:31 +020028struct sh_mobile_meram_icb_cfg {
29 unsigned int marker_icb; /* ICB # for Marker ICB */
30 unsigned int cache_icb; /* ICB # for Cache ICB */
31 unsigned int meram_offset; /* MERAM Buffer Offset to use */
32 unsigned int meram_size; /* MERAM Buffer Size to use */
Damian7caa4342011-05-18 11:10:07 +000033
Laurent Pinchartd272f422011-09-19 11:40:31 +020034 unsigned int cache_unit; /* bytes to cache per ICB */
Damian7caa4342011-05-18 11:10:07 +000035};
36
37struct sh_mobile_meram_cfg {
Laurent Pinchartd272f422011-09-19 11:40:31 +020038 struct sh_mobile_meram_icb_cfg icb[2];
Damian7caa4342011-05-18 11:10:07 +000039 int pixelformat;
40 int current_reg;
41};
42
43struct module;
44struct sh_mobile_meram_ops {
45 struct module *module;
46 /* register usage of meram */
47 int (*meram_register)(struct sh_mobile_meram_info *meram_dev,
48 struct sh_mobile_meram_cfg *cfg,
Laurent Pinchart05432832011-09-19 11:40:31 +020049 unsigned int xres, unsigned int yres,
50 unsigned int pixelformat,
Damian7caa4342011-05-18 11:10:07 +000051 unsigned long base_addr_y,
52 unsigned long base_addr_c,
53 unsigned long *icb_addr_y,
Laurent Pinchart05432832011-09-19 11:40:31 +020054 unsigned long *icb_addr_c,
55 unsigned int *pitch);
Damian7caa4342011-05-18 11:10:07 +000056
57 /* unregister usage of meram */
58 int (*meram_unregister)(struct sh_mobile_meram_info *meram_dev,
59 struct sh_mobile_meram_cfg *cfg);
60
61 /* update meram settings */
62 int (*meram_update)(struct sh_mobile_meram_info *meram_dev,
63 struct sh_mobile_meram_cfg *cfg,
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__ */