diff options
author | Michel Ludwig <michel.ludwig@gmail.com> | 2007-07-24 08:06:45 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-05-18 00:39:33 -0300 |
commit | 95a838243b906e096275b179d4e7302f282c990e (patch) | |
tree | c80de4e813d517ddf522c86b213ee3aa0e256761 /drivers/staging/tm6000/tm6000-video.c | |
parent | c85cba3fe6d44b3955a4c2e19efb7bb8156cab5d (diff) | |
download | op-kernel-dev-95a838243b906e096275b179d4e7302f282c990e.zip op-kernel-dev-95a838243b906e096275b179d4e7302f282c990e.tar.gz |
V4L/DVB (12782): tm6000: Correct some device capabilities
Add tuner reset GPIO and demodulator address fields to the tm6000_core
struct.
Signed-off-by: Michel Ludwig <michel.ludwig@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/staging/tm6000/tm6000-video.c')
-rw-r--r-- | drivers/staging/tm6000/tm6000-video.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/staging/tm6000/tm6000-video.c b/drivers/staging/tm6000/tm6000-video.c index df3d835..d8e9f27 100644 --- a/drivers/staging/tm6000/tm6000-video.c +++ b/drivers/staging/tm6000/tm6000-video.c @@ -46,6 +46,10 @@ #define BUFFER_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ +/* Limits minimum and default number of buffers */ +#define TM6000_MIN_BUF 4 +#define TM6000_DEF_BUF 8 + /* Declare static vars that will be used as parameters */ static unsigned int vid_limit = 16; /* Video memory limit, in Mb */ static int video_nr = -1; /* /dev/videoN, -1 for autodetect */ @@ -696,6 +700,7 @@ static void tm6000_vid_timeout(unsigned long data) /* ------------------------------------------------------------------ Videobuf operations ------------------------------------------------------------------*/ + static int buffer_setup(struct videobuf_queue *vq, unsigned int *count, unsigned int *size) { @@ -703,9 +708,17 @@ buffer_setup(struct videobuf_queue *vq, unsigned int *count, unsigned int *size) *size = fh->fmt->depth * fh->width * fh->height >> 3; if (0 == *count) - *count = 32; + *count = TM6000_DEF_BUF; + + if (*count < TM6000_MIN_BUF) { + *count=TM6000_MIN_BUF; + } + +printk("Requesting %d buffers\n",*count); + while (*size * *count > vid_limit * 1024 * 1024) (*count)--; + return 0; } |