diff options
author | Eric Miao <eric.miao@marvell.com> | 2008-04-30 03:52:24 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-30 11:29:32 -0400 |
commit | 2ba162b9335c6e3ba90c77637372fc9f078aae67 (patch) | |
tree | 777d19a2b3cd20744e221ca2bba451b4b0db42cd | |
parent | a7535ba730e13db037bd22c79c3805690d0945a2 (diff) |
pxafb: use completion for LCD disable wait code
Signed-off-by: eric miao <eric.miao@marvell.com>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | drivers/video/pxafb.c | 12 | ||||
-rw-r--r-- | drivers/video/pxafb.h | 2 |
2 files changed, 6 insertions, 8 deletions
diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c index 417561779ec2..a4ee7225fe2c 100644 --- a/drivers/video/pxafb.c +++ b/drivers/video/pxafb.c | |||
@@ -39,6 +39,7 @@ | |||
39 | #include <linux/dma-mapping.h> | 39 | #include <linux/dma-mapping.h> |
40 | #include <linux/clk.h> | 40 | #include <linux/clk.h> |
41 | #include <linux/err.h> | 41 | #include <linux/err.h> |
42 | #include <linux/completion.h> | ||
42 | 43 | ||
43 | #include <asm/hardware.h> | 44 | #include <asm/hardware.h> |
44 | #include <asm/io.h> | 45 | #include <asm/io.h> |
@@ -810,11 +811,6 @@ static void pxafb_disable_controller(struct pxafb_info *fbi) | |||
810 | { | 811 | { |
811 | uint32_t lccr0; | 812 | uint32_t lccr0; |
812 | 813 | ||
813 | DECLARE_WAITQUEUE(wait, current); | ||
814 | |||
815 | set_current_state(TASK_UNINTERRUPTIBLE); | ||
816 | add_wait_queue(&fbi->ctrlr_wait, &wait); | ||
817 | |||
818 | /* Clear LCD Status Register */ | 814 | /* Clear LCD Status Register */ |
819 | lcd_writel(fbi, LCSR, 0xffffffff); | 815 | lcd_writel(fbi, LCSR, 0xffffffff); |
820 | 816 | ||
@@ -822,8 +818,7 @@ static void pxafb_disable_controller(struct pxafb_info *fbi) | |||
822 | lcd_writel(fbi, LCCR0, lccr0); | 818 | lcd_writel(fbi, LCCR0, lccr0); |
823 | lcd_writel(fbi, LCCR0, lccr0 | LCCR0_DIS); | 819 | lcd_writel(fbi, LCCR0, lccr0 | LCCR0_DIS); |
824 | 820 | ||
825 | schedule_timeout(200 * HZ / 1000); | 821 | wait_for_completion_timeout(&fbi->disable_done, 200 * HZ / 1000); |
826 | remove_wait_queue(&fbi->ctrlr_wait, &wait); | ||
827 | 822 | ||
828 | /* disable LCD controller clock */ | 823 | /* disable LCD controller clock */ |
829 | clk_disable(fbi->clk); | 824 | clk_disable(fbi->clk); |
@@ -840,7 +835,7 @@ static irqreturn_t pxafb_handle_irq(int irq, void *dev_id) | |||
840 | if (lcsr & LCSR_LDD) { | 835 | if (lcsr & LCSR_LDD) { |
841 | lccr0 = lcd_readl(fbi, LCCR0); | 836 | lccr0 = lcd_readl(fbi, LCCR0); |
842 | lcd_writel(fbi, LCCR0, lccr0 | LCCR0_LDM); | 837 | lcd_writel(fbi, LCCR0, lccr0 | LCCR0_LDM); |
843 | wake_up(&fbi->ctrlr_wait); | 838 | complete(&fbi->disable_done); |
844 | } | 839 | } |
845 | 840 | ||
846 | lcd_writel(fbi, LCSR, lcsr); | 841 | lcd_writel(fbi, LCSR, lcsr); |
@@ -1190,6 +1185,7 @@ static struct pxafb_info * __init pxafb_init_fbinfo(struct device *dev) | |||
1190 | init_waitqueue_head(&fbi->ctrlr_wait); | 1185 | init_waitqueue_head(&fbi->ctrlr_wait); |
1191 | INIT_WORK(&fbi->task, pxafb_task); | 1186 | INIT_WORK(&fbi->task, pxafb_task); |
1192 | init_MUTEX(&fbi->ctrlr_sem); | 1187 | init_MUTEX(&fbi->ctrlr_sem); |
1188 | init_completion(&fbi->disable_done); | ||
1193 | 1189 | ||
1194 | return fbi; | 1190 | return fbi; |
1195 | } | 1191 | } |
diff --git a/drivers/video/pxafb.h b/drivers/video/pxafb.h index b777641c5e70..f47f139fc5ed 100644 --- a/drivers/video/pxafb.h +++ b/drivers/video/pxafb.h | |||
@@ -114,6 +114,8 @@ struct pxafb_info { | |||
114 | wait_queue_head_t ctrlr_wait; | 114 | wait_queue_head_t ctrlr_wait; |
115 | struct work_struct task; | 115 | struct work_struct task; |
116 | 116 | ||
117 | struct completion disable_done; | ||
118 | |||
117 | #ifdef CONFIG_CPU_FREQ | 119 | #ifdef CONFIG_CPU_FREQ |
118 | struct notifier_block freq_transition; | 120 | struct notifier_block freq_transition; |
119 | struct notifier_block freq_policy; | 121 | struct notifier_block freq_policy; |