]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
V4L/DVB (12782): tm6000: Correct some device capabilities
authorMichel Ludwig <michel.ludwig@gmail.com>
Tue, 24 Jul 2007 11:06:45 +0000 (08:06 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 18 May 2010 03:39:33 +0000 (00:39 -0300)
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>
drivers/staging/tm6000/tm6000-cards.c
drivers/staging/tm6000/tm6000-video.c
drivers/staging/tm6000/tm6000.h

index a10c9efd633ed912361a8f6a124f291c03da9d7e..e8f88ea5ded9952f2fb0e988b4adcb30f5b8ceda 100644 (file)
 #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 };
 
@@ -52,8 +51,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 */
 };
 
 
@@ -94,17 +93,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",
@@ -122,14 +120,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 */
@@ -152,6 +151,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;
 
index df3d835ce750f638dd584b694f24b280f71cbd90..d8e9f2714969a52d259bd7c2b591ac5ad59606ca 100644 (file)
 
 #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;
 }
 
index e8ae81d236b984d61f74c1fdcfa1f42e38e952f1..27bee627d3b7de4831dae25da66b82a24dc8bc2f 100644 (file)
@@ -110,8 +110,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;