From aae73aaf4878b78e7641ccd8496482a2e6e3f61b Mon Sep 17 00:00:00 2001 From: Gerd Knorr Date: Wed, 14 Jul 2004 12:25:56 +0000 Subject: - saa7134: drop i2s_rate field + related changes. - saa7134: adapt sync_control bits when the signal comes and goes away. --- linux/drivers/media/video/saa7134/saa7134-cards.c | 4 ---- linux/drivers/media/video/saa7134/saa7134-oss.c | 2 -- linux/drivers/media/video/saa7134/saa7134-tvaudio.c | 5 +++-- linux/drivers/media/video/saa7134/saa7134-video.c | 8 ++++++-- linux/drivers/media/video/saa7134/saa7134.h | 1 - 5 files changed, 9 insertions(+), 11 deletions(-) (limited to 'linux/drivers/media') diff --git a/linux/drivers/media/video/saa7134/saa7134-cards.c b/linux/drivers/media/video/saa7134/saa7134-cards.c index 270e81b7a..79c79a994 100644 --- a/linux/drivers/media/video/saa7134/saa7134-cards.c +++ b/linux/drivers/media/video/saa7134/saa7134-cards.c @@ -197,7 +197,6 @@ struct saa7134_board saa7134_boards[] = { .name = name_radio, .amux = LINE2, }, - .i2s_rate = 48000, .has_ts = 1, .video_out = CCIR656, }, @@ -322,7 +321,6 @@ struct saa7134_board saa7134_boards[] = { .amux = LINE2, .gpio = 0x20000, }, - .i2s_rate = 48000, .has_ts = 1, .video_out = CCIR656, }, @@ -627,7 +625,6 @@ struct saa7134_board saa7134_boards[] = { .vmux = 8, .amux = LINE1, }}, - .i2s_rate = 48000, .has_ts = 1, .video_out = CCIR656, }, @@ -729,7 +726,6 @@ struct saa7134_board saa7134_boards[] = { .amux = LINE2, .tv = 1, }}, - .i2s_rate = 48000, .has_ts = 1, .video_out = CCIR656, }, diff --git a/linux/drivers/media/video/saa7134/saa7134-oss.c b/linux/drivers/media/video/saa7134/saa7134-oss.c index b069a1fcd..26c15b99a 100644 --- a/linux/drivers/media/video/saa7134/saa7134-oss.c +++ b/linux/drivers/media/video/saa7134/saa7134-oss.c @@ -773,8 +773,6 @@ int saa7134_oss_init1(struct saa7134_dev *dev) dev->oss.rate = 32000; if (oss_rate) dev->oss.rate = oss_rate; - if (saa7134_boards[dev->board].i2s_rate) - dev->oss.rate = saa7134_boards[dev->board].i2s_rate; dev->oss.rate = (dev->oss.rate > 40000) ? 48000 : 32000; /* mixer */ diff --git a/linux/drivers/media/video/saa7134/saa7134-tvaudio.c b/linux/drivers/media/video/saa7134/saa7134-tvaudio.c index 7776de191..2a7b9821d 100644 --- a/linux/drivers/media/video/saa7134/saa7134-tvaudio.c +++ b/linux/drivers/media/video/saa7134/saa7134-tvaudio.c @@ -941,8 +941,9 @@ int saa7134_tvaudio_init2(struct saa7134_dev *dev) int (*my_thread)(void *data) = NULL; /* enable I2S audio output */ - if (saa7134_boards[dev->board].i2s_rate) { - int i2sform = (32000 == saa7134_boards[dev->board].i2s_rate) ? 0x00 : 0x01; + if (saa7134_boards[dev->board].has_ts) { + int i2sform = (48000 == dev->oss.rate) + ? 0x01 : 0x00; /* enable I2S output */ saa_writeb(SAA7134_I2S_OUTPUT_SELECT, 0x80); diff --git a/linux/drivers/media/video/saa7134/saa7134-video.c b/linux/drivers/media/video/saa7134/saa7134-video.c index 4e1b864f7..58afc8b53 100644 --- a/linux/drivers/media/video/saa7134/saa7134-video.c +++ b/linux/drivers/media/video/saa7134/saa7134-video.c @@ -441,10 +441,11 @@ void res_free(struct saa7134_dev *dev, struct saa7134_fh *fh, unsigned int bits) static void set_tvnorm(struct saa7134_dev *dev, struct saa7134_tvnorm *norm) { - int luma_control,sync_control,mux; + int luma_control,sync_control,mux,nosignal; dprintk("set tv norm = %s\n",norm->name); dev->tvnorm = norm; + nosignal = (0 == (saa_readb(SAA7134_STATUS_VIDEO1) & 0x03)); mux = card_in(dev,dev->ctl_input).vmux; luma_control = norm->luma_control; @@ -452,7 +453,7 @@ static void set_tvnorm(struct saa7134_dev *dev, struct saa7134_tvnorm *norm) if (mux > 5) luma_control |= 0x80; /* svideo */ - if (noninterlaced) + if (noninterlaced || nosignal) sync_control |= 0x20; /* setup cropping */ @@ -2327,11 +2328,14 @@ void saa7134_irq_video_intl(struct saa7134_dev *dev) if (0 != norm) { /* wake up tvaudio audio carrier scan thread */ saa7134_tvaudio_do_scan(dev); + if (!noninterlaced) + saa_clearb(SAA7134_SYNC_CTRL, 0x20); } else { /* no video signal -> mute audio */ if (dev->ctl_automute) dev->automute = 1; saa7134_tvaudio_setmute(dev); + saa_setb(SAA7134_SYNC_CTRL, 0x20); } } diff --git a/linux/drivers/media/video/saa7134/saa7134.h b/linux/drivers/media/video/saa7134/saa7134.h index c6a2c2a8a..2e21f216d 100644 --- a/linux/drivers/media/video/saa7134/saa7134.h +++ b/linux/drivers/media/video/saa7134/saa7134.h @@ -208,7 +208,6 @@ struct saa7134_board { struct saa7134_input mute; /* peripheral I/O */ - unsigned int i2s_rate; unsigned int has_ts; enum saa7134_video_out video_out; -- cgit v1.2.3