aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/atmel_lcdfb.c1
-rw-r--r--drivers/video/kyro/fbdev.c6
-rw-r--r--drivers/video/offb.c29
-rw-r--r--drivers/video/omap2/displays-new/panel-sony-acx565akm.c5
-rw-r--r--drivers/video/sh_mobile_meram.c2
-rw-r--r--drivers/video/vt8500lcdfb.c25
6 files changed, 40 insertions, 28 deletions
diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
index 8521051cf946..cd961622f9c1 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -131,6 +131,7 @@ static const struct platform_device_id atmel_lcdfb_devtypes[] = {
131 /* terminator */ 131 /* terminator */
132 } 132 }
133}; 133};
134MODULE_DEVICE_TABLE(platform, atmel_lcdfb_devtypes);
134 135
135static struct atmel_lcdfb_config * 136static struct atmel_lcdfb_config *
136atmel_lcdfb_get_config(struct platform_device *pdev) 137atmel_lcdfb_get_config(struct platform_device *pdev)
diff --git a/drivers/video/kyro/fbdev.c b/drivers/video/kyro/fbdev.c
index 50c857477e4f..65041e15fd59 100644
--- a/drivers/video/kyro/fbdev.c
+++ b/drivers/video/kyro/fbdev.c
@@ -624,15 +624,15 @@ static int kyrofb_ioctl(struct fb_info *info,
624 return -EINVAL; 624 return -EINVAL;
625 } 625 }
626 case KYRO_IOCTL_UVSTRIDE: 626 case KYRO_IOCTL_UVSTRIDE:
627 if (copy_to_user(argp, &deviceInfo.ulOverlayUVStride, sizeof(unsigned long))) 627 if (copy_to_user(argp, &deviceInfo.ulOverlayUVStride, sizeof(deviceInfo.ulOverlayUVStride)))
628 return -EFAULT; 628 return -EFAULT;
629 break; 629 break;
630 case KYRO_IOCTL_STRIDE: 630 case KYRO_IOCTL_STRIDE:
631 if (copy_to_user(argp, &deviceInfo.ulOverlayStride, sizeof(unsigned long))) 631 if (copy_to_user(argp, &deviceInfo.ulOverlayStride, sizeof(deviceInfo.ulOverlayStride)))
632 return -EFAULT; 632 return -EFAULT;
633 break; 633 break;
634 case KYRO_IOCTL_OVERLAY_OFFSET: 634 case KYRO_IOCTL_OVERLAY_OFFSET:
635 if (copy_to_user(argp, &deviceInfo.ulOverlayOffset, sizeof(unsigned long))) 635 if (copy_to_user(argp, &deviceInfo.ulOverlayOffset, sizeof(deviceInfo.ulOverlayOffset)))
636 return -EFAULT; 636 return -EFAULT;
637 break; 637 break;
638 } 638 }
diff --git a/drivers/video/offb.c b/drivers/video/offb.c
index 9dbea2223401..7d44d669d5b6 100644
--- a/drivers/video/offb.c
+++ b/drivers/video/offb.c
@@ -91,6 +91,15 @@ extern boot_infos_t *boot_infos;
91#define AVIVO_DC_LUTB_WHITE_OFFSET_GREEN 0x6cd4 91#define AVIVO_DC_LUTB_WHITE_OFFSET_GREEN 0x6cd4
92#define AVIVO_DC_LUTB_WHITE_OFFSET_RED 0x6cd8 92#define AVIVO_DC_LUTB_WHITE_OFFSET_RED 0x6cd8
93 93
94#define FB_RIGHT_POS(p, bpp) (fb_be_math(p) ? 0 : (32 - (bpp)))
95
96static inline u32 offb_cmap_byteswap(struct fb_info *info, u32 value)
97{
98 u32 bpp = info->var.bits_per_pixel;
99
100 return cpu_to_be32(value) >> FB_RIGHT_POS(info, bpp);
101}
102
94 /* 103 /*
95 * Set a single color register. The values supplied are already 104 * Set a single color register. The values supplied are already
96 * rounded down to the hardware's capabilities (according to the 105 * rounded down to the hardware's capabilities (according to the
@@ -120,7 +129,7 @@ static int offb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
120 mask <<= info->var.transp.offset; 129 mask <<= info->var.transp.offset;
121 value |= mask; 130 value |= mask;
122 } 131 }
123 pal[regno] = value; 132 pal[regno] = offb_cmap_byteswap(info, value);
124 return 0; 133 return 0;
125 } 134 }
126 135
@@ -301,7 +310,7 @@ static struct fb_ops offb_ops = {
301static void __iomem *offb_map_reg(struct device_node *np, int index, 310static void __iomem *offb_map_reg(struct device_node *np, int index,
302 unsigned long offset, unsigned long size) 311 unsigned long offset, unsigned long size)
303{ 312{
304 const u32 *addrp; 313 const __be32 *addrp;
305 u64 asize, taddr; 314 u64 asize, taddr;
306 unsigned int flags; 315 unsigned int flags;
307 316
@@ -369,7 +378,11 @@ static void offb_init_palette_hacks(struct fb_info *info, struct device_node *dp
369 } 378 }
370 of_node_put(pciparent); 379 of_node_put(pciparent);
371 } else if (dp && of_device_is_compatible(dp, "qemu,std-vga")) { 380 } else if (dp && of_device_is_compatible(dp, "qemu,std-vga")) {
372 const u32 io_of_addr[3] = { 0x01000000, 0x0, 0x0 }; 381#ifdef __BIG_ENDIAN
382 const __be32 io_of_addr[3] = { 0x01000000, 0x0, 0x0 };
383#else
384 const __be32 io_of_addr[3] = { 0x00000001, 0x0, 0x0 };
385#endif
373 u64 io_addr = of_translate_address(dp, io_of_addr); 386 u64 io_addr = of_translate_address(dp, io_of_addr);
374 if (io_addr != OF_BAD_ADDR) { 387 if (io_addr != OF_BAD_ADDR) {
375 par->cmap_adr = ioremap(io_addr + 0x3c8, 2); 388 par->cmap_adr = ioremap(io_addr + 0x3c8, 2);
@@ -535,7 +548,7 @@ static void __init offb_init_nodriver(struct device_node *dp, int no_real_node)
535 unsigned int flags, rsize, addr_prop = 0; 548 unsigned int flags, rsize, addr_prop = 0;
536 unsigned long max_size = 0; 549 unsigned long max_size = 0;
537 u64 rstart, address = OF_BAD_ADDR; 550 u64 rstart, address = OF_BAD_ADDR;
538 const u32 *pp, *addrp, *up; 551 const __be32 *pp, *addrp, *up;
539 u64 asize; 552 u64 asize;
540 int foreign_endian = 0; 553 int foreign_endian = 0;
541 554
@@ -551,25 +564,25 @@ static void __init offb_init_nodriver(struct device_node *dp, int no_real_node)
551 if (pp == NULL) 564 if (pp == NULL)
552 pp = of_get_property(dp, "depth", &len); 565 pp = of_get_property(dp, "depth", &len);
553 if (pp && len == sizeof(u32)) 566 if (pp && len == sizeof(u32))
554 depth = *pp; 567 depth = be32_to_cpup(pp);
555 568
556 pp = of_get_property(dp, "linux,bootx-width", &len); 569 pp = of_get_property(dp, "linux,bootx-width", &len);
557 if (pp == NULL) 570 if (pp == NULL)
558 pp = of_get_property(dp, "width", &len); 571 pp = of_get_property(dp, "width", &len);
559 if (pp && len == sizeof(u32)) 572 if (pp && len == sizeof(u32))
560 width = *pp; 573 width = be32_to_cpup(pp);
561 574
562 pp = of_get_property(dp, "linux,bootx-height", &len); 575 pp = of_get_property(dp, "linux,bootx-height", &len);
563 if (pp == NULL) 576 if (pp == NULL)
564 pp = of_get_property(dp, "height", &len); 577 pp = of_get_property(dp, "height", &len);
565 if (pp && len == sizeof(u32)) 578 if (pp && len == sizeof(u32))
566 height = *pp; 579 height = be32_to_cpup(pp);
567 580
568 pp = of_get_property(dp, "linux,bootx-linebytes", &len); 581 pp = of_get_property(dp, "linux,bootx-linebytes", &len);
569 if (pp == NULL) 582 if (pp == NULL)
570 pp = of_get_property(dp, "linebytes", &len); 583 pp = of_get_property(dp, "linebytes", &len);
571 if (pp && len == sizeof(u32) && (*pp != 0xffffffffu)) 584 if (pp && len == sizeof(u32) && (*pp != 0xffffffffu))
572 pitch = *pp; 585 pitch = be32_to_cpup(pp);
573 else 586 else
574 pitch = width * ((depth + 7) / 8); 587 pitch = width * ((depth + 7) / 8);
575 588
diff --git a/drivers/video/omap2/displays-new/panel-sony-acx565akm.c b/drivers/video/omap2/displays-new/panel-sony-acx565akm.c
index e6d56f714ae4..d94f35dbd536 100644
--- a/drivers/video/omap2/displays-new/panel-sony-acx565akm.c
+++ b/drivers/video/omap2/displays-new/panel-sony-acx565akm.c
@@ -526,6 +526,8 @@ static int acx565akm_panel_power_on(struct omap_dss_device *dssdev)
526 struct omap_dss_device *in = ddata->in; 526 struct omap_dss_device *in = ddata->in;
527 int r; 527 int r;
528 528
529 mutex_lock(&ddata->mutex);
530
529 dev_dbg(&ddata->spi->dev, "%s\n", __func__); 531 dev_dbg(&ddata->spi->dev, "%s\n", __func__);
530 532
531 in->ops.sdi->set_timings(in, &ddata->videomode); 533 in->ops.sdi->set_timings(in, &ddata->videomode);
@@ -614,10 +616,7 @@ static int acx565akm_enable(struct omap_dss_device *dssdev)
614 if (omapdss_device_is_enabled(dssdev)) 616 if (omapdss_device_is_enabled(dssdev))
615 return 0; 617 return 0;
616 618
617 mutex_lock(&ddata->mutex);
618 r = acx565akm_panel_power_on(dssdev); 619 r = acx565akm_panel_power_on(dssdev);
619 mutex_unlock(&ddata->mutex);
620
621 if (r) 620 if (r)
622 return r; 621 return r;
623 622
diff --git a/drivers/video/sh_mobile_meram.c b/drivers/video/sh_mobile_meram.c
index e0f098562a74..a297de5cc859 100644
--- a/drivers/video/sh_mobile_meram.c
+++ b/drivers/video/sh_mobile_meram.c
@@ -569,6 +569,7 @@ EXPORT_SYMBOL_GPL(sh_mobile_meram_cache_update);
569 * Power management 569 * Power management
570 */ 570 */
571 571
572#if defined(CONFIG_PM_SLEEP) || defined(CONFIG_PM_RUNTIME)
572static int sh_mobile_meram_suspend(struct device *dev) 573static int sh_mobile_meram_suspend(struct device *dev)
573{ 574{
574 struct platform_device *pdev = to_platform_device(dev); 575 struct platform_device *pdev = to_platform_device(dev);
@@ -611,6 +612,7 @@ static int sh_mobile_meram_resume(struct device *dev)
611 meram_write_reg(priv->base, common_regs[i], priv->regs[i]); 612 meram_write_reg(priv->base, common_regs[i], priv->regs[i]);
612 return 0; 613 return 0;
613} 614}
615#endif /* CONFIG_PM_SLEEP || CONFIG_PM_RUNTIME */
614 616
615static UNIVERSAL_DEV_PM_OPS(sh_mobile_meram_dev_pm_ops, 617static UNIVERSAL_DEV_PM_OPS(sh_mobile_meram_dev_pm_ops,
616 sh_mobile_meram_suspend, 618 sh_mobile_meram_suspend,
diff --git a/drivers/video/vt8500lcdfb.c b/drivers/video/vt8500lcdfb.c
index b30e5a439d1f..a8f2b280f796 100644
--- a/drivers/video/vt8500lcdfb.c
+++ b/drivers/video/vt8500lcdfb.c
@@ -293,8 +293,7 @@ static int vt8500lcd_probe(struct platform_device *pdev)
293 + sizeof(u32) * 16, GFP_KERNEL); 293 + sizeof(u32) * 16, GFP_KERNEL);
294 if (!fbi) { 294 if (!fbi) {
295 dev_err(&pdev->dev, "Failed to initialize framebuffer device\n"); 295 dev_err(&pdev->dev, "Failed to initialize framebuffer device\n");
296 ret = -ENOMEM; 296 return -ENOMEM;
297 goto failed;
298 } 297 }
299 298
300 strcpy(fbi->fb.fix.id, "VT8500 LCD"); 299 strcpy(fbi->fb.fix.id, "VT8500 LCD");
@@ -327,15 +326,13 @@ static int vt8500lcd_probe(struct platform_device *pdev)
327 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 326 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
328 if (res == NULL) { 327 if (res == NULL) {
329 dev_err(&pdev->dev, "no I/O memory resource defined\n"); 328 dev_err(&pdev->dev, "no I/O memory resource defined\n");
330 ret = -ENODEV; 329 return -ENODEV;
331 goto failed_fbi;
332 } 330 }
333 331
334 res = request_mem_region(res->start, resource_size(res), "vt8500lcd"); 332 res = request_mem_region(res->start, resource_size(res), "vt8500lcd");
335 if (res == NULL) { 333 if (res == NULL) {
336 dev_err(&pdev->dev, "failed to request I/O memory\n"); 334 dev_err(&pdev->dev, "failed to request I/O memory\n");
337 ret = -EBUSY; 335 return -EBUSY;
338 goto failed_fbi;
339 } 336 }
340 337
341 fbi->regbase = ioremap(res->start, resource_size(res)); 338 fbi->regbase = ioremap(res->start, resource_size(res));
@@ -346,17 +343,19 @@ static int vt8500lcd_probe(struct platform_device *pdev)
346 } 343 }
347 344
348 disp_timing = of_get_display_timings(pdev->dev.of_node); 345 disp_timing = of_get_display_timings(pdev->dev.of_node);
349 if (!disp_timing) 346 if (!disp_timing) {
350 return -EINVAL; 347 ret = -EINVAL;
348 goto failed_free_io;
349 }
351 350
352 ret = of_get_fb_videomode(pdev->dev.of_node, &of_mode, 351 ret = of_get_fb_videomode(pdev->dev.of_node, &of_mode,
353 OF_USE_NATIVE_MODE); 352 OF_USE_NATIVE_MODE);
354 if (ret) 353 if (ret)
355 return ret; 354 goto failed_free_io;
356 355
357 ret = of_property_read_u32(pdev->dev.of_node, "bits-per-pixel", &bpp); 356 ret = of_property_read_u32(pdev->dev.of_node, "bits-per-pixel", &bpp);
358 if (ret) 357 if (ret)
359 return ret; 358 goto failed_free_io;
360 359
361 /* try allocating the framebuffer */ 360 /* try allocating the framebuffer */
362 fb_mem_len = of_mode.xres * of_mode.yres * 2 * (bpp / 8); 361 fb_mem_len = of_mode.xres * of_mode.yres * 2 * (bpp / 8);
@@ -364,7 +363,8 @@ static int vt8500lcd_probe(struct platform_device *pdev)
364 GFP_KERNEL); 363 GFP_KERNEL);
365 if (!fb_mem_virt) { 364 if (!fb_mem_virt) {
366 pr_err("%s: Failed to allocate framebuffer\n", __func__); 365 pr_err("%s: Failed to allocate framebuffer\n", __func__);
367 return -ENOMEM; 366 ret = -ENOMEM;
367 goto failed_free_io;
368 } 368 }
369 369
370 fbi->fb.fix.smem_start = fb_mem_phys; 370 fbi->fb.fix.smem_start = fb_mem_phys;
@@ -447,9 +447,6 @@ failed_free_io:
447 iounmap(fbi->regbase); 447 iounmap(fbi->regbase);
448failed_free_res: 448failed_free_res:
449 release_mem_region(res->start, resource_size(res)); 449 release_mem_region(res->start, resource_size(res));
450failed_fbi:
451 kfree(fbi);
452failed:
453 return ret; 450 return ret;
454} 451}
455 452