diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2011-11-29 08:33:41 -0500 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2012-03-12 17:40:55 -0400 |
commit | 93ff259846a774ff37dca54792c5a3a6425882c0 (patch) | |
tree | b5bbdb3005ec0dc57f674c1c88de5abede17c65f /drivers | |
parent | 2d04559dc23bed905ed2904f2bbcbcc3f1a7fd91 (diff) |
fbdev: sh_mobile_lcdc: Rename (lcd|num)_cfg (lcd|num)_modes
The struct sh_mobile_lcdc_chan_cfg platform data contains a list of
video modes. Name the lcd_cfg and num_cfg fields to reflect that they
describe video modes.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/sh_mipi_dsi.c | 38 | ||||
-rw-r--r-- | drivers/video/sh_mobile_lcdcfb.c | 20 |
2 files changed, 29 insertions, 29 deletions
diff --git a/drivers/video/sh_mipi_dsi.c b/drivers/video/sh_mipi_dsi.c index 5ff3742aeb08..42ad0f707e88 100644 --- a/drivers/video/sh_mipi_dsi.c +++ b/drivers/video/sh_mipi_dsi.c | |||
@@ -147,77 +147,77 @@ static int __init sh_mipi_setup(struct sh_mipi *mipi, | |||
147 | pctype = 0; | 147 | pctype = 0; |
148 | datatype = MIPI_DSI_PACKED_PIXEL_STREAM_24; | 148 | datatype = MIPI_DSI_PACKED_PIXEL_STREAM_24; |
149 | pixfmt = MIPI_DCS_PIXEL_FMT_24BIT; | 149 | pixfmt = MIPI_DCS_PIXEL_FMT_24BIT; |
150 | linelength = ch->lcd_cfg[0].xres * 3; | 150 | linelength = ch->lcd_modes[0].xres * 3; |
151 | yuv = false; | 151 | yuv = false; |
152 | break; | 152 | break; |
153 | case MIPI_RGB565: | 153 | case MIPI_RGB565: |
154 | pctype = 1; | 154 | pctype = 1; |
155 | datatype = MIPI_DSI_PACKED_PIXEL_STREAM_16; | 155 | datatype = MIPI_DSI_PACKED_PIXEL_STREAM_16; |
156 | pixfmt = MIPI_DCS_PIXEL_FMT_16BIT; | 156 | pixfmt = MIPI_DCS_PIXEL_FMT_16BIT; |
157 | linelength = ch->lcd_cfg[0].xres * 2; | 157 | linelength = ch->lcd_modes[0].xres * 2; |
158 | yuv = false; | 158 | yuv = false; |
159 | break; | 159 | break; |
160 | case MIPI_RGB666_LP: | 160 | case MIPI_RGB666_LP: |
161 | pctype = 2; | 161 | pctype = 2; |
162 | datatype = MIPI_DSI_PIXEL_STREAM_3BYTE_18; | 162 | datatype = MIPI_DSI_PIXEL_STREAM_3BYTE_18; |
163 | pixfmt = MIPI_DCS_PIXEL_FMT_24BIT; | 163 | pixfmt = MIPI_DCS_PIXEL_FMT_24BIT; |
164 | linelength = ch->lcd_cfg[0].xres * 3; | 164 | linelength = ch->lcd_modes[0].xres * 3; |
165 | yuv = false; | 165 | yuv = false; |
166 | break; | 166 | break; |
167 | case MIPI_RGB666: | 167 | case MIPI_RGB666: |
168 | pctype = 3; | 168 | pctype = 3; |
169 | datatype = MIPI_DSI_PACKED_PIXEL_STREAM_18; | 169 | datatype = MIPI_DSI_PACKED_PIXEL_STREAM_18; |
170 | pixfmt = MIPI_DCS_PIXEL_FMT_18BIT; | 170 | pixfmt = MIPI_DCS_PIXEL_FMT_18BIT; |
171 | linelength = (ch->lcd_cfg[0].xres * 18 + 7) / 8; | 171 | linelength = (ch->lcd_modes[0].xres * 18 + 7) / 8; |
172 | yuv = false; | 172 | yuv = false; |
173 | break; | 173 | break; |
174 | case MIPI_BGR888: | 174 | case MIPI_BGR888: |
175 | pctype = 8; | 175 | pctype = 8; |
176 | datatype = MIPI_DSI_PACKED_PIXEL_STREAM_24; | 176 | datatype = MIPI_DSI_PACKED_PIXEL_STREAM_24; |
177 | pixfmt = MIPI_DCS_PIXEL_FMT_24BIT; | 177 | pixfmt = MIPI_DCS_PIXEL_FMT_24BIT; |
178 | linelength = ch->lcd_cfg[0].xres * 3; | 178 | linelength = ch->lcd_modes[0].xres * 3; |
179 | yuv = false; | 179 | yuv = false; |
180 | break; | 180 | break; |
181 | case MIPI_BGR565: | 181 | case MIPI_BGR565: |
182 | pctype = 9; | 182 | pctype = 9; |
183 | datatype = MIPI_DSI_PACKED_PIXEL_STREAM_16; | 183 | datatype = MIPI_DSI_PACKED_PIXEL_STREAM_16; |
184 | pixfmt = MIPI_DCS_PIXEL_FMT_16BIT; | 184 | pixfmt = MIPI_DCS_PIXEL_FMT_16BIT; |
185 | linelength = ch->lcd_cfg[0].xres * 2; | 185 | linelength = ch->lcd_modes[0].xres * 2; |
186 | yuv = false; | 186 | yuv = false; |
187 | break; | 187 | break; |
188 | case MIPI_BGR666_LP: | 188 | case MIPI_BGR666_LP: |
189 | pctype = 0xa; | 189 | pctype = 0xa; |
190 | datatype = MIPI_DSI_PIXEL_STREAM_3BYTE_18; | 190 | datatype = MIPI_DSI_PIXEL_STREAM_3BYTE_18; |
191 | pixfmt = MIPI_DCS_PIXEL_FMT_24BIT; | 191 | pixfmt = MIPI_DCS_PIXEL_FMT_24BIT; |
192 | linelength = ch->lcd_cfg[0].xres * 3; | 192 | linelength = ch->lcd_modes[0].xres * 3; |
193 | yuv = false; | 193 | yuv = false; |
194 | break; | 194 | break; |
195 | case MIPI_BGR666: | 195 | case MIPI_BGR666: |
196 | pctype = 0xb; | 196 | pctype = 0xb; |
197 | datatype = MIPI_DSI_PACKED_PIXEL_STREAM_18; | 197 | datatype = MIPI_DSI_PACKED_PIXEL_STREAM_18; |
198 | pixfmt = MIPI_DCS_PIXEL_FMT_18BIT; | 198 | pixfmt = MIPI_DCS_PIXEL_FMT_18BIT; |
199 | linelength = (ch->lcd_cfg[0].xres * 18 + 7) / 8; | 199 | linelength = (ch->lcd_modes[0].xres * 18 + 7) / 8; |
200 | yuv = false; | 200 | yuv = false; |
201 | break; | 201 | break; |
202 | case MIPI_YUYV: | 202 | case MIPI_YUYV: |
203 | pctype = 4; | 203 | pctype = 4; |
204 | datatype = MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR16; | 204 | datatype = MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR16; |
205 | pixfmt = MIPI_DCS_PIXEL_FMT_16BIT; | 205 | pixfmt = MIPI_DCS_PIXEL_FMT_16BIT; |
206 | linelength = ch->lcd_cfg[0].xres * 2; | 206 | linelength = ch->lcd_modes[0].xres * 2; |
207 | yuv = true; | 207 | yuv = true; |
208 | break; | 208 | break; |
209 | case MIPI_UYVY: | 209 | case MIPI_UYVY: |
210 | pctype = 5; | 210 | pctype = 5; |
211 | datatype = MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR16; | 211 | datatype = MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR16; |
212 | pixfmt = MIPI_DCS_PIXEL_FMT_16BIT; | 212 | pixfmt = MIPI_DCS_PIXEL_FMT_16BIT; |
213 | linelength = ch->lcd_cfg[0].xres * 2; | 213 | linelength = ch->lcd_modes[0].xres * 2; |
214 | yuv = true; | 214 | yuv = true; |
215 | break; | 215 | break; |
216 | case MIPI_YUV420_L: | 216 | case MIPI_YUV420_L: |
217 | pctype = 6; | 217 | pctype = 6; |
218 | datatype = MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR12; | 218 | datatype = MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR12; |
219 | pixfmt = MIPI_DCS_PIXEL_FMT_12BIT; | 219 | pixfmt = MIPI_DCS_PIXEL_FMT_12BIT; |
220 | linelength = (ch->lcd_cfg[0].xres * 12 + 7) / 8; | 220 | linelength = (ch->lcd_modes[0].xres * 12 + 7) / 8; |
221 | yuv = true; | 221 | yuv = true; |
222 | break; | 222 | break; |
223 | case MIPI_YUV420: | 223 | case MIPI_YUV420: |
@@ -225,7 +225,7 @@ static int __init sh_mipi_setup(struct sh_mipi *mipi, | |||
225 | datatype = MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR12; | 225 | datatype = MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR12; |
226 | pixfmt = MIPI_DCS_PIXEL_FMT_12BIT; | 226 | pixfmt = MIPI_DCS_PIXEL_FMT_12BIT; |
227 | /* Length of U/V line */ | 227 | /* Length of U/V line */ |
228 | linelength = (ch->lcd_cfg[0].xres + 1) / 2; | 228 | linelength = (ch->lcd_modes[0].xres + 1) / 2; |
229 | yuv = true; | 229 | yuv = true; |
230 | break; | 230 | break; |
231 | default: | 231 | default: |
@@ -294,7 +294,7 @@ static int __init sh_mipi_setup(struct sh_mipi *mipi, | |||
294 | */ | 294 | */ |
295 | iowrite32(0x00000006, mipi->linkbase + DTCTR); | 295 | iowrite32(0x00000006, mipi->linkbase + DTCTR); |
296 | /* VSYNC width = 2 (<< 17) */ | 296 | /* VSYNC width = 2 (<< 17) */ |
297 | iowrite32((ch->lcd_cfg[0].vsync_len << pdata->vsynw_offset) | | 297 | iowrite32((ch->lcd_modes[0].vsync_len << pdata->vsynw_offset) | |
298 | (pdata->clksrc << 16) | (pctype << 12) | datatype, | 298 | (pdata->clksrc << 16) | (pctype << 12) | datatype, |
299 | mipi->linkbase + VMCTR1); | 299 | mipi->linkbase + VMCTR1); |
300 | 300 | ||
@@ -328,7 +328,7 @@ static int __init sh_mipi_setup(struct sh_mipi *mipi, | |||
328 | top = linelength << 16; /* RGBLEN */ | 328 | top = linelength << 16; /* RGBLEN */ |
329 | bottom = 0x00000001; | 329 | bottom = 0x00000001; |
330 | if (pdata->flags & SH_MIPI_DSI_HSABM) /* HSALEN */ | 330 | if (pdata->flags & SH_MIPI_DSI_HSABM) /* HSALEN */ |
331 | bottom = (pdata->lane * ch->lcd_cfg[0].hsync_len) - 10; | 331 | bottom = (pdata->lane * ch->lcd_modes[0].hsync_len) - 10; |
332 | iowrite32(top | bottom , mipi->linkbase + VMLEN1); | 332 | iowrite32(top | bottom , mipi->linkbase + VMLEN1); |
333 | 333 | ||
334 | /* | 334 | /* |
@@ -348,18 +348,18 @@ static int __init sh_mipi_setup(struct sh_mipi *mipi, | |||
348 | div = 2; | 348 | div = 2; |
349 | 349 | ||
350 | if (pdata->flags & SH_MIPI_DSI_HFPBM) { /* HBPLEN */ | 350 | if (pdata->flags & SH_MIPI_DSI_HFPBM) { /* HBPLEN */ |
351 | top = ch->lcd_cfg[0].hsync_len + ch->lcd_cfg[0].left_margin; | 351 | top = ch->lcd_modes[0].hsync_len + ch->lcd_modes[0].left_margin; |
352 | top = ((pdata->lane * top / div) - 10) << 16; | 352 | top = ((pdata->lane * top / div) - 10) << 16; |
353 | } | 353 | } |
354 | if (pdata->flags & SH_MIPI_DSI_HBPBM) { /* HFPLEN */ | 354 | if (pdata->flags & SH_MIPI_DSI_HBPBM) { /* HFPLEN */ |
355 | bottom = ch->lcd_cfg[0].right_margin; | 355 | bottom = ch->lcd_modes[0].right_margin; |
356 | bottom = (pdata->lane * bottom / div) - 12; | 356 | bottom = (pdata->lane * bottom / div) - 12; |
357 | } | 357 | } |
358 | 358 | ||
359 | bpp = linelength / ch->lcd_cfg[0].xres; /* byte / pixel */ | 359 | bpp = linelength / ch->lcd_modes[0].xres; /* byte / pixel */ |
360 | if ((pdata->lane / div) > bpp) { | 360 | if ((pdata->lane / div) > bpp) { |
361 | tmp = ch->lcd_cfg[0].xres / bpp; /* output cycle */ | 361 | tmp = ch->lcd_modes[0].xres / bpp; /* output cycle */ |
362 | tmp = ch->lcd_cfg[0].xres - tmp; /* (input - output) cycle */ | 362 | tmp = ch->lcd_modes[0].xres - tmp; /* (input - output) cycle */ |
363 | delay = (pdata->lane * tmp); | 363 | delay = (pdata->lane * tmp); |
364 | } | 364 | } |
365 | 365 | ||
diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c index 422fcfd3cf28..ab7b17975846 100644 --- a/drivers/video/sh_mobile_lcdcfb.c +++ b/drivers/video/sh_mobile_lcdcfb.c | |||
@@ -1191,8 +1191,8 @@ static int sh_mobile_check_var(struct fb_var_screeninfo *var, struct fb_info *in | |||
1191 | * distance between two modes is defined as the size of the | 1191 | * distance between two modes is defined as the size of the |
1192 | * non-overlapping parts of the two rectangles. | 1192 | * non-overlapping parts of the two rectangles. |
1193 | */ | 1193 | */ |
1194 | for (i = 0; i < ch->cfg.num_cfg; ++i) { | 1194 | for (i = 0; i < ch->cfg.num_modes; ++i) { |
1195 | const struct fb_videomode *mode = &ch->cfg.lcd_cfg[i]; | 1195 | const struct fb_videomode *mode = &ch->cfg.lcd_modes[i]; |
1196 | unsigned int dist; | 1196 | unsigned int dist; |
1197 | 1197 | ||
1198 | /* We can only round up. */ | 1198 | /* We can only round up. */ |
@@ -1211,7 +1211,7 @@ static int sh_mobile_check_var(struct fb_var_screeninfo *var, struct fb_info *in | |||
1211 | } | 1211 | } |
1212 | 1212 | ||
1213 | /* If no available mode can be used, return an error. */ | 1213 | /* If no available mode can be used, return an error. */ |
1214 | if (ch->cfg.num_cfg != 0) { | 1214 | if (ch->cfg.num_modes != 0) { |
1215 | if (best_dist == (unsigned int)-1) | 1215 | if (best_dist == (unsigned int)-1) |
1216 | return -EINVAL; | 1216 | return -EINVAL; |
1217 | 1217 | ||
@@ -1671,7 +1671,7 @@ sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_priv *priv, | |||
1671 | struct fb_var_screeninfo *var; | 1671 | struct fb_var_screeninfo *var; |
1672 | struct fb_info *info; | 1672 | struct fb_info *info; |
1673 | unsigned int max_size; | 1673 | unsigned int max_size; |
1674 | int num_cfg; | 1674 | int num_modes; |
1675 | void *buf; | 1675 | void *buf; |
1676 | int ret; | 1676 | int ret; |
1677 | int i; | 1677 | int i; |
@@ -1698,7 +1698,7 @@ sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_priv *priv, | |||
1698 | max_mode = NULL; | 1698 | max_mode = NULL; |
1699 | max_size = 0; | 1699 | max_size = 0; |
1700 | 1700 | ||
1701 | for (i = 0, mode = cfg->lcd_cfg; i < cfg->num_cfg; i++, mode++) { | 1701 | for (i = 0, mode = cfg->lcd_modes; i < cfg->num_modes; i++, mode++) { |
1702 | unsigned int size = mode->yres * mode->xres; | 1702 | unsigned int size = mode->yres * mode->xres; |
1703 | 1703 | ||
1704 | /* NV12/NV21 buffers must have even number of lines */ | 1704 | /* NV12/NV21 buffers must have even number of lines */ |
@@ -1722,15 +1722,15 @@ sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_priv *priv, | |||
1722 | max_mode->xres, max_mode->yres); | 1722 | max_mode->xres, max_mode->yres); |
1723 | 1723 | ||
1724 | /* Create the mode list. */ | 1724 | /* Create the mode list. */ |
1725 | if (cfg->lcd_cfg == NULL) { | 1725 | if (cfg->lcd_modes == NULL) { |
1726 | mode = &default_720p; | 1726 | mode = &default_720p; |
1727 | num_cfg = 1; | 1727 | num_modes = 1; |
1728 | } else { | 1728 | } else { |
1729 | mode = cfg->lcd_cfg; | 1729 | mode = cfg->lcd_modes; |
1730 | num_cfg = cfg->num_cfg; | 1730 | num_modes = cfg->num_modes; |
1731 | } | 1731 | } |
1732 | 1732 | ||
1733 | fb_videomode_to_modelist(mode, num_cfg, &info->modelist); | 1733 | fb_videomode_to_modelist(mode, num_modes, &info->modelist); |
1734 | 1734 | ||
1735 | /* Initialize the transmitter device if present. */ | 1735 | /* Initialize the transmitter device if present. */ |
1736 | if (cfg->tx_dev) { | 1736 | if (cfg->tx_dev) { |