diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2011-11-30 17:07:30 -0500 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2012-03-12 17:40:58 -0400 |
commit | 4976677f4d34df74d7207cae934b27f5d86feace (patch) | |
tree | 54441fa7b5a76049c9df7ec6458531e1cda9b10f /drivers/video/sh_mobile_lcdcfb.c | |
parent | 58f03d998de08bb15ce50ad875e41bdc281d77dd (diff) |
fbdev: sh_mobile_lcdc: Pass channel pointer to sh_mobile_wait_for_vsync
The sh_mobile_wait_for_vsync() function isn't related to the fbdev API,
make it generic by passing a channel pointer instead of an fb_info
pointer.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'drivers/video/sh_mobile_lcdcfb.c')
-rw-r--r-- | drivers/video/sh_mobile_lcdcfb.c | 47 |
1 files changed, 23 insertions, 24 deletions
diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c index 6d377b48c138..adc911f20033 100644 --- a/drivers/video/sh_mobile_lcdcfb.c +++ b/drivers/video/sh_mobile_lcdcfb.c | |||
@@ -585,6 +585,26 @@ static irqreturn_t sh_mobile_lcdc_irq(int irq, void *data) | |||
585 | return IRQ_HANDLED; | 585 | return IRQ_HANDLED; |
586 | } | 586 | } |
587 | 587 | ||
588 | static int sh_mobile_wait_for_vsync(struct sh_mobile_lcdc_chan *ch) | ||
589 | { | ||
590 | unsigned long ldintr; | ||
591 | int ret; | ||
592 | |||
593 | /* Enable VSync End interrupt and be careful not to acknowledge any | ||
594 | * pending interrupt. | ||
595 | */ | ||
596 | ldintr = lcdc_read(ch->lcdc, _LDINTR); | ||
597 | ldintr |= LDINTR_VEE | LDINTR_STATUS_MASK; | ||
598 | lcdc_write(ch->lcdc, _LDINTR, ldintr); | ||
599 | |||
600 | ret = wait_for_completion_interruptible_timeout(&ch->vsync_completion, | ||
601 | msecs_to_jiffies(100)); | ||
602 | if (!ret) | ||
603 | return -ETIMEDOUT; | ||
604 | |||
605 | return 0; | ||
606 | } | ||
607 | |||
588 | static void sh_mobile_lcdc_start_stop(struct sh_mobile_lcdc_priv *priv, | 608 | static void sh_mobile_lcdc_start_stop(struct sh_mobile_lcdc_priv *priv, |
589 | int start) | 609 | int start) |
590 | { | 610 | { |
@@ -1083,27 +1103,6 @@ static int sh_mobile_fb_pan_display(struct fb_var_screeninfo *var, | |||
1083 | return 0; | 1103 | return 0; |
1084 | } | 1104 | } |
1085 | 1105 | ||
1086 | static int sh_mobile_wait_for_vsync(struct fb_info *info) | ||
1087 | { | ||
1088 | struct sh_mobile_lcdc_chan *ch = info->par; | ||
1089 | unsigned long ldintr; | ||
1090 | int ret; | ||
1091 | |||
1092 | /* Enable VSync End interrupt and be careful not to acknowledge any | ||
1093 | * pending interrupt. | ||
1094 | */ | ||
1095 | ldintr = lcdc_read(ch->lcdc, _LDINTR); | ||
1096 | ldintr |= LDINTR_VEE | LDINTR_STATUS_MASK; | ||
1097 | lcdc_write(ch->lcdc, _LDINTR, ldintr); | ||
1098 | |||
1099 | ret = wait_for_completion_interruptible_timeout(&ch->vsync_completion, | ||
1100 | msecs_to_jiffies(100)); | ||
1101 | if (!ret) | ||
1102 | return -ETIMEDOUT; | ||
1103 | |||
1104 | return 0; | ||
1105 | } | ||
1106 | |||
1107 | static int sh_mobile_ioctl(struct fb_info *info, unsigned int cmd, | 1106 | static int sh_mobile_ioctl(struct fb_info *info, unsigned int cmd, |
1108 | unsigned long arg) | 1107 | unsigned long arg) |
1109 | { | 1108 | { |
@@ -1111,7 +1110,7 @@ static int sh_mobile_ioctl(struct fb_info *info, unsigned int cmd, | |||
1111 | 1110 | ||
1112 | switch (cmd) { | 1111 | switch (cmd) { |
1113 | case FBIO_WAITFORVSYNC: | 1112 | case FBIO_WAITFORVSYNC: |
1114 | retval = sh_mobile_wait_for_vsync(info); | 1113 | retval = sh_mobile_wait_for_vsync(info->par); |
1115 | break; | 1114 | break; |
1116 | 1115 | ||
1117 | default: | 1116 | default: |
@@ -1388,8 +1387,8 @@ static int sh_mobile_lcdc_blank(int blank, struct fb_info *info) | |||
1388 | * mode will reenable the clocks and update the screen in time, | 1387 | * mode will reenable the clocks and update the screen in time, |
1389 | * so it does not need this. */ | 1388 | * so it does not need this. */ |
1390 | if (!info->fbdefio) { | 1389 | if (!info->fbdefio) { |
1391 | sh_mobile_wait_for_vsync(info); | 1390 | sh_mobile_wait_for_vsync(ch); |
1392 | sh_mobile_wait_for_vsync(info); | 1391 | sh_mobile_wait_for_vsync(ch); |
1393 | } | 1392 | } |
1394 | sh_mobile_lcdc_clk_off(p); | 1393 | sh_mobile_lcdc_clk_off(p); |
1395 | } | 1394 | } |