Damian | 7caa434 | 2011-05-18 11:10:07 +0000 | [diff] [blame] | 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, |
Damian | 3fedd2a | 2011-05-18 11:10:08 +0000 | [diff] [blame] | 12 | SH_MOBILE_MERAM_PF_RGB, |
| 13 | SH_MOBILE_MERAM_PF_NV24 |
Damian | 7caa434 | 2011-05-18 11:10:07 +0000 | [diff] [blame] | 14 | }; |
| 15 | |
| 16 | |
| 17 | struct sh_mobile_meram_priv; |
| 18 | struct sh_mobile_meram_ops; |
| 19 | |
| 20 | struct 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 Pinchart | d272f42 | 2011-09-19 11:40:31 +0200 | [diff] [blame] | 28 | struct 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 */ |
Damian | 7caa434 | 2011-05-18 11:10:07 +0000 | [diff] [blame] | 33 | }; |
| 34 | |
| 35 | struct sh_mobile_meram_cfg { |
Laurent Pinchart | 2a618e0 | 2011-09-19 11:40:31 +0200 | [diff] [blame^] | 36 | struct sh_mobile_meram_icb_cfg icb[2]; |
Damian | 7caa434 | 2011-05-18 11:10:07 +0000 | [diff] [blame] | 37 | }; |
| 38 | |
| 39 | struct module; |
| 40 | struct sh_mobile_meram_ops { |
| 41 | struct module *module; |
| 42 | /* register usage of meram */ |
| 43 | int (*meram_register)(struct sh_mobile_meram_info *meram_dev, |
Laurent Pinchart | 2a618e0 | 2011-09-19 11:40:31 +0200 | [diff] [blame^] | 44 | const struct sh_mobile_meram_cfg *cfg, |
Laurent Pinchart | 0543283 | 2011-09-19 11:40:31 +0200 | [diff] [blame] | 45 | unsigned int xres, unsigned int yres, |
| 46 | unsigned int pixelformat, |
Damian | 7caa434 | 2011-05-18 11:10:07 +0000 | [diff] [blame] | 47 | unsigned long base_addr_y, |
| 48 | unsigned long base_addr_c, |
| 49 | unsigned long *icb_addr_y, |
Laurent Pinchart | 0543283 | 2011-09-19 11:40:31 +0200 | [diff] [blame] | 50 | unsigned long *icb_addr_c, |
| 51 | unsigned int *pitch); |
Damian | 7caa434 | 2011-05-18 11:10:07 +0000 | [diff] [blame] | 52 | |
| 53 | /* unregister usage of meram */ |
| 54 | int (*meram_unregister)(struct sh_mobile_meram_info *meram_dev, |
Laurent Pinchart | 2a618e0 | 2011-09-19 11:40:31 +0200 | [diff] [blame^] | 55 | const struct sh_mobile_meram_cfg *cfg); |
Damian | 7caa434 | 2011-05-18 11:10:07 +0000 | [diff] [blame] | 56 | |
| 57 | /* update meram settings */ |
| 58 | int (*meram_update)(struct sh_mobile_meram_info *meram_dev, |
Laurent Pinchart | 2a618e0 | 2011-09-19 11:40:31 +0200 | [diff] [blame^] | 59 | const struct sh_mobile_meram_cfg *cfg, |
Damian | 7caa434 | 2011-05-18 11:10:07 +0000 | [diff] [blame] | 60 | unsigned long base_addr_y, |
| 61 | unsigned long base_addr_c, |
| 62 | unsigned long *icb_addr_y, |
| 63 | unsigned long *icb_addr_c); |
| 64 | }; |
| 65 | |
| 66 | #endif /* __VIDEO_SH_MOBILE_MERAM_H__ */ |