Commit 95a83824 authored by Michel Ludwig's avatar Michel Ludwig Committed by Mauro Carvalho Chehab

V4L/DVB (12782): tm6000: Correct some device capabilities

Add tuner reset GPIO and demodulator address fields to the tm6000_core
struct.
Signed-off-by: default avatarMichel Ludwig <michel.ludwig@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent c85cba3f
...@@ -34,11 +34,10 @@ ...@@ -34,11 +34,10 @@
#define TM5600_BOARD_GENERIC 1 #define TM5600_BOARD_GENERIC 1
#define TM6000_BOARD_GENERIC 2 #define TM6000_BOARD_GENERIC 2
#define TM5600_BOARD_10MOONS_UT821 3 #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_ADSTECH_DUAL_TV 5
#define TM6000_BOARD_FREECOM_AND_SIMILAR 6 #define TM6000_BOARD_FREECOM_AND_SIMILAR 6
#define TM6000_MAXBOARDS 16 #define TM6000_MAXBOARDS 16
static unsigned int card[] = {[0 ... (TM6000_MAXBOARDS - 1)] = UNSET }; static unsigned int card[] = {[0 ... (TM6000_MAXBOARDS - 1)] = UNSET };
...@@ -52,8 +51,8 @@ struct tm6000_board { ...@@ -52,8 +51,8 @@ struct tm6000_board {
int tuner_type; /* type of the tuner */ int tuner_type; /* type of the tuner */
int tuner_addr; /* tuner address */ int tuner_addr; /* tuner address */
int demod_addr; /* demodulator address */
int gpio_addr_tun_reset; /* GPIO used for reset tuner */ int gpio_addr_tun_reset; /* GPIO used for tuner reset */
}; };
...@@ -94,17 +93,16 @@ struct tm6000_board tm6000_boards[] = { ...@@ -94,17 +93,16 @@ struct tm6000_board tm6000_boards[] = {
}, },
.gpio_addr_tun_reset = TM6000_GPIO_1, .gpio_addr_tun_reset = TM6000_GPIO_1,
}, },
[TM6000_BOARD_10MOONS_UT330] = { [TM5600_BOARD_10MOONS_UT330] = {
.name = "10Moons UT 330", .name = "10Moons UT 330",
.tuner_type = TUNER_XC2028, .tuner_type = TUNER_PHILIPS_FQ1216AME_MK4,
.tuner_addr = 0xc8, .tuner_addr = 0xc8,
.caps = { .caps = {
.has_tuner = 1, .has_tuner = 1,
.has_dvb = 1, .has_dvb = 0,
.has_zl10353 = 1, .has_zl10353 = 0,
.has_eeprom = 1, .has_eeprom = 1,
}, },
.gpio_addr_tun_reset = TM6000_GPIO_4,
}, },
[TM6000_BOARD_ADSTECH_DUAL_TV] = { [TM6000_BOARD_ADSTECH_DUAL_TV] = {
.name = "ADSTECH Dual TV USB", .name = "ADSTECH Dual TV USB",
...@@ -122,14 +120,15 @@ struct tm6000_board tm6000_boards[] = { ...@@ -122,14 +120,15 @@ struct tm6000_board tm6000_boards[] = {
.name = "Freecom Hybrid Stick / Moka DVB-T Receiver Dual", .name = "Freecom Hybrid Stick / Moka DVB-T Receiver Dual",
.tuner_type = TUNER_XC2028, .tuner_type = TUNER_XC2028,
.tuner_addr = 0xc2, .tuner_addr = 0xc2,
.demod_addr = 0x1e,
.caps = { .caps = {
.has_tuner = 1, .has_tuner = 1,
.has_dvb = 1, .has_dvb = 1,
.has_zl10353 = 1, .has_zl10353 = 1,
.has_eeprom = 0, .has_eeprom = 0,
}, },
.gpio_addr_tun_reset = TM6000_GPIO_4,
}, },
}; };
/* table of devices that work with this driver */ /* table of devices that work with this driver */
...@@ -152,6 +151,9 @@ static int tm6000_init_dev(struct tm6000_core *dev) ...@@ -152,6 +151,9 @@ static int tm6000_init_dev(struct tm6000_core *dev)
/* Initializa board-specific data */ /* Initializa board-specific data */
dev->tuner_type = tm6000_boards[dev->model].tuner_type; dev->tuner_type = tm6000_boards[dev->model].tuner_type;
dev->tuner_addr = tm6000_boards[dev->model].tuner_addr; 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; dev->caps = tm6000_boards[dev->model].caps;
......
...@@ -46,6 +46,10 @@ ...@@ -46,6 +46,10 @@
#define BUFFER_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ #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 */ /* Declare static vars that will be used as parameters */
static unsigned int vid_limit = 16; /* Video memory limit, in Mb */ static unsigned int vid_limit = 16; /* Video memory limit, in Mb */
static int video_nr = -1; /* /dev/videoN, -1 for autodetect */ static int video_nr = -1; /* /dev/videoN, -1 for autodetect */
...@@ -696,6 +700,7 @@ static void tm6000_vid_timeout(unsigned long data) ...@@ -696,6 +700,7 @@ static void tm6000_vid_timeout(unsigned long data)
/* ------------------------------------------------------------------ /* ------------------------------------------------------------------
Videobuf operations Videobuf operations
------------------------------------------------------------------*/ ------------------------------------------------------------------*/
static int static int
buffer_setup(struct videobuf_queue *vq, unsigned int *count, unsigned int *size) 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) ...@@ -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; *size = fh->fmt->depth * fh->width * fh->height >> 3;
if (0 == *count) 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) while (*size * *count > vid_limit * 1024 * 1024)
(*count)--; (*count)--;
return 0; return 0;
} }
......
...@@ -110,8 +110,12 @@ struct tm6000_core { ...@@ -110,8 +110,12 @@ struct tm6000_core {
struct tm6000_capabilities caps; struct tm6000_capabilities caps;
/* Tuner configuration */ /* Tuner configuration */
int tuner_type; /* type of the tuner */ int tuner_type; /* type of the tuner */
int tuner_addr; /* tuner address */ int tuner_addr; /* tuner address */
int tuner_reset_gpio; /* GPIO used for tuner reset */
/* Demodulator configuration */
int demod_addr; /* demodulator address */
/* i2c i/o */ /* i2c i/o */
struct i2c_adapter i2c_adap; struct i2c_adapter i2c_adap;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment