diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2010-09-03 03:20:04 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2010-09-14 04:22:38 -0400 |
commit | 44432407d9f5e4b2e56c7eccb65d98cad4bba191 (patch) | |
tree | fdd88fc9bd5a1473e611e87958d2115b02631ac8 /drivers/video/sh_mipi_dsi.c | |
parent | 01ac25b59f08c0bb56dd301f024eabd542205a42 (diff) |
fbdev: sh_mobile_lcdcfb: Support multiple video modes in platform data
This is a preparation for HDMI hotplug support. This patch just moves all
platform defined video modes for the sh_mobile_lcdcfb driver to separate
arrays and switches all users to use element 0 of that array, so, this patch
doesn't introduce any functional changes and as such should not cause any
regressions.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/video/sh_mipi_dsi.c')
-rw-r--r-- | drivers/video/sh_mipi_dsi.c | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/drivers/video/sh_mipi_dsi.c b/drivers/video/sh_mipi_dsi.c index 5699ce0c1780..3f3d431033ca 100644 --- a/drivers/video/sh_mipi_dsi.c +++ b/drivers/video/sh_mipi_dsi.c | |||
@@ -123,83 +123,87 @@ static int __init sh_mipi_setup(struct sh_mipi *mipi, | |||
123 | u32 linelength; | 123 | u32 linelength; |
124 | bool yuv; | 124 | bool yuv; |
125 | 125 | ||
126 | /* Select data format */ | 126 | /* |
127 | * Select data format. MIPI DSI is not hot-pluggable, so, we just use | ||
128 | * the default videomode. If this ever becomes a problem, We'll have to | ||
129 | * move this to mipi_display_on() above and use info->var.xres | ||
130 | */ | ||
127 | switch (pdata->data_format) { | 131 | switch (pdata->data_format) { |
128 | case MIPI_RGB888: | 132 | case MIPI_RGB888: |
129 | pctype = 0; | 133 | pctype = 0; |
130 | datatype = MIPI_DSI_PACKED_PIXEL_STREAM_24; | 134 | datatype = MIPI_DSI_PACKED_PIXEL_STREAM_24; |
131 | pixfmt = MIPI_DCS_PIXEL_FMT_24BIT; | 135 | pixfmt = MIPI_DCS_PIXEL_FMT_24BIT; |
132 | linelength = ch->lcd_cfg.xres * 3; | 136 | linelength = ch->lcd_cfg[0].xres * 3; |
133 | yuv = false; | 137 | yuv = false; |
134 | break; | 138 | break; |
135 | case MIPI_RGB565: | 139 | case MIPI_RGB565: |
136 | pctype = 1; | 140 | pctype = 1; |
137 | datatype = MIPI_DSI_PACKED_PIXEL_STREAM_16; | 141 | datatype = MIPI_DSI_PACKED_PIXEL_STREAM_16; |
138 | pixfmt = MIPI_DCS_PIXEL_FMT_16BIT; | 142 | pixfmt = MIPI_DCS_PIXEL_FMT_16BIT; |
139 | linelength = ch->lcd_cfg.xres * 2; | 143 | linelength = ch->lcd_cfg[0].xres * 2; |
140 | yuv = false; | 144 | yuv = false; |
141 | break; | 145 | break; |
142 | case MIPI_RGB666_LP: | 146 | case MIPI_RGB666_LP: |
143 | pctype = 2; | 147 | pctype = 2; |
144 | datatype = MIPI_DSI_PIXEL_STREAM_3BYTE_18; | 148 | datatype = MIPI_DSI_PIXEL_STREAM_3BYTE_18; |
145 | pixfmt = MIPI_DCS_PIXEL_FMT_24BIT; | 149 | pixfmt = MIPI_DCS_PIXEL_FMT_24BIT; |
146 | linelength = ch->lcd_cfg.xres * 3; | 150 | linelength = ch->lcd_cfg[0].xres * 3; |
147 | yuv = false; | 151 | yuv = false; |
148 | break; | 152 | break; |
149 | case MIPI_RGB666: | 153 | case MIPI_RGB666: |
150 | pctype = 3; | 154 | pctype = 3; |
151 | datatype = MIPI_DSI_PACKED_PIXEL_STREAM_18; | 155 | datatype = MIPI_DSI_PACKED_PIXEL_STREAM_18; |
152 | pixfmt = MIPI_DCS_PIXEL_FMT_18BIT; | 156 | pixfmt = MIPI_DCS_PIXEL_FMT_18BIT; |
153 | linelength = (ch->lcd_cfg.xres * 18 + 7) / 8; | 157 | linelength = (ch->lcd_cfg[0].xres * 18 + 7) / 8; |
154 | yuv = false; | 158 | yuv = false; |
155 | break; | 159 | break; |
156 | case MIPI_BGR888: | 160 | case MIPI_BGR888: |
157 | pctype = 8; | 161 | pctype = 8; |
158 | datatype = MIPI_DSI_PACKED_PIXEL_STREAM_24; | 162 | datatype = MIPI_DSI_PACKED_PIXEL_STREAM_24; |
159 | pixfmt = MIPI_DCS_PIXEL_FMT_24BIT; | 163 | pixfmt = MIPI_DCS_PIXEL_FMT_24BIT; |
160 | linelength = ch->lcd_cfg.xres * 3; | 164 | linelength = ch->lcd_cfg[0].xres * 3; |
161 | yuv = false; | 165 | yuv = false; |
162 | break; | 166 | break; |
163 | case MIPI_BGR565: | 167 | case MIPI_BGR565: |
164 | pctype = 9; | 168 | pctype = 9; |
165 | datatype = MIPI_DSI_PACKED_PIXEL_STREAM_16; | 169 | datatype = MIPI_DSI_PACKED_PIXEL_STREAM_16; |
166 | pixfmt = MIPI_DCS_PIXEL_FMT_16BIT; | 170 | pixfmt = MIPI_DCS_PIXEL_FMT_16BIT; |
167 | linelength = ch->lcd_cfg.xres * 2; | 171 | linelength = ch->lcd_cfg[0].xres * 2; |
168 | yuv = false; | 172 | yuv = false; |
169 | break; | 173 | break; |
170 | case MIPI_BGR666_LP: | 174 | case MIPI_BGR666_LP: |
171 | pctype = 0xa; | 175 | pctype = 0xa; |
172 | datatype = MIPI_DSI_PIXEL_STREAM_3BYTE_18; | 176 | datatype = MIPI_DSI_PIXEL_STREAM_3BYTE_18; |
173 | pixfmt = MIPI_DCS_PIXEL_FMT_24BIT; | 177 | pixfmt = MIPI_DCS_PIXEL_FMT_24BIT; |
174 | linelength = ch->lcd_cfg.xres * 3; | 178 | linelength = ch->lcd_cfg[0].xres * 3; |
175 | yuv = false; | 179 | yuv = false; |
176 | break; | 180 | break; |
177 | case MIPI_BGR666: | 181 | case MIPI_BGR666: |
178 | pctype = 0xb; | 182 | pctype = 0xb; |
179 | datatype = MIPI_DSI_PACKED_PIXEL_STREAM_18; | 183 | datatype = MIPI_DSI_PACKED_PIXEL_STREAM_18; |
180 | pixfmt = MIPI_DCS_PIXEL_FMT_18BIT; | 184 | pixfmt = MIPI_DCS_PIXEL_FMT_18BIT; |
181 | linelength = (ch->lcd_cfg.xres * 18 + 7) / 8; | 185 | linelength = (ch->lcd_cfg[0].xres * 18 + 7) / 8; |
182 | yuv = false; | 186 | yuv = false; |
183 | break; | 187 | break; |
184 | case MIPI_YUYV: | 188 | case MIPI_YUYV: |
185 | pctype = 4; | 189 | pctype = 4; |
186 | datatype = MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR16; | 190 | datatype = MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR16; |
187 | pixfmt = MIPI_DCS_PIXEL_FMT_16BIT; | 191 | pixfmt = MIPI_DCS_PIXEL_FMT_16BIT; |
188 | linelength = ch->lcd_cfg.xres * 2; | 192 | linelength = ch->lcd_cfg[0].xres * 2; |
189 | yuv = true; | 193 | yuv = true; |
190 | break; | 194 | break; |
191 | case MIPI_UYVY: | 195 | case MIPI_UYVY: |
192 | pctype = 5; | 196 | pctype = 5; |
193 | datatype = MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR16; | 197 | datatype = MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR16; |
194 | pixfmt = MIPI_DCS_PIXEL_FMT_16BIT; | 198 | pixfmt = MIPI_DCS_PIXEL_FMT_16BIT; |
195 | linelength = ch->lcd_cfg.xres * 2; | 199 | linelength = ch->lcd_cfg[0].xres * 2; |
196 | yuv = true; | 200 | yuv = true; |
197 | break; | 201 | break; |
198 | case MIPI_YUV420_L: | 202 | case MIPI_YUV420_L: |
199 | pctype = 6; | 203 | pctype = 6; |
200 | datatype = MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR12; | 204 | datatype = MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR12; |
201 | pixfmt = MIPI_DCS_PIXEL_FMT_12BIT; | 205 | pixfmt = MIPI_DCS_PIXEL_FMT_12BIT; |
202 | linelength = (ch->lcd_cfg.xres * 12 + 7) / 8; | 206 | linelength = (ch->lcd_cfg[0].xres * 12 + 7) / 8; |
203 | yuv = true; | 207 | yuv = true; |
204 | break; | 208 | break; |
205 | case MIPI_YUV420: | 209 | case MIPI_YUV420: |
@@ -207,7 +211,7 @@ static int __init sh_mipi_setup(struct sh_mipi *mipi, | |||
207 | datatype = MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR12; | 211 | datatype = MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR12; |
208 | pixfmt = MIPI_DCS_PIXEL_FMT_12BIT; | 212 | pixfmt = MIPI_DCS_PIXEL_FMT_12BIT; |
209 | /* Length of U/V line */ | 213 | /* Length of U/V line */ |
210 | linelength = (ch->lcd_cfg.xres + 1) / 2; | 214 | linelength = (ch->lcd_cfg[0].xres + 1) / 2; |
211 | yuv = true; | 215 | yuv = true; |
212 | break; | 216 | break; |
213 | default: | 217 | default: |
@@ -281,7 +285,7 @@ static int __init sh_mipi_setup(struct sh_mipi *mipi, | |||
281 | iowrite32(0x00e00000, base + 0x8024); /* VMCTR2 */ | 285 | iowrite32(0x00e00000, base + 0x8024); /* VMCTR2 */ |
282 | /* | 286 | /* |
283 | * 0x660 = 1632 bytes per line (RGB24, 544 pixels: see | 287 | * 0x660 = 1632 bytes per line (RGB24, 544 pixels: see |
284 | * sh_mobile_lcdc_info.ch[0].lcd_cfg.xres), HSALEN = 1 - default | 288 | * sh_mobile_lcdc_info.ch[0].lcd_cfg[0].xres), HSALEN = 1 - default |
285 | * (unused, since VMCTR2[HSABM] = 0) | 289 | * (unused, since VMCTR2[HSABM] = 0) |
286 | */ | 290 | */ |
287 | iowrite32(1 | (linelength << 16), base + 0x8028); /* VMLEN1 */ | 291 | iowrite32(1 | (linelength << 16), base + 0x8028); /* VMLEN1 */ |