aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/pxafb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/pxafb.c')
-rw-r--r--drivers/video/pxafb.c34
1 files changed, 21 insertions, 13 deletions
diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c
index 0889d50c3288..1820c4a24434 100644
--- a/drivers/video/pxafb.c
+++ b/drivers/video/pxafb.c
@@ -815,8 +815,10 @@ static int overlayfb_map_video_memory(struct pxafb_layer *ofb)
815 ofb->video_mem_phys = virt_to_phys(ofb->video_mem); 815 ofb->video_mem_phys = virt_to_phys(ofb->video_mem);
816 ofb->video_mem_size = size; 816 ofb->video_mem_size = size;
817 817
818 mutex_lock(&ofb->fb.mm_lock);
818 ofb->fb.fix.smem_start = ofb->video_mem_phys; 819 ofb->fb.fix.smem_start = ofb->video_mem_phys;
819 ofb->fb.fix.smem_len = ofb->fb.fix.line_length * var->yres_virtual; 820 ofb->fb.fix.smem_len = ofb->fb.fix.line_length * var->yres_virtual;
821 mutex_unlock(&ofb->fb.mm_lock);
820 ofb->fb.screen_base = ofb->video_mem; 822 ofb->fb.screen_base = ofb->video_mem;
821 return 0; 823 return 0;
822} 824}
@@ -1636,24 +1638,26 @@ pxafb_freq_policy(struct notifier_block *nb, unsigned long val, void *data)
1636 * Power management hooks. Note that we won't be called from IRQ context, 1638 * Power management hooks. Note that we won't be called from IRQ context,
1637 * unlike the blank functions above, so we may sleep. 1639 * unlike the blank functions above, so we may sleep.
1638 */ 1640 */
1639static int pxafb_suspend(struct platform_device *dev, pm_message_t state) 1641static int pxafb_suspend(struct device *dev)
1640{ 1642{
1641 struct pxafb_info *fbi = platform_get_drvdata(dev); 1643 struct pxafb_info *fbi = dev_get_drvdata(dev);
1642 1644
1643 set_ctrlr_state(fbi, C_DISABLE_PM); 1645 set_ctrlr_state(fbi, C_DISABLE_PM);
1644 return 0; 1646 return 0;
1645} 1647}
1646 1648
1647static int pxafb_resume(struct platform_device *dev) 1649static int pxafb_resume(struct device *dev)
1648{ 1650{
1649 struct pxafb_info *fbi = platform_get_drvdata(dev); 1651 struct pxafb_info *fbi = dev_get_drvdata(dev);
1650 1652
1651 set_ctrlr_state(fbi, C_ENABLE_PM); 1653 set_ctrlr_state(fbi, C_ENABLE_PM);
1652 return 0; 1654 return 0;
1653} 1655}
1654#else 1656
1655#define pxafb_suspend NULL 1657static struct dev_pm_ops pxafb_pm_ops = {
1656#define pxafb_resume NULL 1658 .suspend = pxafb_suspend,
1659 .resume = pxafb_resume,
1660};
1657#endif 1661#endif
1658 1662
1659static int __devinit pxafb_init_video_memory(struct pxafb_info *fbi) 1663static int __devinit pxafb_init_video_memory(struct pxafb_info *fbi)
@@ -2079,6 +2083,9 @@ static int __devinit pxafb_probe(struct platform_device *dev)
2079 goto failed; 2083 goto failed;
2080 } 2084 }
2081 2085
2086 if (cpu_is_pxa3xx() && inf->acceleration_enabled)
2087 fbi->fb.fix.accel = FB_ACCEL_PXA3XX;
2088
2082 fbi->backlight_power = inf->pxafb_backlight_power; 2089 fbi->backlight_power = inf->pxafb_backlight_power;
2083 fbi->lcd_power = inf->pxafb_lcd_power; 2090 fbi->lcd_power = inf->pxafb_lcd_power;
2084 2091
@@ -2089,14 +2096,14 @@ static int __devinit pxafb_probe(struct platform_device *dev)
2089 goto failed_fbi; 2096 goto failed_fbi;
2090 } 2097 }
2091 2098
2092 r = request_mem_region(r->start, r->end - r->start + 1, dev->name); 2099 r = request_mem_region(r->start, resource_size(r), dev->name);
2093 if (r == NULL) { 2100 if (r == NULL) {
2094 dev_err(&dev->dev, "failed to request I/O memory\n"); 2101 dev_err(&dev->dev, "failed to request I/O memory\n");
2095 ret = -EBUSY; 2102 ret = -EBUSY;
2096 goto failed_fbi; 2103 goto failed_fbi;
2097 } 2104 }
2098 2105
2099 fbi->mmio_base = ioremap(r->start, r->end - r->start + 1); 2106 fbi->mmio_base = ioremap(r->start, resource_size(r));
2100 if (fbi->mmio_base == NULL) { 2107 if (fbi->mmio_base == NULL) {
2101 dev_err(&dev->dev, "failed to map I/O memory\n"); 2108 dev_err(&dev->dev, "failed to map I/O memory\n");
2102 ret = -EBUSY; 2109 ret = -EBUSY;
@@ -2195,7 +2202,7 @@ failed_free_dma:
2195failed_free_io: 2202failed_free_io:
2196 iounmap(fbi->mmio_base); 2203 iounmap(fbi->mmio_base);
2197failed_free_res: 2204failed_free_res:
2198 release_mem_region(r->start, r->end - r->start + 1); 2205 release_mem_region(r->start, resource_size(r));
2199failed_fbi: 2206failed_fbi:
2200 clk_put(fbi->clk); 2207 clk_put(fbi->clk);
2201 platform_set_drvdata(dev, NULL); 2208 platform_set_drvdata(dev, NULL);
@@ -2235,7 +2242,7 @@ static int __devexit pxafb_remove(struct platform_device *dev)
2235 iounmap(fbi->mmio_base); 2242 iounmap(fbi->mmio_base);
2236 2243
2237 r = platform_get_resource(dev, IORESOURCE_MEM, 0); 2244 r = platform_get_resource(dev, IORESOURCE_MEM, 0);
2238 release_mem_region(r->start, r->end - r->start + 1); 2245 release_mem_region(r->start, resource_size(r));
2239 2246
2240 clk_put(fbi->clk); 2247 clk_put(fbi->clk);
2241 kfree(fbi); 2248 kfree(fbi);
@@ -2246,11 +2253,12 @@ static int __devexit pxafb_remove(struct platform_device *dev)
2246static struct platform_driver pxafb_driver = { 2253static struct platform_driver pxafb_driver = {
2247 .probe = pxafb_probe, 2254 .probe = pxafb_probe,
2248 .remove = __devexit_p(pxafb_remove), 2255 .remove = __devexit_p(pxafb_remove),
2249 .suspend = pxafb_suspend,
2250 .resume = pxafb_resume,
2251 .driver = { 2256 .driver = {
2252 .owner = THIS_MODULE, 2257 .owner = THIS_MODULE,
2253 .name = "pxa2xx-fb", 2258 .name = "pxa2xx-fb",
2259#ifdef CONFIG_PM
2260 .pm = &pxafb_pm_ops,
2261#endif
2254 }, 2262 },
2255}; 2263};
2256 2264