summaryrefslogtreecommitdiff
path: root/linux/drivers/media
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2008-01-24 07:59:20 -0200
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-01-24 07:59:20 -0200
commit739286f8598c1606b5ce283e2afcacd8be8cb96a (patch)
treea6b9c2676af5193ea2dfe01c12a57b7c8debae84 /linux/drivers/media
parent96c8b3df2a0b219a58a0873511a8fb7b7f6cfd4f (diff)
downloadmediapointer-dvb-s2-739286f8598c1606b5ce283e2afcacd8be8cb96a.tar.gz
mediapointer-dvb-s2-739286f8598c1606b5ce283e2afcacd8be8cb96a.tar.bz2
em28xx: remove has_tuner
From: Mauro Carvalho Chehab <mchehab@infradead.org> has_tuner flag doesn't make much sense, since tuner_type=TUNER_ABSENT means the same thing. Having two ways to say that a tuner is not present is not nice, since it may lead to bad setups. In fact, with the previous code, if a device were using has_tuner=0, but the user forces a tuner, with modprobe option tuner=type, the modprobe option won't work. Also, tveeprom returns TUNER_ABSENT, when tuner is unknown or absent. So, with the previous logic, in this case, the driver should set has_tuner=0, or has_tuner=1 otherwise. Instead of adding several additional tests and setups, better just to remove .has_tuner. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux/drivers/media')
-rw-r--r--linux/drivers/media/video/em28xx/em28xx-cards.c29
-rw-r--r--linux/drivers/media/video/em28xx/em28xx-video.c5
-rw-r--r--linux/drivers/media/video/em28xx/em28xx.h2
3 files changed, 10 insertions, 26 deletions
diff --git a/linux/drivers/media/video/em28xx/em28xx-cards.c b/linux/drivers/media/video/em28xx/em28xx-cards.c
index 14f8fe91e..588e85dfa 100644
--- a/linux/drivers/media/video/em28xx/em28xx-cards.c
+++ b/linux/drivers/media/video/em28xx/em28xx-cards.c
@@ -79,7 +79,6 @@ struct em28xx_board em28xx_boards[] = {
.is_em2800 = 1,
.vchannels = 2,
.tda9887_conf = TDA9887_PRESENT,
- .has_tuner = 1,
.decoder = EM28XX_SAA7113,
.input = { {
.type = EM28XX_VMUX_COMPOSITE1,
@@ -94,13 +93,14 @@ struct em28xx_board em28xx_boards[] = {
[EM2820_BOARD_UNKNOWN] = {
.name = "Unknown EM2750/28xx video grabber",
.is_em2800 = 0,
+ .tuner_type = TUNER_ABSENT,
},
[EM2820_BOARD_KWORLD_PVRTV2800RF] = {
.name = "Kworld PVR TV 2800 RF",
.is_em2800 = 0,
.vchannels = 2,
+ .tuner_type = TUNER_TEMIC_PAL,
.tda9887_conf = TDA9887_PRESENT,
- .has_tuner = 1,
.decoder = EM28XX_SAA7113,
.input = { {
.type = EM28XX_VMUX_COMPOSITE1,
@@ -117,7 +117,6 @@ struct em28xx_board em28xx_boards[] = {
.vchannels = 3,
.tuner_type = TUNER_LG_PAL_NEW_TAPC,
.tda9887_conf = TDA9887_PRESENT,
- .has_tuner = 1,
.decoder = EM28XX_SAA7113,
.input = { {
.type = EM28XX_VMUX_TELEVISION,
@@ -138,7 +137,6 @@ struct em28xx_board em28xx_boards[] = {
.vchannels = 3,
.tuner_type = TUNER_LG_PAL_NEW_TAPC,
.tda9887_conf = TDA9887_PRESENT,
- .has_tuner = 1,
.decoder = EM28XX_SAA7113,
.input = { {
.type = EM28XX_VMUX_TELEVISION,
@@ -161,7 +159,6 @@ struct em28xx_board em28xx_boards[] = {
.tda9887_conf = TDA9887_PRESENT |
TDA9887_PORT1_ACTIVE|
TDA9887_PORT2_ACTIVE,
- .has_tuner = 1,
.decoder = EM28XX_TVP5150,
.has_msp34xx = 1,
/*FIXME: S-Video not tested */
@@ -181,7 +178,6 @@ struct em28xx_board em28xx_boards[] = {
.vchannels = 3,
.tda9887_conf = TDA9887_PRESENT,
.tuner_type = TUNER_XC2028,
- .has_tuner = 1,
.mts_firmware = 1,
.decoder = EM28XX_TVP5150,
.input = { {
@@ -203,7 +199,6 @@ struct em28xx_board em28xx_boards[] = {
.vchannels = 3,
.tda9887_conf = TDA9887_PRESENT,
.tuner_type = TUNER_XC2028,
- .has_tuner = 1,
.mts_firmware = 1,
.has_12mhz_i2s = 1,
.decoder = EM28XX_TVP5150,
@@ -228,7 +223,6 @@ struct em28xx_board em28xx_boards[] = {
.name = "Terratec Hybrid XS",
.vchannels = 3,
.tda9887_conf = TDA9887_PRESENT,
- .has_tuner = 1,
.tuner_type = TUNER_XC2028,
.decoder = EM28XX_TVP5150,
.input = { {
@@ -252,7 +246,6 @@ struct em28xx_board em28xx_boards[] = {
.name = "Terratec Prodigy XS",
.vchannels = 3,
.tda9887_conf = TDA9887_PRESENT,
- .has_tuner = 1,
.tuner_type = TUNER_XC2028,
.decoder = EM28XX_TVP5150,
.input = { {
@@ -276,7 +269,6 @@ struct em28xx_board em28xx_boards[] = {
.tda9887_conf = TDA9887_PRESENT |
TDA9887_PORT1_ACTIVE |
TDA9887_PORT2_ACTIVE,
- .has_tuner = 1,
.max_range_640_480 = 1,
.decoder = EM28XX_SAA7114,
@@ -300,7 +292,6 @@ struct em28xx_board em28xx_boards[] = {
.vchannels = 3,
.tuner_type = TUNER_LG_PAL_NEW_TAPC,
.tda9887_conf = TDA9887_PRESENT,
- .has_tuner = 1,
.decoder = EM28XX_SAA7113,
.input = { {
.type = EM28XX_VMUX_TELEVISION,
@@ -322,7 +313,6 @@ struct em28xx_board em28xx_boards[] = {
.vchannels = 3,
.tuner_type = TUNER_LG_PAL_NEW_TAPC,
.tda9887_conf = TDA9887_PRESENT,
- .has_tuner = 1,
.decoder = EM28XX_SAA7113,
.input = { {
.type = EM28XX_VMUX_TELEVISION,
@@ -344,7 +334,6 @@ struct em28xx_board em28xx_boards[] = {
.vchannels = 3,
.tuner_type = TUNER_PHILIPS_ATSC,
.tda9887_conf = TDA9887_PRESENT,
- .has_tuner = 1,
.decoder = EM28XX_SAA7113,
.input = { {
.type = EM28XX_VMUX_TELEVISION,
@@ -363,7 +352,7 @@ struct em28xx_board em28xx_boards[] = {
[EM2820_BOARD_PINNACLE_DVC_90] = {
.name = "Pinnacle Dazzle DVC 90/DVC 100",
.vchannels = 3,
- .has_tuner = 0,
+ .tuner_type = TUNER_ABSENT,
.decoder = EM28XX_SAA7113,
.input = { {
.type = EM28XX_VMUX_COMPOSITE1,
@@ -381,7 +370,6 @@ struct em28xx_board em28xx_boards[] = {
.vchannels = 3,
.tuner_type = TUNER_LG_PAL_NEW_TAPC,
.tda9887_conf = TDA9887_PRESENT,
- .has_tuner = 1,
.decoder = EM28XX_SAA7113,
.input = { {
.type = EM28XX_VMUX_TELEVISION,
@@ -401,7 +389,7 @@ struct em28xx_board em28xx_boards[] = {
.name = "Pixelview Prolink PlayTV USB 2.0",
.vchannels = 3,
.tda9887_conf = TDA9887_PRESENT,
- .has_tuner = 1,
+ .tuner_type = TUNER_YMEC_TVF_5533MF,
.decoder = EM28XX_SAA7113,
.input = { {
.type = EM28XX_VMUX_TELEVISION,
@@ -552,7 +540,7 @@ static void em28xx_config_tuner(struct em28xx *dev)
struct tuner_setup tun_setup;
struct v4l2_frequency f;
- if (!dev->has_tuner)
+ if (dev->tuner_type == TUNER_ABSENT)
return;
tun_setup.mode_mask = T_ANALOG_TV | T_RADIO;
@@ -669,7 +657,6 @@ static int em28xx_hint_board(struct em28xx *dev)
static void em28xx_set_model(struct em28xx *dev)
{
dev->is_em2800 = em28xx_boards[dev->model].is_em2800;
- dev->has_tuner = em28xx_boards[dev->model].has_tuner;
dev->has_msp34xx = em28xx_boards[dev->model].has_msp34xx;
dev->tda9887_conf = em28xx_boards[dev->model].tda9887_conf;
dev->decoder = em28xx_boards[dev->model].decoder;
@@ -677,9 +664,6 @@ static void em28xx_set_model(struct em28xx *dev)
dev->analog_gpio = em28xx_boards[dev->model].analog_gpio;
dev->has_12mhz_i2s = em28xx_boards[dev->model].has_12mhz_i2s;
dev->max_range_640_480 = em28xx_boards[dev->model].max_range_640_480;
-
- if (!em28xx_boards[dev->model].has_tuner)
- dev->tuner_type = UNSET;
}
/* ----------------------------------------------------------------------- */
@@ -746,6 +730,7 @@ void em28xx_card_setup(struct em28xx *dev)
tveeprom_hauppauge_analog(&dev->i2c_client, &tv, dev->eedata);
dev->tuner_type = tv.tuner_type;
+
if (tv.audio_processor == AUDIO_CHIP_MSP34XX) {
dev->i2s_speed = 2048000;
dev->has_msp34xx = 1;
@@ -778,7 +763,7 @@ void em28xx_card_setup(struct em28xx *dev)
request_module("saa7115");
if (dev->decoder == EM28XX_TVP5150)
request_module("tvp5150");
- if (dev->has_tuner)
+ if (dev->tuner_type != TUNER_ABSENT)
request_module("tuner");
#endif
diff --git a/linux/drivers/media/video/em28xx/em28xx-video.c b/linux/drivers/media/video/em28xx/em28xx-video.c
index cfec27b3a..e5da0ffac 100644
--- a/linux/drivers/media/video/em28xx/em28xx-video.c
+++ b/linux/drivers/media/video/em28xx/em28xx-video.c
@@ -40,6 +40,7 @@
#include "em28xx.h"
#include <media/v4l2-common.h>
#include <media/msp3400.h>
+#include <media/tuner.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
#include "i2c-compat.h"
#endif
@@ -953,7 +954,7 @@ static int vidioc_querycap(struct file *file, void *priv,
V4L2_CAP_AUDIO |
V4L2_CAP_READWRITE | V4L2_CAP_STREAMING;
- if (dev->has_tuner)
+ if (dev->tuner_type != TUNER_ABSENT)
cap->capabilities |= V4L2_CAP_TUNER;
return 0;
@@ -1977,7 +1978,7 @@ static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev,
em28xx_errdev("cannot allocate video_device.\n");
goto fail_unreg;
}
- if (dev->has_tuner)
+ if (dev->tuner_type != TUNER_ABSENT)
dev->vdev->type |= VID_TYPE_TUNER;
/* register v4l2 video video_device */
diff --git a/linux/drivers/media/video/em28xx/em28xx.h b/linux/drivers/media/video/em28xx/em28xx.h
index 6d7171a89..efabaf6d1 100644
--- a/linux/drivers/media/video/em28xx/em28xx.h
+++ b/linux/drivers/media/video/em28xx/em28xx.h
@@ -164,7 +164,6 @@ struct em28xx_board {
unsigned int tda9887_conf;
unsigned int is_em2800:1;
- unsigned int has_tuner:1;
unsigned int has_msp34xx:1;
unsigned int mts_firmware:1;
unsigned int has_12mhz_i2s:1;
@@ -237,7 +236,6 @@ struct em28xx {
int devno; /* marks the number of this device */
unsigned int analog_gpio;
unsigned int is_em2800:1;
- unsigned int has_tuner:1;
unsigned int has_msp34xx:1;
unsigned int has_tda9887:1;
unsigned int stream_on:1; /* Locks streams */