blob: 29b2fd3b147e8773cadcd08f5f107fad0d7a7000 [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
Laurent Pinchart48110052011-12-12 16:36:13 +010020/*
21 * struct sh_mobile_meram_info - MERAM platform data
22 * @reserved_icbs: Bitmask of reserved ICBs (for instance used through UIO)
23 */
Damian7caa4342011-05-18 11:10:07 +000024struct sh_mobile_meram_info {
25 int addr_mode;
Laurent Pinchart48110052011-12-12 16:36:13 +010026 u32 reserved_icbs;
Damian7caa4342011-05-18 11:10:07 +000027 struct sh_mobile_meram_ops *ops;
28 struct sh_mobile_meram_priv *priv;
29 struct platform_device *pdev;
30};
31
32/* icb config */
Laurent Pinchartd272f422011-09-19 11:40:31 +020033struct sh_mobile_meram_icb_cfg {
Laurent Pinchartd272f422011-09-19 11:40:31 +020034 unsigned int meram_size; /* MERAM Buffer Size to use */
Damian7caa4342011-05-18 11:10:07 +000035};
36
37struct sh_mobile_meram_cfg {
Laurent Pinchart2a618e02011-09-19 11:40:31 +020038 struct sh_mobile_meram_icb_cfg icb[2];
Damian7caa4342011-05-18 11:10:07 +000039};
40
41struct module;
42struct sh_mobile_meram_ops {
43 struct module *module;
44 /* register usage of meram */
Laurent Pinchart48110052011-12-12 16:36:13 +010045 void *(*meram_register)(struct sh_mobile_meram_info *meram_dev,
46 const struct sh_mobile_meram_cfg *cfg,
47 unsigned int xres, unsigned int yres,
48 unsigned int pixelformat,
Laurent Pinchart48110052011-12-12 16:36:13 +010049 unsigned int *pitch);
Damian7caa4342011-05-18 11:10:07 +000050
51 /* unregister usage of meram */
Laurent Pinchartcdf88b92011-11-22 00:56:58 +010052 void (*meram_unregister)(struct sh_mobile_meram_info *meram_dev,
53 void *data);
Damian7caa4342011-05-18 11:10:07 +000054
55 /* update meram settings */
Laurent Pinchartcdf88b92011-11-22 00:56:58 +010056 void (*meram_update)(struct sh_mobile_meram_info *meram_dev, void *data,
57 unsigned long base_addr_y,
58 unsigned long base_addr_c,
59 unsigned long *icb_addr_y,
60 unsigned long *icb_addr_c);
Damian7caa4342011-05-18 11:10:07 +000061};
62
63#endif /* __VIDEO_SH_MOBILE_MERAM_H__ */