aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/pxafb.c
diff options
context:
space:
mode:
authorEric Miao <eric.miao@marvell.com>2008-12-03 22:14:11 -0500
committerEric Miao <eric.miao@marvell.com>2008-12-17 09:50:30 -0500
commit07df1c4fea1474ae6db2c8554d2915cf5cf81369 (patch)
tree429846c4fa999a7b32ce37f48eebc21d2efa78c9 /drivers/video/pxafb.c
parent09e647d30d0d8feff0aee77bd17342fbc79a3bf8 (diff)
[ARM] pxafb: small cleanup of the smart panel code
Group smart panel related code in a more compact fasion, avoid abused usage of #ifdef .. #endif. Also fix the incorrect condition in pxafb_smart_init() to decide if it is a smart panel or not. (should be '&' instead of '|') Signed-off-by: Eric Miao <eric.miao@marvell.com>
Diffstat (limited to 'drivers/video/pxafb.c')
-rw-r--r--drivers/video/pxafb.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c
index ab60537314fb..62d2dd0c1fa1 100644
--- a/drivers/video/pxafb.c
+++ b/drivers/video/pxafb.c
@@ -800,14 +800,19 @@ static int pxafb_smart_thread(void *arg)
800 800
801static int pxafb_smart_init(struct pxafb_info *fbi) 801static int pxafb_smart_init(struct pxafb_info *fbi)
802{ 802{
803 if (!(fbi->lccr0 | LCCR0_LCDT)) 803 if (!(fbi->lccr0 & LCCR0_LCDT))
804 return 0; 804 return 0;
805 805
806 fbi->smart_cmds = (uint16_t *) fbi->dma_buff->cmd_buff;
807 fbi->n_smart_cmds = 0;
808
809 init_completion(&fbi->command_done);
810 init_completion(&fbi->refresh_done);
811
806 fbi->smart_thread = kthread_run(pxafb_smart_thread, fbi, 812 fbi->smart_thread = kthread_run(pxafb_smart_thread, fbi,
807 "lcd_refresh"); 813 "lcd_refresh");
808 if (IS_ERR(fbi->smart_thread)) { 814 if (IS_ERR(fbi->smart_thread)) {
809 printk(KERN_ERR "%s: unable to create kernel thread\n", 815 pr_err("%s: unable to create kernel thread\n", __func__);
810 __func__);
811 return PTR_ERR(fbi->smart_thread); 816 return PTR_ERR(fbi->smart_thread);
812 } 817 }
813 818
@@ -823,7 +828,9 @@ int pxafb_smart_flush(struct fb_info *info)
823{ 828{
824 return 0; 829 return 0;
825} 830}
826#endif /* CONFIG_FB_SMART_PANEL */ 831
832static inline int pxafb_smart_init(struct pxafb_info *fbi) { return 0; }
833#endif /* CONFIG_FB_PXA_SMARTPANEL */
827 834
828static void setup_parallel_timing(struct pxafb_info *fbi, 835static void setup_parallel_timing(struct pxafb_info *fbi,
829 struct fb_var_screeninfo *var) 836 struct fb_var_screeninfo *var)
@@ -1286,11 +1293,6 @@ static int __devinit pxafb_map_video_memory(struct pxafb_info *fbi)
1286 fbi->palette_cpu = (u16 *) fbi->dma_buff->palette; 1293 fbi->palette_cpu = (u16 *) fbi->dma_buff->palette;
1287 1294
1288 pr_debug("pxafb: palette_mem_size = 0x%08x\n", fbi->palette_size*sizeof(u16)); 1295 pr_debug("pxafb: palette_mem_size = 0x%08x\n", fbi->palette_size*sizeof(u16));
1289
1290#ifdef CONFIG_FB_PXA_SMARTPANEL
1291 fbi->smart_cmds = (uint16_t *) fbi->dma_buff->cmd_buff;
1292 fbi->n_smart_cmds = 0;
1293#endif
1294 } 1296 }
1295 1297
1296 return fbi->map_cpu ? 0 : -ENOMEM; 1298 return fbi->map_cpu ? 0 : -ENOMEM;
@@ -1412,10 +1414,6 @@ static struct pxafb_info * __devinit pxafb_init_fbinfo(struct device *dev)
1412 INIT_WORK(&fbi->task, pxafb_task); 1414 INIT_WORK(&fbi->task, pxafb_task);
1413 mutex_init(&fbi->ctrlr_lock); 1415 mutex_init(&fbi->ctrlr_lock);
1414 init_completion(&fbi->disable_done); 1416 init_completion(&fbi->disable_done);
1415#ifdef CONFIG_FB_PXA_SMARTPANEL
1416 init_completion(&fbi->command_done);
1417 init_completion(&fbi->refresh_done);
1418#endif
1419 1417
1420 return fbi; 1418 return fbi;
1421} 1419}
@@ -1747,13 +1745,12 @@ static int __devinit pxafb_probe(struct platform_device *dev)
1747 goto failed_free_mem; 1745 goto failed_free_mem;
1748 } 1746 }
1749 1747
1750#ifdef CONFIG_FB_PXA_SMARTPANEL
1751 ret = pxafb_smart_init(fbi); 1748 ret = pxafb_smart_init(fbi);
1752 if (ret) { 1749 if (ret) {
1753 dev_err(&dev->dev, "failed to initialize smartpanel\n"); 1750 dev_err(&dev->dev, "failed to initialize smartpanel\n");
1754 goto failed_free_irq; 1751 goto failed_free_irq;
1755 } 1752 }
1756#endif 1753
1757 /* 1754 /*
1758 * This makes sure that our colour bitfield 1755 * This makes sure that our colour bitfield
1759 * descriptors are correctly initialised. 1756 * descriptors are correctly initialised.