summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/saa7134
diff options
context:
space:
mode:
authorGerd Knorr <devnull@localhost>2004-07-07 06:42:28 +0000
committerGerd Knorr <devnull@localhost>2004-07-07 06:42:28 +0000
commitb51f6e936a61b0ac199a778d45f67f9db48313f9 (patch)
treeac522e1723e9baabe707d3cdcfb7295d582f3e21 /linux/drivers/media/video/saa7134
parenta3f6ab922affe971512b83a9029f4c4061e0b60b (diff)
downloadmediapointer-dvb-s2-b51f6e936a61b0ac199a778d45f67f9db48313f9.tar.gz
mediapointer-dvb-s2-b51f6e936a61b0ac199a778d45f67f9db48313f9.tar.bz2
- saa7134: add automute option.
- tda9887: add config i2c command.
Diffstat (limited to 'linux/drivers/media/video/saa7134')
-rw-r--r--linux/drivers/media/video/saa7134/saa7134-cards.c51
-rw-r--r--linux/drivers/media/video/saa7134/saa7134-core.c5
-rw-r--r--linux/drivers/media/video/saa7134/saa7134-i2c.c2
-rw-r--r--linux/drivers/media/video/saa7134/saa7134-tvaudio.c3
-rw-r--r--linux/drivers/media/video/saa7134/saa7134-video.c34
-rw-r--r--linux/drivers/media/video/saa7134/saa7134.h5
6 files changed, 80 insertions, 20 deletions
diff --git a/linux/drivers/media/video/saa7134/saa7134-cards.c b/linux/drivers/media/video/saa7134/saa7134-cards.c
index 9ae587744..0ff596b09 100644
--- a/linux/drivers/media/video/saa7134/saa7134-cards.c
+++ b/linux/drivers/media/video/saa7134/saa7134-cards.c
@@ -154,6 +154,26 @@ struct saa7134_board saa7134_boards[] = {
.gpio = 0x8000,
},
},
+ [SAA7135_BOARD_FLYTVPLATINUM] = {
+ /* "Arnaud Quette" <aquette@free.fr> */
+ .name = "LifeView FlyTV Platinum",
+ .audio_clock = 0x00200000,
+ .tuner_type = TUNER_PHILIPS_SECAM,
+ .inputs = {{
+ .name = name_tv,
+ .vmux = 1,
+ .amux = LINE2,
+ .tv = 1,
+ },{
+ .name = name_comp1,
+ .vmux = 0,
+ .amux = LINE2,
+ },{
+ .name = name_svideo,
+ .vmux = 8,
+ .amux = LINE2,
+ }},
+ },
[SAA7134_BOARD_EMPRESS] = {
/* "Gert Vervoort" <gert.vervoort@philips.com> */
.name = "EMPRESS",
@@ -243,7 +263,7 @@ struct saa7134_board saa7134_boards[] = {
.name = "KNC One TV-Station RDS / Typhoon TV Tuner RDS",
.audio_clock = 0x00200000,
.tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
- .need_tda9887 = 1,
+ .tda9887_conf = TDA9887_PRESENT,
.inputs = {{
.name = name_tv,
.vmux = 1,
@@ -278,7 +298,7 @@ struct saa7134_board saa7134_boards[] = {
.name = "KNC One TV-Station DVR",
.audio_clock = 0x00200000,
.tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
- .need_tda9887 = 1,
+ .tda9887_conf = TDA9887_PRESENT,
.gpiomask = 0x820000,
.inputs = {{
.name = name_tv,
@@ -333,7 +353,7 @@ struct saa7134_board saa7134_boards[] = {
.name = "Medion 5044",
.audio_clock = 0x00187de7, // was: 0x00200000,
.tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
- .need_tda9887 = 1,
+ .tda9887_conf = TDA9887_PRESENT,
.inputs = {{
.name = name_tv,
.vmux = 1,
@@ -414,7 +434,7 @@ struct saa7134_board saa7134_boards[] = {
//.audio_clock = 0x00200000,
.audio_clock = 0x00187de7,
.tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
- .need_tda9887 = 1,
+ .tda9887_conf = TDA9887_PRESENT,
.inputs = {{
.name = name_tv,
.vmux = 1,
@@ -440,7 +460,7 @@ struct saa7134_board saa7134_boards[] = {
.name = "Typhoon TV+Radio 90031",
.audio_clock = 0x00200000,
.tuner_type = TUNER_PHILIPS_PAL,
- .need_tda9887 = 1,
+ .tda9887_conf = TDA9887_PRESENT,
.inputs = {{
.name = name_tv,
.vmux = 1,
@@ -503,7 +523,7 @@ struct saa7134_board saa7134_boards[] = {
.name = "ASUS TV-FM 7134",
.audio_clock = 0x00187de7,
.tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
- .need_tda9887 = 1,
+ .tda9887_conf = TDA9887_PRESENT,
.inputs = {{
.name = name_tv,
.vmux = 1,
@@ -666,7 +686,7 @@ struct saa7134_board saa7134_boards[] = {
.name = "AverMedia M156 / Medion 2819",
.audio_clock = 0x00187de7,
.tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
- .need_tda9887 = 1,
+ .tda9887_conf = TDA9887_PRESENT,
.inputs = {{
.name = name_tv,
.vmux = 1,
@@ -719,7 +739,7 @@ struct saa7134_board saa7134_boards[] = {
// probably wrong, the 7133 one is the NTSC version ...
// .tuner_type = TUNER_PHILIPS_FM1236_MK3
.tuner_type = TUNER_LG_NTSC_NEW_TAPC,
- .need_tda9887 = 1,
+ .tda9887_conf = TDA9887_PRESENT,
.inputs = {{
.name = name_tv,
.vmux = 1,
@@ -743,7 +763,7 @@ struct saa7134_board saa7134_boards[] = {
.name = "Pinnacle PCTV Stereo (saa7134)",
.audio_clock = 0x00187de7,
.tuner_type = TUNER_MT2032,
- .need_tda9887 = 1,
+ .tda9887_conf = TDA9887_PRESENT,
.inputs = {{
.name = name_tv,
.vmux = 3,
@@ -957,7 +977,7 @@ struct saa7134_board saa7134_boards[] = {
.name = "AverMedia 305",
.audio_clock = 0x00187de7,
.tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
- .need_tda9887 = 1,
+ .tda9887_conf = TDA9887_PRESENT,
.inputs = {{
.name = name_tv,
.vmux = 1,
@@ -989,7 +1009,7 @@ struct saa7134_board saa7134_boards[] = {
.name = "UPMOST PURPLE TV",
.audio_clock = 0x00187de7,
.tuner_type = TUNER_PHILIPS_FM1236_MK3,
- .need_tda9887 = 1,
+ .tda9887_conf = TDA9887_PRESENT,
.inputs = {{
.name = name_tv,
.vmux = 7,
@@ -1104,6 +1124,12 @@ struct pci_device_id saa7134_pci_tbl[] = {
.driver_data = SAA7134_BOARD_FLYVIDEO2000,
},{
.vendor = PCI_VENDOR_ID_PHILIPS,
+ .device = PCI_DEVICE_ID_PHILIPS_SAA7135,
+ .subvendor = 0x5168,
+ .subdevice = 0x0212,
+ .driver_data = SAA7134_BOARD_FLYTVPLATINUM,
+ },{
+ .vendor = PCI_VENDOR_ID_PHILIPS,
.device = PCI_DEVICE_ID_PHILIPS_SAA7134,
.subvendor = 0x16be,
.subdevice = 0x0003,
@@ -1343,8 +1369,9 @@ int saa7134_board_init(struct saa7134_dev *dev)
switch (dev->board) {
case SAA7134_BOARD_FLYVIDEO2000:
case SAA7134_BOARD_FLYVIDEO3000:
- board_flyvideo(dev);
dev->has_remote = 1;
+ case SAA7135_BOARD_FLYTVPLATINUM:
+ board_flyvideo(dev);
break;
case SAA7134_BOARD_CINERGY400:
case SAA7134_BOARD_CINERGY600:
diff --git a/linux/drivers/media/video/saa7134/saa7134-core.c b/linux/drivers/media/video/saa7134/saa7134-core.c
index 1567fc067..d031d5dde 100644
--- a/linux/drivers/media/video/saa7134/saa7134-core.c
+++ b/linux/drivers/media/video/saa7134/saa7134-core.c
@@ -870,7 +870,8 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
must_configure_manually();
dev->board = SAA7134_BOARD_UNKNOWN;
}
- dev->tuner_type = saa7134_boards[dev->board].tuner_type;
+ dev->tuner_type = saa7134_boards[dev->board].tuner_type;
+ dev->tda9887_conf = saa7134_boards[dev->board].tda9887_conf;
if (UNSET != tuner[saa7134_devcount])
dev->tuner_type = tuner[saa7134_devcount];
printk(KERN_INFO "%s: subsystem: %04x:%04x, board: %s [card=%d,%s]\n",
@@ -921,7 +922,7 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
/* load i2c helpers */
if (TUNER_ABSENT != dev->tuner_type)
request_module("tuner");
- if (saa7134_boards[dev->board].need_tda9887)
+ if (dev->tda9887_conf)
request_module("tda9887");
if (card_has_ts(dev))
request_module("saa6752hs");
diff --git a/linux/drivers/media/video/saa7134/saa7134-i2c.c b/linux/drivers/media/video/saa7134/saa7134-i2c.c
index b039c0385..e35cfd10f 100644
--- a/linux/drivers/media/video/saa7134/saa7134-i2c.c
+++ b/linux/drivers/media/video/saa7134/saa7134-i2c.c
@@ -327,8 +327,10 @@ static int attach_inform(struct i2c_client *client)
{
struct saa7134_dev *dev = client->adapter->algo_data;
int tuner = dev->tuner_type;
+ int conf = dev->tda9887_conf;
saa7134_i2c_call_clients(dev,TUNER_SET_TYPE,&tuner);
+ saa7134_i2c_call_clients(dev,TDA9887_SET_CONFIG,&conf);
return 0;
}
diff --git a/linux/drivers/media/video/saa7134/saa7134-tvaudio.c b/linux/drivers/media/video/saa7134/saa7134-tvaudio.c
index c5950ba28..7776de191 100644
--- a/linux/drivers/media/video/saa7134/saa7134-tvaudio.c
+++ b/linux/drivers/media/video/saa7134/saa7134-tvaudio.c
@@ -512,7 +512,8 @@ static int tvaudio_thread(void *data)
dprintk("tvaudio thread scan start [%d]\n",dev->thread.scan1);
dev->tvaudio = NULL;
tvaudio_init(dev);
- dev->automute = 1;
+ if (dev->ctl_automute)
+ dev->automute = 1;
mute_input_7134(dev);
/* give the tuner some time */
diff --git a/linux/drivers/media/video/saa7134/saa7134-video.c b/linux/drivers/media/video/saa7134/saa7134-video.c
index 8afa9f441..4e1b864f7 100644
--- a/linux/drivers/media/video/saa7134/saa7134-video.c
+++ b/linux/drivers/media/video/saa7134/saa7134-video.c
@@ -272,7 +272,8 @@ static struct saa7134_tvnorm tvnorms[] = {
#define V4L2_CID_PRIVATE_INVERT (V4L2_CID_PRIVATE_BASE + 0)
#define V4L2_CID_PRIVATE_Y_ODD (V4L2_CID_PRIVATE_BASE + 1)
#define V4L2_CID_PRIVATE_Y_EVEN (V4L2_CID_PRIVATE_BASE + 2)
-#define V4L2_CID_PRIVATE_LASTP1 (V4L2_CID_PRIVATE_BASE + 3)
+#define V4L2_CID_PRIVATE_AUTOMUTE (V4L2_CID_PRIVATE_BASE + 3)
+#define V4L2_CID_PRIVATE_LASTP1 (V4L2_CID_PRIVATE_BASE + 4)
static const struct v4l2_queryctrl no_ctrl = {
.name = "42",
@@ -356,6 +357,13 @@ static const struct v4l2_queryctrl video_ctrls[] = {
.maximum = 128,
.default_value = 0,
.type = V4L2_CTRL_TYPE_INTEGER,
+ },{
+ .id = V4L2_CID_PRIVATE_AUTOMUTE,
+ .name = "automute",
+ .minimum = 0,
+ .maximum = 1,
+ .default_value = 1,
+ .type = V4L2_CTRL_TYPE_BOOLEAN,
}
};
static const unsigned int CTRLS = ARRAY_SIZE(video_ctrls);
@@ -1043,6 +1051,9 @@ static int get_control(struct saa7134_dev *dev, struct v4l2_control *c)
case V4L2_CID_PRIVATE_Y_ODD:
c->value = dev->ctl_y_odd;
break;
+ case V4L2_CID_PRIVATE_AUTOMUTE:
+ c->value = dev->ctl_automute;
+ break;
default:
return -EINVAL;
}
@@ -1118,6 +1129,17 @@ static int set_control(struct saa7134_dev *dev, struct saa7134_fh *fh,
dev->ctl_y_odd = c->value;
restart_overlay = 1;
break;
+ case V4L2_CID_PRIVATE_AUTOMUTE:
+ dev->ctl_automute = c->value;
+ if (dev->tda9887_conf) {
+ if (dev->ctl_automute)
+ dev->tda9887_conf |= TDA9887_AUTOMUTE;
+ else
+ dev->tda9887_conf &= ~TDA9887_AUTOMUTE;
+ saa7134_i2c_call_clients(dev, TDA9887_SET_CONFIG,
+ &dev->tda9887_conf);
+ }
+ break;
default:
return -EINVAL;
}
@@ -2246,9 +2268,12 @@ int saa7134_video_init1(struct saa7134_dev *dev)
dev->ctl_hue = ctrl_by_id(V4L2_CID_HUE)->default_value;
dev->ctl_saturation = ctrl_by_id(V4L2_CID_SATURATION)->default_value;
dev->ctl_volume = ctrl_by_id(V4L2_CID_AUDIO_VOLUME)->default_value;
+ dev->ctl_mute = ctrl_by_id(V4L2_CID_AUDIO_MUTE)->default_value;
+ dev->ctl_invert = ctrl_by_id(V4L2_CID_PRIVATE_INVERT)->default_value;
+ dev->ctl_automute = ctrl_by_id(V4L2_CID_PRIVATE_AUTOMUTE)->default_value;
- dev->ctl_invert = 0;
- dev->ctl_mute = 1;
+ if (dev->tda9887_conf && dev->ctl_automute)
+ dev->tda9887_conf |= TDA9887_AUTOMUTE;
dev->automute = 0;
INIT_LIST_HEAD(&dev->video_q.queue);
@@ -2304,7 +2329,8 @@ void saa7134_irq_video_intl(struct saa7134_dev *dev)
saa7134_tvaudio_do_scan(dev);
} else {
/* no video signal -> mute audio */
- dev->automute = 1;
+ if (dev->ctl_automute)
+ dev->automute = 1;
saa7134_tvaudio_setmute(dev);
}
}
diff --git a/linux/drivers/media/video/saa7134/saa7134.h b/linux/drivers/media/video/saa7134/saa7134.h
index e77ba8805..c6a2c2a8a 100644
--- a/linux/drivers/media/video/saa7134/saa7134.h
+++ b/linux/drivers/media/video/saa7134/saa7134.h
@@ -185,6 +185,7 @@ struct saa7134_format {
#define SAA7133_BOARD_UPMOST_PURPLE_TV 36
#define SAA7134_BOARD_ITEMS_MTV005 37
#define SAA7134_BOARD_CINERGY200 38
+#define SAA7134_BOARD_FLYTVPLATINUM 39
#define SAA7134_INPUT_MAX 8
@@ -213,7 +214,7 @@ struct saa7134_board {
/* i2c chip info */
unsigned int tuner_type;
- unsigned int need_tda9887:1;
+ unsigned int tda9887_conf;
};
#define card_has_radio(dev) (NULL != saa7134_boards[dev->board].radio.name)
@@ -391,6 +392,7 @@ struct saa7134_dev {
/* config info */
unsigned int board;
unsigned int tuner_type;
+ unsigned int tda9887_conf;
unsigned int gpio_value;
/* i2c i/o */
@@ -426,6 +428,7 @@ struct saa7134_dev {
int ctl_mirror;
int ctl_y_odd;
int ctl_y_even;
+ int ctl_automute;
/* crop */
struct v4l2_rect crop_bounds;