diff options
author | Darren Etheridge <detheridge@ti.com> | 2013-08-05 18:02:30 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2013-08-09 07:02:42 -0400 |
commit | 26e7164537380479bf96e852df6ab42ebe50e836 (patch) | |
tree | cc98c642369a8e875c6ac22cda9c3681dccaabd0 /drivers/video | |
parent | fe8c98f06b5eec94d318cd4761e7673fb5e3c662 (diff) |
video: da8xx-fb: improve readability of code
Change the lcd_disable_raster funtion from using a bool to an enum
as the function is very confusing with the current api. This helps
make it clearer what the parameter is really doing.
Signed-off-by: Darren Etheridge <detheridge@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/da8xx-fb.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c index 6beb88d7b7d7..93753828eb08 100644 --- a/drivers/video/da8xx-fb.c +++ b/drivers/video/da8xx-fb.c | |||
@@ -271,7 +271,8 @@ static inline void lcd_enable_raster(void) | |||
271 | } | 271 | } |
272 | 272 | ||
273 | /* Disable the Raster Engine of the LCD Controller */ | 273 | /* Disable the Raster Engine of the LCD Controller */ |
274 | static inline void lcd_disable_raster(bool wait_for_frame_done) | 274 | static inline void lcd_disable_raster(enum da8xx_frame_complete |
275 | wait_for_frame_done) | ||
275 | { | 276 | { |
276 | u32 reg; | 277 | u32 reg; |
277 | int ret; | 278 | int ret; |
@@ -283,7 +284,8 @@ static inline void lcd_disable_raster(bool wait_for_frame_done) | |||
283 | /* return if already disabled */ | 284 | /* return if already disabled */ |
284 | return; | 285 | return; |
285 | 286 | ||
286 | if ((wait_for_frame_done == true) && (lcd_revision == LCD_VERSION_2)) { | 287 | if ((wait_for_frame_done == DA8XX_FRAME_WAIT) && |
288 | (lcd_revision == LCD_VERSION_2)) { | ||
287 | frame_done_flag = 0; | 289 | frame_done_flag = 0; |
288 | ret = wait_event_interruptible_timeout(frame_done_wq, | 290 | ret = wait_event_interruptible_timeout(frame_done_wq, |
289 | frame_done_flag != 0, | 291 | frame_done_flag != 0, |
@@ -771,7 +773,7 @@ static irqreturn_t lcdc_irq_handler_rev02(int irq, void *arg) | |||
771 | u32 stat = lcdc_read(LCD_MASKED_STAT_REG); | 773 | u32 stat = lcdc_read(LCD_MASKED_STAT_REG); |
772 | 774 | ||
773 | if ((stat & LCD_SYNC_LOST) && (stat & LCD_FIFO_UNDERFLOW)) { | 775 | if ((stat & LCD_SYNC_LOST) && (stat & LCD_FIFO_UNDERFLOW)) { |
774 | lcd_disable_raster(false); | 776 | lcd_disable_raster(DA8XX_FRAME_NOWAIT); |
775 | lcdc_write(stat, LCD_MASKED_STAT_REG); | 777 | lcdc_write(stat, LCD_MASKED_STAT_REG); |
776 | lcd_enable_raster(); | 778 | lcd_enable_raster(); |
777 | } else if (stat & LCD_PL_LOAD_DONE) { | 779 | } else if (stat & LCD_PL_LOAD_DONE) { |
@@ -781,7 +783,7 @@ static irqreturn_t lcdc_irq_handler_rev02(int irq, void *arg) | |||
781 | * interrupt via the following write to the status register. If | 783 | * interrupt via the following write to the status register. If |
782 | * this is done after then one gets multiple PL done interrupts. | 784 | * this is done after then one gets multiple PL done interrupts. |
783 | */ | 785 | */ |
784 | lcd_disable_raster(false); | 786 | lcd_disable_raster(DA8XX_FRAME_NOWAIT); |
785 | 787 | ||
786 | lcdc_write(stat, LCD_MASKED_STAT_REG); | 788 | lcdc_write(stat, LCD_MASKED_STAT_REG); |
787 | 789 | ||
@@ -834,7 +836,7 @@ static irqreturn_t lcdc_irq_handler_rev01(int irq, void *arg) | |||
834 | u32 reg_ras; | 836 | u32 reg_ras; |
835 | 837 | ||
836 | if ((stat & LCD_SYNC_LOST) && (stat & LCD_FIFO_UNDERFLOW)) { | 838 | if ((stat & LCD_SYNC_LOST) && (stat & LCD_FIFO_UNDERFLOW)) { |
837 | lcd_disable_raster(false); | 839 | lcd_disable_raster(DA8XX_FRAME_NOWAIT); |
838 | lcdc_write(stat, LCD_STAT_REG); | 840 | lcdc_write(stat, LCD_STAT_REG); |
839 | lcd_enable_raster(); | 841 | lcd_enable_raster(); |
840 | } else if (stat & LCD_PL_LOAD_DONE) { | 842 | } else if (stat & LCD_PL_LOAD_DONE) { |
@@ -844,7 +846,7 @@ static irqreturn_t lcdc_irq_handler_rev01(int irq, void *arg) | |||
844 | * interrupt via the following write to the status register. If | 846 | * interrupt via the following write to the status register. If |
845 | * this is done after then one gets multiple PL done interrupts. | 847 | * this is done after then one gets multiple PL done interrupts. |
846 | */ | 848 | */ |
847 | lcd_disable_raster(false); | 849 | lcd_disable_raster(DA8XX_FRAME_NOWAIT); |
848 | 850 | ||
849 | lcdc_write(stat, LCD_STAT_REG); | 851 | lcdc_write(stat, LCD_STAT_REG); |
850 | 852 | ||
@@ -986,7 +988,7 @@ static int lcd_da8xx_cpufreq_transition(struct notifier_block *nb, | |||
986 | if (val == CPUFREQ_POSTCHANGE) { | 988 | if (val == CPUFREQ_POSTCHANGE) { |
987 | if (par->lcd_fck_rate != clk_get_rate(par->lcdc_clk)) { | 989 | if (par->lcd_fck_rate != clk_get_rate(par->lcdc_clk)) { |
988 | par->lcd_fck_rate = clk_get_rate(par->lcdc_clk); | 990 | par->lcd_fck_rate = clk_get_rate(par->lcdc_clk); |
989 | lcd_disable_raster(true); | 991 | lcd_disable_raster(DA8XX_FRAME_WAIT); |
990 | da8xx_fb_calc_config_clk_divider(par, &par->mode); | 992 | da8xx_fb_calc_config_clk_divider(par, &par->mode); |
991 | if (par->blank == FB_BLANK_UNBLANK) | 993 | if (par->blank == FB_BLANK_UNBLANK) |
992 | lcd_enable_raster(); | 994 | lcd_enable_raster(); |
@@ -1024,7 +1026,7 @@ static int fb_remove(struct platform_device *dev) | |||
1024 | if (par->panel_power_ctrl) | 1026 | if (par->panel_power_ctrl) |
1025 | par->panel_power_ctrl(0); | 1027 | par->panel_power_ctrl(0); |
1026 | 1028 | ||
1027 | lcd_disable_raster(true); | 1029 | lcd_disable_raster(DA8XX_FRAME_WAIT); |
1028 | lcdc_write(0, LCD_RASTER_CTRL_REG); | 1030 | lcdc_write(0, LCD_RASTER_CTRL_REG); |
1029 | 1031 | ||
1030 | /* disable DMA */ | 1032 | /* disable DMA */ |
@@ -1140,7 +1142,7 @@ static int cfb_blank(int blank, struct fb_info *info) | |||
1140 | if (par->panel_power_ctrl) | 1142 | if (par->panel_power_ctrl) |
1141 | par->panel_power_ctrl(0); | 1143 | par->panel_power_ctrl(0); |
1142 | 1144 | ||
1143 | lcd_disable_raster(true); | 1145 | lcd_disable_raster(DA8XX_FRAME_WAIT); |
1144 | break; | 1146 | break; |
1145 | default: | 1147 | default: |
1146 | ret = -EINVAL; | 1148 | ret = -EINVAL; |
@@ -1208,7 +1210,7 @@ static int da8xxfb_set_par(struct fb_info *info) | |||
1208 | bool raster = da8xx_fb_is_raster_enabled(); | 1210 | bool raster = da8xx_fb_is_raster_enabled(); |
1209 | 1211 | ||
1210 | if (raster) | 1212 | if (raster) |
1211 | lcd_disable_raster(true); | 1213 | lcd_disable_raster(DA8XX_FRAME_WAIT); |
1212 | 1214 | ||
1213 | fb_var_to_videomode(&par->mode, &info->var); | 1215 | fb_var_to_videomode(&par->mode, &info->var); |
1214 | 1216 | ||
@@ -1569,7 +1571,7 @@ static int fb_suspend(struct platform_device *dev, pm_message_t state) | |||
1569 | par->panel_power_ctrl(0); | 1571 | par->panel_power_ctrl(0); |
1570 | 1572 | ||
1571 | fb_set_suspend(info, 1); | 1573 | fb_set_suspend(info, 1); |
1572 | lcd_disable_raster(true); | 1574 | lcd_disable_raster(DA8XX_FRAME_WAIT); |
1573 | lcd_context_save(); | 1575 | lcd_context_save(); |
1574 | pm_runtime_put_sync(&dev->dev); | 1576 | pm_runtime_put_sync(&dev->dev); |
1575 | console_unlock(); | 1577 | console_unlock(); |