aboutsummaryrefslogtreecommitdiffstats
path: root/include/video
diff options
context:
space:
mode:
authorDamian <dhobsong@igel.co.jp>2011-05-18 07:10:07 -0400
committerPaul Mundt <lethal@linux-sh.org>2011-05-23 03:06:24 -0400
commit7caa4342ca5b37d2d178b464c16badd4228b3b7b (patch)
tree0111e05278facfc0eb92c46b80c577d1e1e694e4 /include/video
parent71a8638480eb8fb6cfabe2ee9ca3fbc6e3453a14 (diff)
sh_mobile_meram: MERAM framework for LCDC
Based on the patch by Takanari Hayama <taki@igel.co.jp> Adds support framework necessary to use Media RAM (MERAM) caching functionality with the LCDC. The MERAM is accessed through up to 4 Interconnect Buffers (ICBs). ICB numbers and MERAM address ranges to use are specified in by filling in the .meram_cfg member of the LCDC platform data Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'include/video')
-rw-r--r--include/video/sh_mobile_lcdc.h3
-rw-r--r--include/video/sh_mobile_meram.h67
2 files changed, 70 insertions, 0 deletions
diff --git a/include/video/sh_mobile_lcdc.h b/include/video/sh_mobile_lcdc.h
index 2c8d369190b..d964e68fc61 100644
--- a/include/video/sh_mobile_lcdc.h
+++ b/include/video/sh_mobile_lcdc.h
@@ -2,6 +2,7 @@
2#define __ASM_SH_MOBILE_LCDC_H__ 2#define __ASM_SH_MOBILE_LCDC_H__
3 3
4#include <linux/fb.h> 4#include <linux/fb.h>
5#include <video/sh_mobile_meram.h>
5 6
6enum { 7enum {
7 RGB8, /* 24bpp, 8:8:8 */ 8 RGB8, /* 24bpp, 8:8:8 */
@@ -87,11 +88,13 @@ struct sh_mobile_lcdc_chan_cfg {
87 struct sh_mobile_lcdc_bl_info bl_info; 88 struct sh_mobile_lcdc_bl_info bl_info;
88 struct sh_mobile_lcdc_sys_bus_cfg sys_bus_cfg; /* only for SYSn I/F */ 89 struct sh_mobile_lcdc_sys_bus_cfg sys_bus_cfg; /* only for SYSn I/F */
89 int nonstd; 90 int nonstd;
91 struct sh_mobile_meram_cfg *meram_cfg;
90}; 92};
91 93
92struct sh_mobile_lcdc_info { 94struct sh_mobile_lcdc_info {
93 int clock_source; 95 int clock_source;
94 struct sh_mobile_lcdc_chan_cfg ch[2]; 96 struct sh_mobile_lcdc_chan_cfg ch[2];
97 struct sh_mobile_meram_info *meram_dev;
95}; 98};
96 99
97#endif /* __ASM_SH_MOBILE_LCDC_H__ */ 100#endif /* __ASM_SH_MOBILE_LCDC_H__ */
diff --git a/include/video/sh_mobile_meram.h b/include/video/sh_mobile_meram.h
new file mode 100644
index 00000000000..15fbb3da266
--- /dev/null
+++ b/include/video/sh_mobile_meram.h
@@ -0,0 +1,67 @@
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,
12 SH_MOBILE_MERAM_PF_RGB
13};
14
15
16struct sh_mobile_meram_priv;
17struct sh_mobile_meram_ops;
18
19struct sh_mobile_meram_info {
20 int addr_mode;
21 struct sh_mobile_meram_ops *ops;
22 struct sh_mobile_meram_priv *priv;
23 struct platform_device *pdev;
24};
25
26/* icb config */
27struct sh_mobile_meram_icb {
28 int marker_icb; /* ICB # for Marker ICB */
29 int cache_icb; /* ICB # for Cache ICB */
30 int meram_offset; /* MERAM Buffer Offset to use */
31 int meram_size; /* MERAM Buffer Size to use */
32
33 int cache_unit; /* bytes to cache per ICB */
34};
35
36struct sh_mobile_meram_cfg {
37 struct sh_mobile_meram_icb icb[2];
38 int pixelformat;
39 int current_reg;
40};
41
42struct module;
43struct sh_mobile_meram_ops {
44 struct module *module;
45 /* register usage of meram */
46 int (*meram_register)(struct sh_mobile_meram_info *meram_dev,
47 struct sh_mobile_meram_cfg *cfg,
48 int xres, int yres, int pixelformat,
49 unsigned long base_addr_y,
50 unsigned long base_addr_c,
51 unsigned long *icb_addr_y,
52 unsigned long *icb_addr_c, int *pitch);
53
54 /* unregister usage of meram */
55 int (*meram_unregister)(struct sh_mobile_meram_info *meram_dev,
56 struct sh_mobile_meram_cfg *cfg);
57
58 /* update meram settings */
59 int (*meram_update)(struct sh_mobile_meram_info *meram_dev,
60 struct sh_mobile_meram_cfg *cfg,
61 unsigned long base_addr_y,
62 unsigned long base_addr_c,
63 unsigned long *icb_addr_y,
64 unsigned long *icb_addr_c);
65};
66
67#endif /* __VIDEO_SH_MOBILE_MERAM_H__ */