aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2008-06-25 05:00:17 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-07-20 06:12:14 -0400
commit36ecd4955a5ebee6135e2bcc997712fad4ac9b69 (patch)
tree5dc74287b93145aa2cb20d051d057634c17435a2 /drivers/media
parent1d0a436256dc1aecfad901bcd4432dac1cabe6b2 (diff)
V4L/DVB (8111): ivtv/cx18: fix compile error when CONFIG_VIDEO_ADV_DEBUG is not defined.
Thanks to Randy Dunlap for reporting this. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/cx18/cx18-ioctl.c42
-rw-r--r--drivers/media/video/ivtv/ivtv-ioctl.c59
2 files changed, 54 insertions, 47 deletions
diff --git a/drivers/media/video/cx18/cx18-ioctl.c b/drivers/media/video/cx18/cx18-ioctl.c
index 7231f60a180b..017b13efc072 100644
--- a/drivers/media/video/cx18/cx18-ioctl.c
+++ b/drivers/media/video/cx18/cx18-ioctl.c
@@ -113,25 +113,6 @@ u16 cx18_get_service_set(struct v4l2_sliced_vbi_format *fmt)
113 return set; 113 return set;
114} 114}
115 115
116static int cx18_cxc(struct cx18 *cx, unsigned int cmd, void *arg)
117{
118 struct v4l2_register *regs = arg;
119 unsigned long flags;
120
121 if (!capable(CAP_SYS_ADMIN))
122 return -EPERM;
123 if (regs->reg >= CX18_MEM_OFFSET + CX18_MEM_SIZE)
124 return -EINVAL;
125
126 spin_lock_irqsave(&cx18_cards_lock, flags);
127 if (cmd == VIDIOC_DBG_G_REGISTER)
128 regs->val = read_enc(regs->reg);
129 else
130 write_enc(regs->val, regs->reg);
131 spin_unlock_irqrestore(&cx18_cards_lock, flags);
132 return 0;
133}
134
135static int cx18_g_fmt_vid_cap(struct file *file, void *fh, 116static int cx18_g_fmt_vid_cap(struct file *file, void *fh,
136 struct v4l2_format *fmt) 117 struct v4l2_format *fmt)
137{ 118{
@@ -292,6 +273,26 @@ static int cx18_g_chip_ident(struct file *file, void *fh,
292 return -EINVAL; 273 return -EINVAL;
293} 274}
294 275
276#ifdef CONFIG_VIDEO_ADV_DEBUG
277static int cx18_cxc(struct cx18 *cx, unsigned int cmd, void *arg)
278{
279 struct v4l2_register *regs = arg;
280 unsigned long flags;
281
282 if (!capable(CAP_SYS_ADMIN))
283 return -EPERM;
284 if (regs->reg >= CX18_MEM_OFFSET + CX18_MEM_SIZE)
285 return -EINVAL;
286
287 spin_lock_irqsave(&cx18_cards_lock, flags);
288 if (cmd == VIDIOC_DBG_G_REGISTER)
289 regs->val = read_enc(regs->reg);
290 else
291 write_enc(regs->val, regs->reg);
292 spin_unlock_irqrestore(&cx18_cards_lock, flags);
293 return 0;
294}
295
295static int cx18_g_register(struct file *file, void *fh, 296static int cx18_g_register(struct file *file, void *fh,
296 struct v4l2_register *reg) 297 struct v4l2_register *reg)
297{ 298{
@@ -319,6 +320,7 @@ static int cx18_s_register(struct file *file, void *fh,
319 return cx18_call_i2c_client(cx, reg->match_chip, VIDIOC_DBG_S_REGISTER, 320 return cx18_call_i2c_client(cx, reg->match_chip, VIDIOC_DBG_S_REGISTER,
320 reg); 321 reg);
321} 322}
323#endif
322 324
323static int cx18_g_priority(struct file *file, void *fh, enum v4l2_priority *p) 325static int cx18_g_priority(struct file *file, void *fh, enum v4l2_priority *p)
324{ 326{
@@ -810,8 +812,10 @@ void cx18_set_funcs(struct video_device *vdev)
810 vdev->vidioc_try_fmt_sliced_vbi_cap = cx18_try_fmt_sliced_vbi_cap; 812 vdev->vidioc_try_fmt_sliced_vbi_cap = cx18_try_fmt_sliced_vbi_cap;
811 vdev->vidioc_g_sliced_vbi_cap = cx18_g_sliced_vbi_cap; 813 vdev->vidioc_g_sliced_vbi_cap = cx18_g_sliced_vbi_cap;
812 vdev->vidioc_g_chip_ident = cx18_g_chip_ident; 814 vdev->vidioc_g_chip_ident = cx18_g_chip_ident;
815#ifdef CONFIG_VIDEO_ADV_DEBUG
813 vdev->vidioc_g_register = cx18_g_register; 816 vdev->vidioc_g_register = cx18_g_register;
814 vdev->vidioc_s_register = cx18_s_register; 817 vdev->vidioc_s_register = cx18_s_register;
818#endif
815 vdev->vidioc_default = cx18_default; 819 vdev->vidioc_default = cx18_default;
816 vdev->vidioc_queryctrl = cx18_queryctrl; 820 vdev->vidioc_queryctrl = cx18_queryctrl;
817 vdev->vidioc_querymenu = cx18_querymenu; 821 vdev->vidioc_querymenu = cx18_querymenu;
diff --git a/drivers/media/video/ivtv/ivtv-ioctl.c b/drivers/media/video/ivtv/ivtv-ioctl.c
index 8d602cb6ba68..42443b42336d 100644
--- a/drivers/media/video/ivtv/ivtv-ioctl.c
+++ b/drivers/media/video/ivtv/ivtv-ioctl.c
@@ -314,34 +314,6 @@ static int ivtv_video_command(struct ivtv *itv, struct ivtv_open_id *id,
314 return 0; 314 return 0;
315} 315}
316 316
317static int ivtv_itvc(struct ivtv *itv, unsigned int cmd, void *arg)
318{
319 struct v4l2_register *regs = arg;
320 unsigned long flags;
321 volatile u8 __iomem *reg_start;
322
323 if (!capable(CAP_SYS_ADMIN))
324 return -EPERM;
325 if (regs->reg >= IVTV_REG_OFFSET && regs->reg < IVTV_REG_OFFSET + IVTV_REG_SIZE)
326 reg_start = itv->reg_mem - IVTV_REG_OFFSET;
327 else if (itv->has_cx23415 && regs->reg >= IVTV_DECODER_OFFSET &&
328 regs->reg < IVTV_DECODER_OFFSET + IVTV_DECODER_SIZE)
329 reg_start = itv->dec_mem - IVTV_DECODER_OFFSET;
330 else if (regs->reg >= 0 && regs->reg < IVTV_ENCODER_SIZE)
331 reg_start = itv->enc_mem;
332 else
333 return -EINVAL;
334
335 spin_lock_irqsave(&ivtv_cards_lock, flags);
336 if (cmd == VIDIOC_DBG_G_REGISTER) {
337 regs->val = readl(regs->reg + reg_start);
338 } else {
339 writel(regs->val, regs->reg + reg_start);
340 }
341 spin_unlock_irqrestore(&ivtv_cards_lock, flags);
342 return 0;
343}
344
345static int ivtv_g_fmt_sliced_vbi_out(struct file *file, void *fh, struct v4l2_format *fmt) 317static int ivtv_g_fmt_sliced_vbi_out(struct file *file, void *fh, struct v4l2_format *fmt)
346{ 318{
347 struct ivtv *itv = ((struct ivtv_open_id *)fh)->itv; 319 struct ivtv *itv = ((struct ivtv_open_id *)fh)->itv;
@@ -715,6 +687,34 @@ static int ivtv_g_chip_ident(struct file *file, void *fh, struct v4l2_chip_ident
715 return -EINVAL; 687 return -EINVAL;
716} 688}
717 689
690#ifdef CONFIG_VIDEO_ADV_DEBUG
691static int ivtv_itvc(struct ivtv *itv, unsigned int cmd, void *arg)
692{
693 struct v4l2_register *regs = arg;
694 unsigned long flags;
695 u8 __iomem *reg_start;
696
697 if (!capable(CAP_SYS_ADMIN))
698 return -EPERM;
699 if (regs->reg >= IVTV_REG_OFFSET && regs->reg < IVTV_REG_OFFSET + IVTV_REG_SIZE)
700 reg_start = itv->reg_mem - IVTV_REG_OFFSET;
701 else if (itv->has_cx23415 && regs->reg >= IVTV_DECODER_OFFSET &&
702 regs->reg < IVTV_DECODER_OFFSET + IVTV_DECODER_SIZE)
703 reg_start = itv->dec_mem - IVTV_DECODER_OFFSET;
704 else if (regs->reg >= 0 && regs->reg < IVTV_ENCODER_SIZE)
705 reg_start = itv->enc_mem;
706 else
707 return -EINVAL;
708
709 spin_lock_irqsave(&ivtv_cards_lock, flags);
710 if (cmd == VIDIOC_DBG_G_REGISTER)
711 regs->val = readl(regs->reg + reg_start);
712 else
713 writel(regs->val, regs->reg + reg_start);
714 spin_unlock_irqrestore(&ivtv_cards_lock, flags);
715 return 0;
716}
717
718static int ivtv_g_register(struct file *file, void *fh, struct v4l2_register *reg) 718static int ivtv_g_register(struct file *file, void *fh, struct v4l2_register *reg)
719{ 719{
720 struct ivtv *itv = ((struct ivtv_open_id *)fh)->itv; 720 struct ivtv *itv = ((struct ivtv_open_id *)fh)->itv;
@@ -736,6 +736,7 @@ static int ivtv_s_register(struct file *file, void *fh, struct v4l2_register *re
736 return ivtv_i2c_id(itv, reg->match_chip, VIDIOC_DBG_S_REGISTER, reg); 736 return ivtv_i2c_id(itv, reg->match_chip, VIDIOC_DBG_S_REGISTER, reg);
737 return ivtv_call_i2c_client(itv, reg->match_chip, VIDIOC_DBG_S_REGISTER, reg); 737 return ivtv_call_i2c_client(itv, reg->match_chip, VIDIOC_DBG_S_REGISTER, reg);
738} 738}
739#endif
739 740
740static int ivtv_g_priority(struct file *file, void *fh, enum v4l2_priority *p) 741static int ivtv_g_priority(struct file *file, void *fh, enum v4l2_priority *p)
741{ 742{
@@ -1896,8 +1897,10 @@ void ivtv_set_funcs(struct video_device *vdev)
1896 vdev->vidioc_try_fmt_sliced_vbi_out = ivtv_try_fmt_sliced_vbi_out; 1897 vdev->vidioc_try_fmt_sliced_vbi_out = ivtv_try_fmt_sliced_vbi_out;
1897 vdev->vidioc_g_sliced_vbi_cap = ivtv_g_sliced_vbi_cap; 1898 vdev->vidioc_g_sliced_vbi_cap = ivtv_g_sliced_vbi_cap;
1898 vdev->vidioc_g_chip_ident = ivtv_g_chip_ident; 1899 vdev->vidioc_g_chip_ident = ivtv_g_chip_ident;
1900#ifdef CONFIG_VIDEO_ADV_DEBUG
1899 vdev->vidioc_g_register = ivtv_g_register; 1901 vdev->vidioc_g_register = ivtv_g_register;
1900 vdev->vidioc_s_register = ivtv_s_register; 1902 vdev->vidioc_s_register = ivtv_s_register;
1903#endif
1901 vdev->vidioc_default = ivtv_default; 1904 vdev->vidioc_default = ivtv_default;
1902 vdev->vidioc_queryctrl = ivtv_queryctrl; 1905 vdev->vidioc_queryctrl = ivtv_queryctrl;
1903 vdev->vidioc_querymenu = ivtv_querymenu; 1906 vdev->vidioc_querymenu = ivtv_querymenu;