aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Walls <awalls@radix.net>2010-03-13 18:37:25 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-05-17 23:47:15 -0400
commit4e1af31aaaa8cc4a5cc1d894bdf04dfc7450d47f (patch)
tree08f18d52d39f390958e8638dff4123eac7ec8cf8
parent2443baeaa01388f56824c55c087510312b8d8197 (diff)
V4L/DVB: ivtv, ivtvfb: Use a define for the output line and field register address
Get rid of the magic number 0x28c0 used in several places in the ivtv and ivtvfb driver and define the register address to a meaningful name. Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/video/ivtv/ivtv-driver.h3
-rw-r--r--drivers/media/video/ivtv/ivtv-ioctl.c2
-rw-r--r--drivers/media/video/ivtv/ivtv-irq.c8
-rw-r--r--drivers/media/video/ivtv/ivtvfb.c2
4 files changed, 10 insertions, 5 deletions
diff --git a/drivers/media/video/ivtv/ivtv-driver.h b/drivers/media/video/ivtv/ivtv-driver.h
index 5028e31c564..851f07de529 100644
--- a/drivers/media/video/ivtv/ivtv-driver.h
+++ b/drivers/media/video/ivtv/ivtv-driver.h
@@ -116,6 +116,9 @@
116#define IVTV_REG_VPU (0x9058) 116#define IVTV_REG_VPU (0x9058)
117#define IVTV_REG_APU (0xA064) 117#define IVTV_REG_APU (0xA064)
118 118
119/* Other registers */
120#define IVTV_REG_DEC_LINE_FIELD (0x28C0)
121
119/* debugging */ 122/* debugging */
120extern int ivtv_debug; 123extern int ivtv_debug;
121 124
diff --git a/drivers/media/video/ivtv/ivtv-ioctl.c b/drivers/media/video/ivtv/ivtv-ioctl.c
index 2192bc42c6b..c29ff983d43 100644
--- a/drivers/media/video/ivtv/ivtv-ioctl.c
+++ b/drivers/media/video/ivtv/ivtv-ioctl.c
@@ -1140,7 +1140,7 @@ int ivtv_s_std(struct file *file, void *fh, v4l2_std_id *std)
1140 for (f = 0; f < 4; f++) { 1140 for (f = 0; f < 4; f++) {
1141 prepare_to_wait(&itv->vsync_waitq, &wait, 1141 prepare_to_wait(&itv->vsync_waitq, &wait,
1142 TASK_UNINTERRUPTIBLE); 1142 TASK_UNINTERRUPTIBLE);
1143 if ((read_reg(0x28c0) >> 16) < 100) 1143 if ((read_reg(IVTV_REG_DEC_LINE_FIELD) >> 16) < 100)
1144 break; 1144 break;
1145 schedule_timeout(msecs_to_jiffies(25)); 1145 schedule_timeout(msecs_to_jiffies(25));
1146 } 1146 }
diff --git a/drivers/media/video/ivtv/ivtv-irq.c b/drivers/media/video/ivtv/ivtv-irq.c
index 12d36ca91d5..dbd46c5d697 100644
--- a/drivers/media/video/ivtv/ivtv-irq.c
+++ b/drivers/media/video/ivtv/ivtv-irq.c
@@ -752,7 +752,7 @@ static void ivtv_irq_vsync(struct ivtv *itv)
752 * to determine the line being displayed and ensure we handle 752 * to determine the line being displayed and ensure we handle
753 * one vsync per frame. 753 * one vsync per frame.
754 */ 754 */
755 unsigned int frame = read_reg(0x28c0) & 1; 755 unsigned int frame = read_reg(IVTV_REG_DEC_LINE_FIELD) & 1;
756 struct yuv_playback_info *yi = &itv->yuv_info; 756 struct yuv_playback_info *yi = &itv->yuv_info;
757 int last_dma_frame = atomic_read(&yi->next_dma_frame); 757 int last_dma_frame = atomic_read(&yi->next_dma_frame);
758 struct yuv_frame_info *f = &yi->new_frame_info[last_dma_frame]; 758 struct yuv_frame_info *f = &yi->new_frame_info[last_dma_frame];
@@ -852,9 +852,11 @@ irqreturn_t ivtv_irq_handler(int irq, void *dev_id)
852 */ 852 */
853 if (~itv->irqmask & IVTV_IRQ_DEC_VSYNC) { 853 if (~itv->irqmask & IVTV_IRQ_DEC_VSYNC) {
854 /* vsync is enabled, see if we're in a new field */ 854 /* vsync is enabled, see if we're in a new field */
855 if ((itv->last_vsync_field & 1) != (read_reg(0x28c0) & 1)) { 855 if ((itv->last_vsync_field & 1) !=
856 (read_reg(IVTV_REG_DEC_LINE_FIELD) & 1)) {
856 /* New field, looks like we missed it */ 857 /* New field, looks like we missed it */
857 IVTV_DEBUG_YUV("VSync interrupt missed %d\n",read_reg(0x28c0)>>16); 858 IVTV_DEBUG_YUV("VSync interrupt missed %d\n",
859 read_reg(IVTV_REG_DEC_LINE_FIELD) >> 16);
858 vsync_force = 1; 860 vsync_force = 1;
859 } 861 }
860 } 862 }
diff --git a/drivers/media/video/ivtv/ivtvfb.c b/drivers/media/video/ivtv/ivtvfb.c
index de2ff1c6ac3..49e1a283ed3 100644
--- a/drivers/media/video/ivtv/ivtvfb.c
+++ b/drivers/media/video/ivtv/ivtvfb.c
@@ -460,7 +460,7 @@ static int ivtvfb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long ar
460 460
461 vblank.flags = FB_VBLANK_HAVE_COUNT |FB_VBLANK_HAVE_VCOUNT | 461 vblank.flags = FB_VBLANK_HAVE_COUNT |FB_VBLANK_HAVE_VCOUNT |
462 FB_VBLANK_HAVE_VSYNC; 462 FB_VBLANK_HAVE_VSYNC;
463 trace = read_reg(0x028c0) >> 16; 463 trace = read_reg(IVTV_REG_DEC_LINE_FIELD) >> 16;
464 if (itv->is_50hz && trace > 312) 464 if (itv->is_50hz && trace > 312)
465 trace -= 312; 465 trace -= 312;
466 else if (itv->is_60hz && trace > 262) 466 else if (itv->is_60hz && trace > 262)