diff options
Diffstat (limited to 'linux/drivers/media/common/saa7146_video.c')
-rw-r--r-- | linux/drivers/media/common/saa7146_video.c | 72 |
1 files changed, 35 insertions, 37 deletions
diff --git a/linux/drivers/media/common/saa7146_video.c b/linux/drivers/media/common/saa7146_video.c index cf3feda3f..c0c01e2bd 100644 --- a/linux/drivers/media/common/saa7146_video.c +++ b/linux/drivers/media/common/saa7146_video.c @@ -3,14 +3,14 @@ #define KBUILD_MODNAME saa7146 #endif +static int memory = 32; -#ifdef MODULE MODULE_PARM(memory,"i"); MODULE_PARM_DESC(memory, "maximum memory usage for capture buffers (default: 32Mb)"); -#endif /* format descriptions for capture and preview */ +static struct saa7146_format formats[] = { {"RGB-8 (3-3-2)", V4L2_PIX_FMT_RGB332, RGB08_COMPOSED, 8, 0}, @@ -28,6 +28,7 @@ struct saa7146_format formats[] = }; /* this is only true for saa7146a. for the saa7146 (without "a") this is NUM_CAPPVFMT-1 */ +static int NUM_FORMATS = sizeof(formats)/sizeof(struct saa7146_format); struct saa7146_format* format_by_fourcc(struct saa7146_dev *dev, int fourcc) @@ -48,7 +49,8 @@ struct saa7146_format* format_by_fourcc(struct saa7146_dev *dev, int fourcc) return NULL; } -static int g_fmt(struct saa7146_fh *fh, struct v4l2_format *f) +static +int g_fmt(struct saa7146_fh *fh, struct v4l2_format *f) { struct saa7146_dev *dev = fh->dev; DEB_EE(("dev:%p, fh:%p\n",dev,fh)); @@ -75,7 +77,8 @@ static int g_fmt(struct saa7146_fh *fh, struct v4l2_format *f) } } -static int try_win(struct saa7146_dev *dev, struct v4l2_window *win) +static +int try_win(struct saa7146_dev *dev, struct v4l2_window *win) { enum v4l2_field field; int maxw, maxh; @@ -130,7 +133,8 @@ static int try_win(struct saa7146_dev *dev, struct v4l2_window *win) return 0; } -static int try_fmt(struct saa7146_fh *fh, struct v4l2_format *f) +static +int try_fmt(struct saa7146_fh *fh, struct v4l2_format *f) { struct saa7146_dev *dev = fh->dev; int err; @@ -193,7 +197,8 @@ static int try_fmt(struct saa7146_fh *fh, struct v4l2_format *f) } } -static int start_preview(struct saa7146_fh *fh) +static +int start_preview(struct saa7146_fh *fh) { struct saa7146_dev *dev = fh->dev; int err = 0; @@ -238,7 +243,8 @@ static int start_preview(struct saa7146_fh *fh) return 0; } -static int stop_preview(struct saa7146_fh *fh) +static +int stop_preview(struct saa7146_fh *fh) { struct saa7146_dev *dev = fh->dev; DEB_EE(("saa7146.o: stop_preview()\n")); @@ -260,7 +266,8 @@ static int stop_preview(struct saa7146_fh *fh) return 0; } -static int s_fmt(struct saa7146_fh *fh, struct v4l2_format *f) +static +int s_fmt(struct saa7146_fh *fh, struct v4l2_format *f) { struct saa7146_dev *dev = fh->dev; @@ -318,7 +325,8 @@ static int s_fmt(struct saa7146_fh *fh, struct v4l2_format *f) /********************************************************************************/ /* device controls */ -static struct v4l2_queryctrl controls[] = { +static +struct v4l2_queryctrl controls[] = { { id: V4L2_CID_BRIGHTNESS, name: "Brightness", @@ -357,11 +365,13 @@ static struct v4l2_queryctrl controls[] = { type: V4L2_CTRL_TYPE_BOOLEAN, }, }; -static int NUM_CONTROLS = sizeof(controls)/sizeof(struct v4l2_queryctrl); +static +int NUM_CONTROLS = sizeof(controls)/sizeof(struct v4l2_queryctrl); #define V4L2_CID_PRIVATE_LASTP1 (V4L2_CID_PRIVATE_BASE + 0) -static struct v4l2_queryctrl* ctrl_by_id(int id) +static +struct v4l2_queryctrl* ctrl_by_id(int id) { int i; @@ -371,7 +381,8 @@ static struct v4l2_queryctrl* ctrl_by_id(int id) return NULL; } -static int get_control(struct saa7146_fh *fh, struct v4l2_control *c) +static +int get_control(struct saa7146_fh *fh, struct v4l2_control *c) { struct saa7146_dev *dev = fh->dev; const struct v4l2_queryctrl* ctrl; @@ -406,7 +417,8 @@ static int get_control(struct saa7146_fh *fh, struct v4l2_control *c) return 0; } -static int set_control(struct saa7146_fh *fh, struct v4l2_control *c) +static +int set_control(struct saa7146_fh *fh, struct v4l2_control *c) { struct saa7146_dev *dev = fh->dev; const struct v4l2_queryctrl* ctrl; @@ -494,6 +506,7 @@ static int set_control(struct saa7146_fh *fh, struct v4l2_control *c) /********************************************************************************/ /* common pagetable functions */ +static int saa7146_pgtable_build(struct saa7146_dev *dev, struct saa7146_buf *buf) { struct pci_dev *pci = dev->pci; @@ -593,6 +606,7 @@ int saa7146_pgtable_build(struct saa7146_dev *dev, struct saa7146_buf *buf) /********************************************************************************/ /* file operations */ +static int video_begin(struct saa7146_fh *fh) { struct saa7146_dev *dev = fh->dev; @@ -625,6 +639,7 @@ int video_begin(struct saa7146_fh *fh) return 0; } +static int video_end(struct saa7146_fh *fh) { struct saa7146_dev *dev = fh->dev; @@ -1032,27 +1047,6 @@ int video_do_ioctl(struct inode *inode, struct file *file, video_do_ioctl); } return 0; -#ifdef axa - not supfhrted: - VIDIOC_RESERVED - VIDIOC_S_PARM - VIDIOC_G_OUTPUT - VIDIOC_S_OUTPUT - VIDIOC_CROPCAP - VIDIOC_G_CROP - VIDIOC_S_CROP - VIDIOC_G_JPEGCOMP - VIDIOC_S_JPEGCOMP - VIDIOC_ENUMOUTPUT - VIDIOC_G_AUDOUT - VIDIOC_S_AUDOUT - - VIDIOC_QUERYMENU - VIDIOC_G_MODULATOR - VIDIOC_S_MODULATOR - VIDIOC_QUERYSTD - /* --- control ioctls ---------------------------------------- */ -#endif } @@ -1151,8 +1145,9 @@ static int buffer_setup(struct file *file, int *count, int *size) { struct saa7146_fh *fh = file->private_data; +/* struct saa7146_dev *dev = fh->dev; - +*/ if (0 == *count || *count > MAX_SAA7146_CAPTURE_BUFFERS) *count = MAX_SAA7146_CAPTURE_BUFFERS; @@ -1172,7 +1167,9 @@ static void buffer_queue(struct file *file, struct videobuf_buffer *vb) { struct saa7146_fh *fh = file->private_data; +/* struct saa7146_dev *dev = fh->dev; +*/ struct saa7146_buf *buf = (struct saa7146_buf *)vb; DEB_CAP(("vbuf:%p\n",vb)); @@ -1191,7 +1188,8 @@ void buffer_release(struct file *file, struct videobuf_buffer *vb) saa7146_dma_free(dev,buf); } -static struct videobuf_queue_ops video_qops = { +static +struct videobuf_queue_ops video_qops = { .buf_setup = buffer_setup, .buf_prepare = buffer_prepare, .buf_queue = buffer_queue, @@ -1281,7 +1279,7 @@ void video_irq_done(struct saa7146_dev *dev, unsigned long st) static -static ssize_t video_read(struct file *file, char *data, size_t count, loff_t *ppos) +ssize_t video_read(struct file *file, char *data, size_t count, loff_t *ppos) { struct saa7146_fh *fh = file->private_data; struct saa7146_dev *dev = fh->dev; |