aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2009-03-28 16:29:51 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-03-28 16:29:51 -0400
commited40d0c472b136682b2fcba05f89762859c7374f (patch)
tree076b83a26bcd63d6158463735dd34c10bbc591dc /drivers/video
parent9e495834e59ca9b29f1a1f63b9f5533bb022ac49 (diff)
parent5d80f8e5a9dc9c9a94d4aeaa567e219a808b8a4a (diff)
Merge branch 'origin' into devel
Conflicts: sound/soc/pxa/pxa2xx-i2s.c
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/au1100fb.c31
-rw-r--r--drivers/video/au1200fb.c25
-rw-r--r--drivers/video/pmag-ba-fb.c17
-rw-r--r--drivers/video/pmagb-b-fb.c17
-rw-r--r--drivers/video/ps3fb.c2
-rw-r--r--drivers/video/pvr2fb.c16
-rw-r--r--drivers/video/sh_mobile_lcdcfb.c68
-rw-r--r--drivers/video/tmiofb.c2
-rw-r--r--drivers/video/uvesafb.c5
9 files changed, 122 insertions, 61 deletions
diff --git a/drivers/video/au1100fb.c b/drivers/video/au1100fb.c
index 62bd4441b5e0..378f27745a1d 100644
--- a/drivers/video/au1100fb.c
+++ b/drivers/video/au1100fb.c
@@ -457,7 +457,7 @@ static struct fb_ops au1100fb_ops =
457 457
458/* AU1100 LCD controller device driver */ 458/* AU1100 LCD controller device driver */
459 459
460static int __init au1100fb_drv_probe(struct device *dev) 460static int __init au1100fb_drv_probe(struct platform_device *dev)
461{ 461{
462 struct au1100fb_device *fbdev = NULL; 462 struct au1100fb_device *fbdev = NULL;
463 struct resource *regs_res; 463 struct resource *regs_res;
@@ -475,7 +475,7 @@ static int __init au1100fb_drv_probe(struct device *dev)
475 475
476 fbdev->panel = &known_lcd_panels[drv_info.panel_idx]; 476 fbdev->panel = &known_lcd_panels[drv_info.panel_idx];
477 477
478 dev_set_drvdata(dev, (void*)fbdev); 478 platform_set_drvdata(dev, (void *)fbdev);
479 479
480 /* Allocate region for our registers and map them */ 480 /* Allocate region for our registers and map them */
481 if (!(regs_res = platform_get_resource(to_platform_device(dev), 481 if (!(regs_res = platform_get_resource(to_platform_device(dev),
@@ -583,19 +583,19 @@ failed:
583 fb_dealloc_cmap(&fbdev->info.cmap); 583 fb_dealloc_cmap(&fbdev->info.cmap);
584 } 584 }
585 kfree(fbdev); 585 kfree(fbdev);
586 dev_set_drvdata(dev, NULL); 586 platform_set_drvdata(dev, NULL);
587 587
588 return 0; 588 return 0;
589} 589}
590 590
591int au1100fb_drv_remove(struct device *dev) 591int au1100fb_drv_remove(struct platform_device *dev)
592{ 592{
593 struct au1100fb_device *fbdev = NULL; 593 struct au1100fb_device *fbdev = NULL;
594 594
595 if (!dev) 595 if (!dev)
596 return -ENODEV; 596 return -ENODEV;
597 597
598 fbdev = (struct au1100fb_device*) dev_get_drvdata(dev); 598 fbdev = (struct au1100fb_device *) platform_get_drvdata(dev);
599 599
600#if !defined(CONFIG_FRAMEBUFFER_CONSOLE) && defined(CONFIG_LOGO) 600#if !defined(CONFIG_FRAMEBUFFER_CONSOLE) && defined(CONFIG_LOGO)
601 au1100fb_fb_blank(VESA_POWERDOWN, &fbdev->info); 601 au1100fb_fb_blank(VESA_POWERDOWN, &fbdev->info);
@@ -620,9 +620,9 @@ int au1100fb_drv_remove(struct device *dev)
620static u32 sys_clksrc; 620static u32 sys_clksrc;
621static struct au1100fb_regs fbregs; 621static struct au1100fb_regs fbregs;
622 622
623int au1100fb_drv_suspend(struct device *dev, pm_message_t state) 623int au1100fb_drv_suspend(struct platform_device *dev, pm_message_t state)
624{ 624{
625 struct au1100fb_device *fbdev = dev_get_drvdata(dev); 625 struct au1100fb_device *fbdev = platform_get_drvdata(dev);
626 626
627 if (!fbdev) 627 if (!fbdev)
628 return 0; 628 return 0;
@@ -641,9 +641,9 @@ int au1100fb_drv_suspend(struct device *dev, pm_message_t state)
641 return 0; 641 return 0;
642} 642}
643 643
644int au1100fb_drv_resume(struct device *dev) 644int au1100fb_drv_resume(struct platform_device *dev)
645{ 645{
646 struct au1100fb_device *fbdev = dev_get_drvdata(dev); 646 struct au1100fb_device *fbdev = platform_get_drvdata(dev);
647 647
648 if (!fbdev) 648 if (!fbdev)
649 return 0; 649 return 0;
@@ -663,10 +663,11 @@ int au1100fb_drv_resume(struct device *dev)
663#define au1100fb_drv_resume NULL 663#define au1100fb_drv_resume NULL
664#endif 664#endif
665 665
666static struct device_driver au1100fb_driver = { 666static struct platform_driver au1100fb_driver = {
667 .name = "au1100-lcd", 667 .driver = {
668 .bus = &platform_bus_type, 668 .name = "au1100-lcd",
669 669 .owner = THIS_MODULE,
670 },
670 .probe = au1100fb_drv_probe, 671 .probe = au1100fb_drv_probe,
671 .remove = au1100fb_drv_remove, 672 .remove = au1100fb_drv_remove,
672 .suspend = au1100fb_drv_suspend, 673 .suspend = au1100fb_drv_suspend,
@@ -753,12 +754,12 @@ int __init au1100fb_init(void)
753 return ret; 754 return ret;
754 } 755 }
755 756
756 return driver_register(&au1100fb_driver); 757 return platform_driver_register(&au1100fb_driver);
757} 758}
758 759
759void __exit au1100fb_cleanup(void) 760void __exit au1100fb_cleanup(void)
760{ 761{
761 driver_unregister(&au1100fb_driver); 762 platform_driver_unregister(&au1100fb_driver);
762 763
763 kfree(drv_info.opt_mode); 764 kfree(drv_info.opt_mode);
764} 765}
diff --git a/drivers/video/au1200fb.c b/drivers/video/au1200fb.c
index 03e57ef88378..0d96f1d2d4c5 100644
--- a/drivers/video/au1200fb.c
+++ b/drivers/video/au1200fb.c
@@ -1622,7 +1622,7 @@ static int au1200fb_init_fbinfo(struct au1200fb_device *fbdev)
1622 1622
1623/* AU1200 LCD controller device driver */ 1623/* AU1200 LCD controller device driver */
1624 1624
1625static int au1200fb_drv_probe(struct device *dev) 1625static int au1200fb_drv_probe(struct platform_device *dev)
1626{ 1626{
1627 struct au1200fb_device *fbdev; 1627 struct au1200fb_device *fbdev;
1628 unsigned long page; 1628 unsigned long page;
@@ -1645,7 +1645,7 @@ static int au1200fb_drv_probe(struct device *dev)
1645 /* Allocate the framebuffer to the maximum screen size */ 1645 /* Allocate the framebuffer to the maximum screen size */
1646 fbdev->fb_len = (win->w[plane].xres * win->w[plane].yres * bpp) / 8; 1646 fbdev->fb_len = (win->w[plane].xres * win->w[plane].yres * bpp) / 8;
1647 1647
1648 fbdev->fb_mem = dma_alloc_noncoherent(dev, 1648 fbdev->fb_mem = dma_alloc_noncoherent(&dev->dev,
1649 PAGE_ALIGN(fbdev->fb_len), 1649 PAGE_ALIGN(fbdev->fb_len),
1650 &fbdev->fb_phys, GFP_KERNEL); 1650 &fbdev->fb_phys, GFP_KERNEL);
1651 if (!fbdev->fb_mem) { 1651 if (!fbdev->fb_mem) {
@@ -1715,7 +1715,7 @@ failed:
1715 return ret; 1715 return ret;
1716} 1716}
1717 1717
1718static int au1200fb_drv_remove(struct device *dev) 1718static int au1200fb_drv_remove(struct platform_device *dev)
1719{ 1719{
1720 struct au1200fb_device *fbdev; 1720 struct au1200fb_device *fbdev;
1721 int plane; 1721 int plane;
@@ -1733,7 +1733,8 @@ static int au1200fb_drv_remove(struct device *dev)
1733 /* Clean up all probe data */ 1733 /* Clean up all probe data */
1734 unregister_framebuffer(&fbdev->fb_info); 1734 unregister_framebuffer(&fbdev->fb_info);
1735 if (fbdev->fb_mem) 1735 if (fbdev->fb_mem)
1736 dma_free_noncoherent(dev, PAGE_ALIGN(fbdev->fb_len), 1736 dma_free_noncoherent(&dev->dev,
1737 PAGE_ALIGN(fbdev->fb_len),
1737 fbdev->fb_mem, fbdev->fb_phys); 1738 fbdev->fb_mem, fbdev->fb_phys);
1738 if (fbdev->fb_info.cmap.len != 0) 1739 if (fbdev->fb_info.cmap.len != 0)
1739 fb_dealloc_cmap(&fbdev->fb_info.cmap); 1740 fb_dealloc_cmap(&fbdev->fb_info.cmap);
@@ -1747,22 +1748,24 @@ static int au1200fb_drv_remove(struct device *dev)
1747} 1748}
1748 1749
1749#ifdef CONFIG_PM 1750#ifdef CONFIG_PM
1750static int au1200fb_drv_suspend(struct device *dev, u32 state, u32 level) 1751static int au1200fb_drv_suspend(struct platform_device *dev, u32 state)
1751{ 1752{
1752 /* TODO */ 1753 /* TODO */
1753 return 0; 1754 return 0;
1754} 1755}
1755 1756
1756static int au1200fb_drv_resume(struct device *dev, u32 level) 1757static int au1200fb_drv_resume(struct platform_device *dev)
1757{ 1758{
1758 /* TODO */ 1759 /* TODO */
1759 return 0; 1760 return 0;
1760} 1761}
1761#endif /* CONFIG_PM */ 1762#endif /* CONFIG_PM */
1762 1763
1763static struct device_driver au1200fb_driver = { 1764static struct platform_driver au1200fb_driver = {
1764 .name = "au1200-lcd", 1765 .driver = {
1765 .bus = &platform_bus_type, 1766 .name = "au1200-lcd",
1767 .owner = THIS_MODULE,
1768 },
1766 .probe = au1200fb_drv_probe, 1769 .probe = au1200fb_drv_probe,
1767 .remove = au1200fb_drv_remove, 1770 .remove = au1200fb_drv_remove,
1768#ifdef CONFIG_PM 1771#ifdef CONFIG_PM
@@ -1906,12 +1909,12 @@ static int __init au1200fb_init(void)
1906 printk(KERN_INFO "Power management device entry for the au1200fb loaded.\n"); 1909 printk(KERN_INFO "Power management device entry for the au1200fb loaded.\n");
1907 #endif 1910 #endif
1908 1911
1909 return driver_register(&au1200fb_driver); 1912 return platform_driver_register(&au1200fb_driver);
1910} 1913}
1911 1914
1912static void __exit au1200fb_cleanup(void) 1915static void __exit au1200fb_cleanup(void)
1913{ 1916{
1914 driver_unregister(&au1200fb_driver); 1917 platform_driver_unregister(&au1200fb_driver);
1915} 1918}
1916 1919
1917module_init(au1200fb_init); 1920module_init(au1200fb_init);
diff --git a/drivers/video/pmag-ba-fb.c b/drivers/video/pmag-ba-fb.c
index 3a3f80f65219..0573ec685a57 100644
--- a/drivers/video/pmag-ba-fb.c
+++ b/drivers/video/pmag-ba-fb.c
@@ -151,7 +151,7 @@ static int __init pmagbafb_probe(struct device *dev)
151 151
152 info = framebuffer_alloc(sizeof(struct pmagbafb_par), dev); 152 info = framebuffer_alloc(sizeof(struct pmagbafb_par), dev);
153 if (!info) { 153 if (!info) {
154 printk(KERN_ERR "%s: Cannot allocate memory\n", dev->bus_id); 154 printk(KERN_ERR "%s: Cannot allocate memory\n", dev_name(dev));
155 return -ENOMEM; 155 return -ENOMEM;
156 } 156 }
157 157
@@ -160,7 +160,7 @@ static int __init pmagbafb_probe(struct device *dev)
160 160
161 if (fb_alloc_cmap(&info->cmap, 256, 0) < 0) { 161 if (fb_alloc_cmap(&info->cmap, 256, 0) < 0) {
162 printk(KERN_ERR "%s: Cannot allocate color map\n", 162 printk(KERN_ERR "%s: Cannot allocate color map\n",
163 dev->bus_id); 163 dev_name(dev));
164 err = -ENOMEM; 164 err = -ENOMEM;
165 goto err_alloc; 165 goto err_alloc;
166 } 166 }
@@ -173,8 +173,9 @@ static int __init pmagbafb_probe(struct device *dev)
173 /* Request the I/O MEM resource. */ 173 /* Request the I/O MEM resource. */
174 start = tdev->resource.start; 174 start = tdev->resource.start;
175 len = tdev->resource.end - start + 1; 175 len = tdev->resource.end - start + 1;
176 if (!request_mem_region(start, len, dev->bus_id)) { 176 if (!request_mem_region(start, len, dev_name(dev))) {
177 printk(KERN_ERR "%s: Cannot reserve FB region\n", dev->bus_id); 177 printk(KERN_ERR "%s: Cannot reserve FB region\n",
178 dev_name(dev));
178 err = -EBUSY; 179 err = -EBUSY;
179 goto err_cmap; 180 goto err_cmap;
180 } 181 }
@@ -183,7 +184,7 @@ static int __init pmagbafb_probe(struct device *dev)
183 info->fix.mmio_start = start; 184 info->fix.mmio_start = start;
184 par->mmio = ioremap_nocache(info->fix.mmio_start, info->fix.mmio_len); 185 par->mmio = ioremap_nocache(info->fix.mmio_start, info->fix.mmio_len);
185 if (!par->mmio) { 186 if (!par->mmio) {
186 printk(KERN_ERR "%s: Cannot map MMIO\n", dev->bus_id); 187 printk(KERN_ERR "%s: Cannot map MMIO\n", dev_name(dev));
187 err = -ENOMEM; 188 err = -ENOMEM;
188 goto err_resource; 189 goto err_resource;
189 } 190 }
@@ -194,7 +195,7 @@ static int __init pmagbafb_probe(struct device *dev)
194 info->screen_base = ioremap_nocache(info->fix.smem_start, 195 info->screen_base = ioremap_nocache(info->fix.smem_start,
195 info->fix.smem_len); 196 info->fix.smem_len);
196 if (!info->screen_base) { 197 if (!info->screen_base) {
197 printk(KERN_ERR "%s: Cannot map FB\n", dev->bus_id); 198 printk(KERN_ERR "%s: Cannot map FB\n", dev_name(dev));
198 err = -ENOMEM; 199 err = -ENOMEM;
199 goto err_mmio_map; 200 goto err_mmio_map;
200 } 201 }
@@ -205,14 +206,14 @@ static int __init pmagbafb_probe(struct device *dev)
205 err = register_framebuffer(info); 206 err = register_framebuffer(info);
206 if (err < 0) { 207 if (err < 0) {
207 printk(KERN_ERR "%s: Cannot register framebuffer\n", 208 printk(KERN_ERR "%s: Cannot register framebuffer\n",
208 dev->bus_id); 209 dev_name(dev));
209 goto err_smem_map; 210 goto err_smem_map;
210 } 211 }
211 212
212 get_device(dev); 213 get_device(dev);
213 214
214 pr_info("fb%d: %s frame buffer device at %s\n", 215 pr_info("fb%d: %s frame buffer device at %s\n",
215 info->node, info->fix.id, dev->bus_id); 216 info->node, info->fix.id, dev_name(dev));
216 217
217 return 0; 218 return 0;
218 219
diff --git a/drivers/video/pmagb-b-fb.c b/drivers/video/pmagb-b-fb.c
index 9b80597241b0..98748723af9f 100644
--- a/drivers/video/pmagb-b-fb.c
+++ b/drivers/video/pmagb-b-fb.c
@@ -258,7 +258,7 @@ static int __init pmagbbfb_probe(struct device *dev)
258 258
259 info = framebuffer_alloc(sizeof(struct pmagbbfb_par), dev); 259 info = framebuffer_alloc(sizeof(struct pmagbbfb_par), dev);
260 if (!info) { 260 if (!info) {
261 printk(KERN_ERR "%s: Cannot allocate memory\n", dev->bus_id); 261 printk(KERN_ERR "%s: Cannot allocate memory\n", dev_name(dev));
262 return -ENOMEM; 262 return -ENOMEM;
263 } 263 }
264 264
@@ -267,7 +267,7 @@ static int __init pmagbbfb_probe(struct device *dev)
267 267
268 if (fb_alloc_cmap(&info->cmap, 256, 0) < 0) { 268 if (fb_alloc_cmap(&info->cmap, 256, 0) < 0) {
269 printk(KERN_ERR "%s: Cannot allocate color map\n", 269 printk(KERN_ERR "%s: Cannot allocate color map\n",
270 dev->bus_id); 270 dev_name(dev));
271 err = -ENOMEM; 271 err = -ENOMEM;
272 goto err_alloc; 272 goto err_alloc;
273 } 273 }
@@ -280,8 +280,9 @@ static int __init pmagbbfb_probe(struct device *dev)
280 /* Request the I/O MEM resource. */ 280 /* Request the I/O MEM resource. */
281 start = tdev->resource.start; 281 start = tdev->resource.start;
282 len = tdev->resource.end - start + 1; 282 len = tdev->resource.end - start + 1;
283 if (!request_mem_region(start, len, dev->bus_id)) { 283 if (!request_mem_region(start, len, dev_name(dev))) {
284 printk(KERN_ERR "%s: Cannot reserve FB region\n", dev->bus_id); 284 printk(KERN_ERR "%s: Cannot reserve FB region\n",
285 dev_name(dev));
285 err = -EBUSY; 286 err = -EBUSY;
286 goto err_cmap; 287 goto err_cmap;
287 } 288 }
@@ -290,7 +291,7 @@ static int __init pmagbbfb_probe(struct device *dev)
290 info->fix.mmio_start = start; 291 info->fix.mmio_start = start;
291 par->mmio = ioremap_nocache(info->fix.mmio_start, info->fix.mmio_len); 292 par->mmio = ioremap_nocache(info->fix.mmio_start, info->fix.mmio_len);
292 if (!par->mmio) { 293 if (!par->mmio) {
293 printk(KERN_ERR "%s: Cannot map MMIO\n", dev->bus_id); 294 printk(KERN_ERR "%s: Cannot map MMIO\n", dev_name(dev));
294 err = -ENOMEM; 295 err = -ENOMEM;
295 goto err_resource; 296 goto err_resource;
296 } 297 }
@@ -301,7 +302,7 @@ static int __init pmagbbfb_probe(struct device *dev)
301 info->fix.smem_start = start + PMAGB_B_FBMEM; 302 info->fix.smem_start = start + PMAGB_B_FBMEM;
302 par->smem = ioremap_nocache(info->fix.smem_start, info->fix.smem_len); 303 par->smem = ioremap_nocache(info->fix.smem_start, info->fix.smem_len);
303 if (!par->smem) { 304 if (!par->smem) {
304 printk(KERN_ERR "%s: Cannot map FB\n", dev->bus_id); 305 printk(KERN_ERR "%s: Cannot map FB\n", dev_name(dev));
305 err = -ENOMEM; 306 err = -ENOMEM;
306 goto err_mmio_map; 307 goto err_mmio_map;
307 } 308 }
@@ -316,7 +317,7 @@ static int __init pmagbbfb_probe(struct device *dev)
316 err = register_framebuffer(info); 317 err = register_framebuffer(info);
317 if (err < 0) { 318 if (err < 0) {
318 printk(KERN_ERR "%s: Cannot register framebuffer\n", 319 printk(KERN_ERR "%s: Cannot register framebuffer\n",
319 dev->bus_id); 320 dev_name(dev));
320 goto err_smem_map; 321 goto err_smem_map;
321 } 322 }
322 323
@@ -328,7 +329,7 @@ static int __init pmagbbfb_probe(struct device *dev)
328 par->osc1 / 1000, par->osc1 % 1000); 329 par->osc1 / 1000, par->osc1 % 1000);
329 330
330 pr_info("fb%d: %s frame buffer device at %s\n", 331 pr_info("fb%d: %s frame buffer device at %s\n",
331 info->node, info->fix.id, dev->bus_id); 332 info->node, info->fix.id, dev_name(dev));
332 pr_info("fb%d: Osc0: %s, Osc1: %s, Osc%u selected\n", 333 pr_info("fb%d: Osc0: %s, Osc1: %s, Osc%u selected\n",
333 info->node, freq0, par->osc1 ? freq1 : "disabled", 334 info->node, freq0, par->osc1 ? freq1 : "disabled",
334 par->osc1 != 0); 335 par->osc1 != 0);
diff --git a/drivers/video/ps3fb.c b/drivers/video/ps3fb.c
index 87f826e4c958..e00c1dff55de 100644
--- a/drivers/video/ps3fb.c
+++ b/drivers/video/ps3fb.c
@@ -1213,7 +1213,7 @@ static int __devinit ps3fb_probe(struct ps3_system_bus_device *dev)
1213 dev->core.driver_data = info; 1213 dev->core.driver_data = info;
1214 1214
1215 dev_info(info->device, "%s %s, using %u KiB of video memory\n", 1215 dev_info(info->device, "%s %s, using %u KiB of video memory\n",
1216 dev_driver_string(info->dev), info->dev->bus_id, 1216 dev_driver_string(info->dev), dev_name(info->dev),
1217 info->fix.smem_len >> 10); 1217 info->fix.smem_len >> 10);
1218 1218
1219 task = kthread_run(ps3fbd, info, DEVICE_NAME); 1219 task = kthread_run(ps3fbd, info, DEVICE_NAME);
diff --git a/drivers/video/pvr2fb.c b/drivers/video/pvr2fb.c
index 0a0fd48a8566..53f8f1100e81 100644
--- a/drivers/video/pvr2fb.c
+++ b/drivers/video/pvr2fb.c
@@ -61,7 +61,7 @@
61#include <mach-dreamcast/mach/sysasic.h> 61#include <mach-dreamcast/mach/sysasic.h>
62#endif 62#endif
63 63
64#ifdef CONFIG_SH_DMA 64#ifdef CONFIG_PVR2_DMA
65#include <linux/pagemap.h> 65#include <linux/pagemap.h>
66#include <mach/dma.h> 66#include <mach/dma.h>
67#include <asm/dma.h> 67#include <asm/dma.h>
@@ -188,7 +188,7 @@ static unsigned int is_blanked = 0; /* Is the screen blanked? */
188static unsigned long pvr2fb_map; 188static unsigned long pvr2fb_map;
189#endif 189#endif
190 190
191#ifdef CONFIG_SH_DMA 191#ifdef CONFIG_PVR2_DMA
192static unsigned int shdma = PVR2_CASCADE_CHAN; 192static unsigned int shdma = PVR2_CASCADE_CHAN;
193static unsigned int pvr2dma = ONCHIP_NR_DMA_CHANNELS; 193static unsigned int pvr2dma = ONCHIP_NR_DMA_CHANNELS;
194#endif 194#endif
@@ -207,7 +207,7 @@ static irqreturn_t pvr2fb_interrupt(int irq, void *dev_id);
207static int pvr2_init_cable(void); 207static int pvr2_init_cable(void);
208static int pvr2_get_param(const struct pvr2_params *p, const char *s, 208static int pvr2_get_param(const struct pvr2_params *p, const char *s,
209 int val, int size); 209 int val, int size);
210#ifdef CONFIG_SH_DMA 210#ifdef CONFIG_PVR2_DMA
211static ssize_t pvr2fb_write(struct fb_info *info, const char *buf, 211static ssize_t pvr2fb_write(struct fb_info *info, const char *buf,
212 size_t count, loff_t *ppos); 212 size_t count, loff_t *ppos);
213#endif 213#endif
@@ -218,7 +218,7 @@ static struct fb_ops pvr2fb_ops = {
218 .fb_blank = pvr2fb_blank, 218 .fb_blank = pvr2fb_blank,
219 .fb_check_var = pvr2fb_check_var, 219 .fb_check_var = pvr2fb_check_var,
220 .fb_set_par = pvr2fb_set_par, 220 .fb_set_par = pvr2fb_set_par,
221#ifdef CONFIG_SH_DMA 221#ifdef CONFIG_PVR2_DMA
222 .fb_write = pvr2fb_write, 222 .fb_write = pvr2fb_write,
223#endif 223#endif
224 .fb_fillrect = cfb_fillrect, 224 .fb_fillrect = cfb_fillrect,
@@ -671,7 +671,7 @@ static int pvr2_init_cable(void)
671 return cable_type; 671 return cable_type;
672} 672}
673 673
674#ifdef CONFIG_SH_DMA 674#ifdef CONFIG_PVR2_DMA
675static ssize_t pvr2fb_write(struct fb_info *info, const char *buf, 675static ssize_t pvr2fb_write(struct fb_info *info, const char *buf,
676 size_t count, loff_t *ppos) 676 size_t count, loff_t *ppos)
677{ 677{
@@ -743,7 +743,7 @@ out_unmap:
743 743
744 return ret; 744 return ret;
745} 745}
746#endif /* CONFIG_SH_DMA */ 746#endif /* CONFIG_PVR2_DMA */
747 747
748/** 748/**
749 * pvr2fb_common_init 749 * pvr2fb_common_init
@@ -893,7 +893,7 @@ static int __init pvr2fb_dc_init(void)
893 return -EBUSY; 893 return -EBUSY;
894 } 894 }
895 895
896#ifdef CONFIG_SH_DMA 896#ifdef CONFIG_PVR2_DMA
897 if (request_dma(pvr2dma, "pvr2") != 0) { 897 if (request_dma(pvr2dma, "pvr2") != 0) {
898 free_irq(HW_EVENT_VSYNC, 0); 898 free_irq(HW_EVENT_VSYNC, 0);
899 return -EBUSY; 899 return -EBUSY;
@@ -915,7 +915,7 @@ static void __exit pvr2fb_dc_exit(void)
915 } 915 }
916 916
917 free_irq(HW_EVENT_VSYNC, 0); 917 free_irq(HW_EVENT_VSYNC, 0);
918#ifdef CONFIG_SH_DMA 918#ifdef CONFIG_PVR2_DMA
919 free_dma(pvr2dma); 919 free_dma(pvr2dma);
920#endif 920#endif
921} 921}
diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
index 2c5d069e5f06..92ea0ab44ce2 100644
--- a/drivers/video/sh_mobile_lcdcfb.c
+++ b/drivers/video/sh_mobile_lcdcfb.c
@@ -33,6 +33,8 @@ struct sh_mobile_lcdc_chan {
33 struct fb_info info; 33 struct fb_info info;
34 dma_addr_t dma_handle; 34 dma_addr_t dma_handle;
35 struct fb_deferred_io defio; 35 struct fb_deferred_io defio;
36 unsigned long frame_end;
37 wait_queue_head_t frame_end_wait;
36}; 38};
37 39
38struct sh_mobile_lcdc_priv { 40struct sh_mobile_lcdc_priv {
@@ -226,7 +228,10 @@ static void sh_mobile_lcdc_deferred_io_touch(struct fb_info *info)
226static irqreturn_t sh_mobile_lcdc_irq(int irq, void *data) 228static irqreturn_t sh_mobile_lcdc_irq(int irq, void *data)
227{ 229{
228 struct sh_mobile_lcdc_priv *priv = data; 230 struct sh_mobile_lcdc_priv *priv = data;
231 struct sh_mobile_lcdc_chan *ch;
229 unsigned long tmp; 232 unsigned long tmp;
233 int is_sub;
234 int k;
230 235
231 /* acknowledge interrupt */ 236 /* acknowledge interrupt */
232 tmp = lcdc_read(priv, _LDINTR); 237 tmp = lcdc_read(priv, _LDINTR);
@@ -234,8 +239,24 @@ static irqreturn_t sh_mobile_lcdc_irq(int irq, void *data)
234 tmp |= 0x000000ff ^ LDINTR_FS; /* status in low 8 */ 239 tmp |= 0x000000ff ^ LDINTR_FS; /* status in low 8 */
235 lcdc_write(priv, _LDINTR, tmp); 240 lcdc_write(priv, _LDINTR, tmp);
236 241
237 /* disable clocks */ 242 /* figure out if this interrupt is for main or sub lcd */
238 sh_mobile_lcdc_clk_off(priv); 243 is_sub = (lcdc_read(priv, _LDSR) & (1 << 10)) ? 1 : 0;
244
245 /* wake up channel and disable clocks*/
246 for (k = 0; k < ARRAY_SIZE(priv->ch); k++) {
247 ch = &priv->ch[k];
248
249 if (!ch->enabled)
250 continue;
251
252 if (is_sub == lcdc_chan_is_sublcd(ch)) {
253 ch->frame_end = 1;
254 wake_up(&ch->frame_end_wait);
255
256 sh_mobile_lcdc_clk_off(priv);
257 }
258 }
259
239 return IRQ_HANDLED; 260 return IRQ_HANDLED;
240} 261}
241 262
@@ -448,18 +469,27 @@ static void sh_mobile_lcdc_stop(struct sh_mobile_lcdc_priv *priv)
448 struct sh_mobile_lcdc_board_cfg *board_cfg; 469 struct sh_mobile_lcdc_board_cfg *board_cfg;
449 int k; 470 int k;
450 471
451 /* tell the board code to disable the panel */ 472 /* clean up deferred io and ask board code to disable panel */
452 for (k = 0; k < ARRAY_SIZE(priv->ch); k++) { 473 for (k = 0; k < ARRAY_SIZE(priv->ch); k++) {
453 ch = &priv->ch[k]; 474 ch = &priv->ch[k];
454 board_cfg = &ch->cfg.board_cfg;
455 if (board_cfg->display_off)
456 board_cfg->display_off(board_cfg->board_data);
457 475
458 /* cleanup deferred io if enabled */ 476 /* deferred io mode:
477 * flush frame, and wait for frame end interrupt
478 * clean up deferred io and enable clock
479 */
459 if (ch->info.fbdefio) { 480 if (ch->info.fbdefio) {
481 ch->frame_end = 0;
482 schedule_delayed_work(&ch->info.deferred_work, 0);
483 wait_event(ch->frame_end_wait, ch->frame_end);
460 fb_deferred_io_cleanup(&ch->info); 484 fb_deferred_io_cleanup(&ch->info);
461 ch->info.fbdefio = NULL; 485 ch->info.fbdefio = NULL;
486 sh_mobile_lcdc_clk_on(priv);
462 } 487 }
488
489 board_cfg = &ch->cfg.board_cfg;
490 if (board_cfg->display_off)
491 board_cfg->display_off(board_cfg->board_data);
492
463 } 493 }
464 494
465 /* stop the lcdc */ 495 /* stop the lcdc */
@@ -652,6 +682,26 @@ static int sh_mobile_lcdc_set_bpp(struct fb_var_screeninfo *var, int bpp)
652 return 0; 682 return 0;
653} 683}
654 684
685static int sh_mobile_lcdc_suspend(struct device *dev)
686{
687 struct platform_device *pdev = to_platform_device(dev);
688
689 sh_mobile_lcdc_stop(platform_get_drvdata(pdev));
690 return 0;
691}
692
693static int sh_mobile_lcdc_resume(struct device *dev)
694{
695 struct platform_device *pdev = to_platform_device(dev);
696
697 return sh_mobile_lcdc_start(platform_get_drvdata(pdev));
698}
699
700static struct dev_pm_ops sh_mobile_lcdc_dev_pm_ops = {
701 .suspend = sh_mobile_lcdc_suspend,
702 .resume = sh_mobile_lcdc_resume,
703};
704
655static int sh_mobile_lcdc_remove(struct platform_device *pdev); 705static int sh_mobile_lcdc_remove(struct platform_device *pdev);
656 706
657static int __init sh_mobile_lcdc_probe(struct platform_device *pdev) 707static int __init sh_mobile_lcdc_probe(struct platform_device *pdev)
@@ -687,7 +737,7 @@ static int __init sh_mobile_lcdc_probe(struct platform_device *pdev)
687 } 737 }
688 738
689 error = request_irq(i, sh_mobile_lcdc_irq, IRQF_DISABLED, 739 error = request_irq(i, sh_mobile_lcdc_irq, IRQF_DISABLED,
690 pdev->dev.bus_id, priv); 740 dev_name(&pdev->dev), priv);
691 if (error) { 741 if (error) {
692 dev_err(&pdev->dev, "unable to request irq\n"); 742 dev_err(&pdev->dev, "unable to request irq\n");
693 goto err1; 743 goto err1;
@@ -707,6 +757,7 @@ static int __init sh_mobile_lcdc_probe(struct platform_device *pdev)
707 dev_err(&pdev->dev, "unsupported interface type\n"); 757 dev_err(&pdev->dev, "unsupported interface type\n");
708 goto err1; 758 goto err1;
709 } 759 }
760 init_waitqueue_head(&priv->ch[i].frame_end_wait);
710 761
711 switch (pdata->ch[i].chan) { 762 switch (pdata->ch[i].chan) {
712 case LCDC_CHAN_MAINLCD: 763 case LCDC_CHAN_MAINLCD:
@@ -860,6 +911,7 @@ static struct platform_driver sh_mobile_lcdc_driver = {
860 .driver = { 911 .driver = {
861 .name = "sh_mobile_lcdc_fb", 912 .name = "sh_mobile_lcdc_fb",
862 .owner = THIS_MODULE, 913 .owner = THIS_MODULE,
914 .pm = &sh_mobile_lcdc_dev_pm_ops,
863 }, 915 },
864 .probe = sh_mobile_lcdc_probe, 916 .probe = sh_mobile_lcdc_probe,
865 .remove = sh_mobile_lcdc_remove, 917 .remove = sh_mobile_lcdc_remove,
diff --git a/drivers/video/tmiofb.c b/drivers/video/tmiofb.c
index 7baf2dd12d50..a1eb0862255b 100644
--- a/drivers/video/tmiofb.c
+++ b/drivers/video/tmiofb.c
@@ -751,7 +751,7 @@ static int __devinit tmiofb_probe(struct platform_device *dev)
751 } 751 }
752 752
753 retval = request_irq(irq, &tmiofb_irq, IRQF_DISABLED, 753 retval = request_irq(irq, &tmiofb_irq, IRQF_DISABLED,
754 dev->dev.bus_id, info); 754 dev_name(&dev->dev), info);
755 755
756 if (retval) 756 if (retval)
757 goto err_request_irq; 757 goto err_request_irq;
diff --git a/drivers/video/uvesafb.c b/drivers/video/uvesafb.c
index 6c2d37fdd3b9..74ae75899009 100644
--- a/drivers/video/uvesafb.c
+++ b/drivers/video/uvesafb.c
@@ -204,8 +204,11 @@ static int uvesafb_exec(struct uvesafb_ktask *task)
204 } else { 204 } else {
205 v86d_started = 1; 205 v86d_started = 1;
206 err = cn_netlink_send(m, 0, gfp_any()); 206 err = cn_netlink_send(m, 0, gfp_any());
207 if (err == -ENOBUFS)
208 err = 0;
207 } 209 }
208 } 210 } else if (err == -ENOBUFS)
211 err = 0;
209 212
210 if (!err && !(task->t.flags & TF_EXIT)) 213 if (!err && !(task->t.flags & TF_EXIT))
211 err = !wait_for_completion_timeout(task->done, 214 err = !wait_for_completion_timeout(task->done,