summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2007-07-24 08:06:45 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2007-07-24 08:06:45 -0300
commit655d54939829b1914fc85735261b5d23e533056b (patch)
treea3aef979bae598b25b8631a14f2ddd2b862f496a
parentfded0a08938fda19fa170c8cf5c4a92a163915bd (diff)
downloadmediapointer-dvb-s2-655d54939829b1914fc85735261b5d23e533056b.tar.gz
mediapointer-dvb-s2-655d54939829b1914fc85735261b5d23e533056b.tar.bz2
tm6000: Correct some device capabilities.
From: Michel Ludwig <michel.ludwig@gmail.com> 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>
-rw-r--r--linux/drivers/staging/tm6000/tm6000-cards.c22
-rw-r--r--linux/drivers/staging/tm6000/tm6000-video.c15
-rw-r--r--linux/drivers/staging/tm6000/tm6000.h8
3 files changed, 32 insertions, 13 deletions
diff --git a/linux/drivers/staging/tm6000/tm6000-cards.c b/linux/drivers/staging/tm6000/tm6000-cards.c
index 1ec54f89a..fe1755781 100644
--- a/linux/drivers/staging/tm6000/tm6000-cards.c
+++ b/linux/drivers/staging/tm6000/tm6000-cards.c
@@ -35,11 +35,10 @@
#define TM5600_BOARD_GENERIC 1
#define TM6000_BOARD_GENERIC 2
#define TM5600_BOARD_10MOONS_UT821 3
-#define TM6000_BOARD_10MOONS_UT330 4
+#define TM5600_BOARD_10MOONS_UT330 4
#define TM6000_BOARD_ADSTECH_DUAL_TV 5
#define TM6000_BOARD_FREECOM_AND_SIMILAR 6
-
#define TM6000_MAXBOARDS 16
static unsigned int card[] = {[0 ... (TM6000_MAXBOARDS - 1)] = UNSET };
@@ -64,8 +63,8 @@ struct tm6000_board {
int tuner_type; /* type of the tuner */
int tuner_addr; /* tuner address */
-
- int gpio_addr_tun_reset; /* GPIO used for reset tuner */
+ int demod_addr; /* demodulator address */
+ int gpio_addr_tun_reset; /* GPIO used for tuner reset */
#if 0
struct tm6000_input input[MAX_TM6000_INPUT];
#endif
@@ -109,17 +108,16 @@ struct tm6000_board tm6000_boards[] = {
},
.gpio_addr_tun_reset = TM6000_GPIO_1,
},
- [TM6000_BOARD_10MOONS_UT330] = {
+ [TM5600_BOARD_10MOONS_UT330] = {
.name = "10Moons UT 330",
- .tuner_type = TUNER_XC2028,
+ .tuner_type = TUNER_PHILIPS_FQ1216AME_MK4,
.tuner_addr = 0xc8,
.caps = {
.has_tuner = 1,
- .has_dvb = 1,
- .has_zl10353 = 1,
+ .has_dvb = 0,
+ .has_zl10353 = 0,
.has_eeprom = 1,
},
- .gpio_addr_tun_reset = TM6000_GPIO_4,
},
[TM6000_BOARD_ADSTECH_DUAL_TV] = {
.name = "ADSTECH Dual TV USB",
@@ -137,14 +135,15 @@ struct tm6000_board tm6000_boards[] = {
.name = "Freecom Hybrid Stick / Moka DVB-T Receiver Dual",
.tuner_type = TUNER_XC2028,
.tuner_addr = 0xc2,
+ .demod_addr = 0x1e,
.caps = {
.has_tuner = 1,
.has_dvb = 1,
.has_zl10353 = 1,
.has_eeprom = 0,
},
+ .gpio_addr_tun_reset = TM6000_GPIO_4,
},
-
};
/* table of devices that work with this driver */
@@ -167,6 +166,9 @@ static int tm6000_init_dev(struct tm6000_core *dev)
/* Initializa board-specific data */
dev->tuner_type = tm6000_boards[dev->model].tuner_type;
dev->tuner_addr = tm6000_boards[dev->model].tuner_addr;
+ dev->tuner_reset_gpio = tm6000_boards[dev->model].gpio_addr_tun_reset;
+
+ dev->demod_addr = tm6000_boards[dev->model].demod_addr;
dev->caps = tm6000_boards[dev->model].caps;
diff --git a/linux/drivers/staging/tm6000/tm6000-video.c b/linux/drivers/staging/tm6000/tm6000-video.c
index e167e973b..b1263d269 100644
--- a/linux/drivers/staging/tm6000/tm6000-video.c
+++ b/linux/drivers/staging/tm6000/tm6000-video.c
@@ -51,6 +51,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 */
@@ -742,6 +746,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)
{
@@ -749,9 +754,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;
}
diff --git a/linux/drivers/staging/tm6000/tm6000.h b/linux/drivers/staging/tm6000/tm6000.h
index 97ba71482..57ae490df 100644
--- a/linux/drivers/staging/tm6000/tm6000.h
+++ b/linux/drivers/staging/tm6000/tm6000.h
@@ -119,8 +119,12 @@ struct tm6000_core {
struct tm6000_capabilities caps;
/* Tuner configuration */
- int tuner_type; /* type of the tuner */
- int tuner_addr; /* tuner address */
+ int tuner_type; /* type of the tuner */
+ int tuner_addr; /* tuner address */
+ int tuner_reset_gpio; /* GPIO used for tuner reset */
+
+ /* Demodulator configuration */
+ int demod_addr; /* demodulator address */
/* i2c i/o */
struct i2c_adapter i2c_adap;