From a612e95a5cbca2eaf13c50b9f3900636c166727c Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Mon, 21 May 2007 13:36:01 -0400 Subject: cx88-blackbird: audio improvements From: Jelle Foks This patch should fix the 'muted audio' and 'raspy audio' problem for mpeg2 streams out of cx88-blackbird devices. Especially mythtv users would find that the audio would often sound bad (aliased, or 'raspy'), mainly related to channel changes, many (all?) other users would find that there was no audio at all in the mpeg data from the encoder chip, unless the audio was manually unmuted. The patch includes the following modifications: Don't actually start the mpeg2 encoder until the device is read from by the application. Wait until the audio is stable for at least 400ms before starting the mpeg encoder. Mute/Unmute the audio when starting/stopping the mpeg encoder. Stop the mpeg encoder when changing parameters and when changing tuner frequency. Add a variable 'mpeg_active' to struct cx8802_dev to allow tracking of whether or not the mpeg2 encoder is active. Load the firmware on cx88-blackbird driver load. Signed-off-by: Jelle Foks Signed-off-by: Michael Krufky --- linux/drivers/media/video/cx88/cx88-blackbird.c | 89 +++++++++++++++++++------ linux/drivers/media/video/cx88/cx88.h | 1 + 2 files changed, 70 insertions(+), 20 deletions(-) (limited to 'linux') diff --git a/linux/drivers/media/video/cx88/cx88-blackbird.c b/linux/drivers/media/video/cx88/cx88-blackbird.c index d9b49275c..8690cad13 100644 --- a/linux/drivers/media/video/cx88/cx88-blackbird.c +++ b/linux/drivers/media/video/cx88/cx88-blackbird.c @@ -546,6 +546,9 @@ static int blackbird_initialize_codec(struct cx8802_dev *dev) dprintk(1,"Initialize codec\n"); retval = blackbird_api_cmd(dev, CX2341X_ENC_PING_FW, 0, 0); /* ping */ if (retval < 0) { + + dev->mpeg_active = 0; + /* ping was not successful, reset and upload firmware */ cx_write(MO_SRST_IO, 0); /* SYS_RSTO=0 */ msleep(1); @@ -582,38 +585,80 @@ static int blackbird_initialize_codec(struct cx8802_dev *dev) blackbird_codec_settings(dev); msleep(1); - /* blackbird_api_cmd(dev, IVTV_API_ASSIGN_NUM_VSYNC_LINES, 4, 0, 0xef, 0xef); - blackbird_api_cmd(dev, IVTV_API_ASSIGN_NUM_VSYNC_LINES, 4, 0, 0xf0, 0xf0); - blackbird_api_cmd(dev, IVTV_API_ASSIGN_NUM_VSYNC_LINES, 4, 0, 0x180, 0x180); */ blackbird_api_cmd(dev, CX2341X_ENC_SET_NUM_VSYNC_LINES, 2, 0, BLACKBIRD_FIELD1_SAA7115, BLACKBIRD_FIELD2_SAA7115 ); - /* blackbird_api_cmd(dev, IVTV_API_ASSIGN_PLACEHOLDER, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); */ blackbird_api_cmd(dev, CX2341X_ENC_SET_PLACEHOLDER, 12, 0, BLACKBIRD_CUSTOM_EXTENSION_USR_DATA, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - /* initialize the video input */ - blackbird_api_cmd(dev, CX2341X_ENC_INITIALIZE_INPUT, 0, 0); - msleep(1); + return 0; +} + +static int blackbird_start_codec(struct file *file, void *priv) +{ + struct cx8802_dev *dev = ((struct cx8802_fh *)priv)->dev; + struct cx88_core *core = dev->core; + /* start capturing to the host interface */ + u32 reg; + + int i; + int lastchange = -1; + int lastval = 0; + + for (i=0; (i < 10) && (i < (lastchange + 4)); i++) + { + reg = cx_read(AUD_STATUS); + + dprintk(1,"AUD_STATUS:%dL: 0x%x\n", i, reg); + if ((reg & 0x0F) != lastval) + { + lastval = reg & 0x0F; + lastchange = i; + } + msleep(100); + } + + /* unmute audio source */ + cx_clear(AUD_VOL_CTL, (1 << 6)); blackbird_api_cmd(dev, CX2341X_ENC_MUTE_VIDEO, 1, 0, BLACKBIRD_UNMUTE); msleep(1); blackbird_api_cmd(dev, CX2341X_ENC_MUTE_AUDIO, 1, 0, BLACKBIRD_UNMUTE); msleep(1); + blackbird_api_cmd(dev, CX2341X_ENC_REFRESH_INPUT, 0,0); + + /* initialize the video input */ + blackbird_api_cmd(dev, CX2341X_ENC_INITIALIZE_INPUT, 0, 0); + /* start capturing to the host interface */ - /* blackbird_api_cmd(dev, CX2341X_ENC_START_CAPTURE, 2, 0, 0, 0x13); */ blackbird_api_cmd(dev, CX2341X_ENC_START_CAPTURE, 2, 0, BLACKBIRD_MPEG_CAPTURE, BLACKBIRD_RAW_BITS_NONE ); msleep(10); - blackbird_api_cmd(dev, CX2341X_ENC_REFRESH_INPUT, 0,0); + dev->mpeg_active = 1; + return 0; +} + +static int blackbird_stop_codec(struct cx8802_dev *dev) +{ + struct cx88_core *core = dev->core; + + blackbird_api_cmd(dev, CX2341X_ENC_STOP_CAPTURE, 3, 0, + BLACKBIRD_END_NOW, + BLACKBIRD_MPEG_CAPTURE, + BLACKBIRD_RAW_BITS_NONE + ); + /* mute audio source */ + cx_set(AUD_VOL_CTL, (1 << 6)); + + dev->mpeg_active = 0; return 0; } @@ -859,6 +904,10 @@ static int vidioc_s_ext_ctrls (struct file *file, void *priv, if (f->ctrl_class != V4L2_CTRL_CLASS_MPEG) return -EINVAL; + + if (dev->mpeg_active) + blackbird_stop_codec(dev); + p = dev->params; err = cx2341x_ext_ctrls(&p, 0, f, VIDIOC_S_EXT_CTRLS); if (!err) { @@ -890,10 +939,9 @@ static int vidioc_s_frequency (struct file *file, void *priv, struct cx8802_dev *dev = fh->dev; struct cx88_core *core = dev->core; - blackbird_api_cmd(fh->dev, CX2341X_ENC_STOP_CAPTURE, 3, 0, - BLACKBIRD_END_NOW, - BLACKBIRD_MPEG_CAPTURE, - BLACKBIRD_RAW_BITS_NONE); + if (dev->mpeg_active) + blackbird_stop_codec(dev); + cx88_set_freq (core,f); blackbird_initialize_codec(dev); cx88_set_scale(dev->core, dev->width, dev->height, @@ -1099,15 +1147,11 @@ static int mpeg_open(struct inode *inode, struct file *file) static int mpeg_release(struct inode *inode, struct file *file) { struct cx8802_fh *fh = file->private_data; - struct cx8802_dev *dev = NULL; + struct cx8802_dev *dev = fh->dev; struct cx8802_driver *drv = NULL; - /* blackbird_api_cmd(fh->dev, CX2341X_ENC_STOP_CAPTURE, 3, 0, BLACKBIRD_END_NOW, 0, 0x13); */ - blackbird_api_cmd(fh->dev, CX2341X_ENC_STOP_CAPTURE, 3, 0, - BLACKBIRD_END_NOW, - BLACKBIRD_MPEG_CAPTURE, - BLACKBIRD_RAW_BITS_NONE - ); + if (dev->mpeg_active) + blackbird_stop_codec(dev); cx8802_cancel_buffers(fh->dev); /* stop mpeg capture */ @@ -1133,6 +1177,10 @@ static ssize_t mpeg_read(struct file *file, char __user *data, size_t count, loff_t *ppos) { struct cx8802_fh *fh = file->private_data; + struct cx8802_dev *dev = fh->dev; + + if (!dev->mpeg_active) + blackbird_start_codec(file, fh); return videobuf_read_stream(&fh->mpegq, data, count, ppos, 0, file->f_flags & O_NONBLOCK); @@ -1311,6 +1359,7 @@ static int cx8802_blackbird_probe(struct cx8802_driver *drv) core->name); host_setup(dev->core); + blackbird_initialize_codec(dev); blackbird_register_video(dev); /* initial device configuration: needed ? */ diff --git a/linux/drivers/media/video/cx88/cx88.h b/linux/drivers/media/video/cx88/cx88.h index 1f294c70d..767bad56a 100644 --- a/linux/drivers/media/video/cx88/cx88.h +++ b/linux/drivers/media/video/cx88/cx88.h @@ -494,6 +494,7 @@ struct cx8802_dev { u32 mailbox; int width; int height; + unsigned char mpeg_active; /* nonzero if mpeg encoder is active */ /* mpeg params */ struct cx2341x_mpeg_params params; -- cgit v1.2.3 From df59e1e030bc294f3e1a9bc01b03361e34b5c013 Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Mon, 21 May 2007 13:46:06 -0400 Subject: cx88-blackbird: remove unnecessary msleep()'s From: Jelle Foks Remove the unnecessary msleep()'s in cx88-blackbird.c Signed-off-by: Jelle Foks Signed-off-by: Michael Krufky --- linux/drivers/media/video/cx88/cx88-blackbird.c | 8 -------- 1 file changed, 8 deletions(-) (limited to 'linux') diff --git a/linux/drivers/media/video/cx88/cx88-blackbird.c b/linux/drivers/media/video/cx88/cx88-blackbird.c index 8690cad13..f0a49f24c 100644 --- a/linux/drivers/media/video/cx88/cx88-blackbird.c +++ b/linux/drivers/media/video/cx88/cx88-blackbird.c @@ -551,9 +551,7 @@ static int blackbird_initialize_codec(struct cx8802_dev *dev) /* ping was not successful, reset and upload firmware */ cx_write(MO_SRST_IO, 0); /* SYS_RSTO=0 */ - msleep(1); cx_write(MO_SRST_IO, 1); /* SYS_RSTO=1 */ - msleep(1); retval = blackbird_load_firmware(dev); if (retval < 0) return retval; @@ -575,7 +573,6 @@ static int blackbird_initialize_codec(struct cx8802_dev *dev) } dprintk(0, "Firmware version is 0x%08x\n", version); } - msleep(1); cx_write(MO_PINMUX_IO, 0x88); /* 656-8bit IO and enable MPEG parallel IO */ cx_clear(MO_INPUT_FORMAT, 0x100); /* chroma subcarrier lock to normal? */ @@ -583,7 +580,6 @@ static int blackbird_initialize_codec(struct cx8802_dev *dev) cx_clear(MO_OUTPUT_FORMAT, 0x0008); /* Normal Y-limits to let the mpeg encoder sync */ blackbird_codec_settings(dev); - msleep(1); blackbird_api_cmd(dev, CX2341X_ENC_SET_NUM_VSYNC_LINES, 2, 0, BLACKBIRD_FIELD1_SAA7115, @@ -594,7 +590,6 @@ static int blackbird_initialize_codec(struct cx8802_dev *dev) BLACKBIRD_CUSTOM_EXTENSION_USR_DATA, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - msleep(1); return 0; } @@ -626,9 +621,7 @@ static int blackbird_start_codec(struct file *file, void *priv) cx_clear(AUD_VOL_CTL, (1 << 6)); blackbird_api_cmd(dev, CX2341X_ENC_MUTE_VIDEO, 1, 0, BLACKBIRD_UNMUTE); - msleep(1); blackbird_api_cmd(dev, CX2341X_ENC_MUTE_AUDIO, 1, 0, BLACKBIRD_UNMUTE); - msleep(1); blackbird_api_cmd(dev, CX2341X_ENC_REFRESH_INPUT, 0,0); @@ -640,7 +633,6 @@ static int blackbird_start_codec(struct file *file, void *priv) BLACKBIRD_MPEG_CAPTURE, BLACKBIRD_RAW_BITS_NONE ); - msleep(10); dev->mpeg_active = 1; return 0; -- cgit v1.2.3 From 4534b2fe32a702ee4d2b76c2da7eded605652c8b Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Mon, 21 May 2007 13:48:58 -0400 Subject: cx88-blackbird: remove unnecessary encoder unmute From: Jelle Foks Remove the unnecessary BLACKBIRD_UNMUTE calls to the mpeg encoder in cx88-blackbird.c The encoder is never muted, hence unmuting should then only be necessary once after hardware initialization. I tested this from warm boots and cold boots (with long power down time to ensure the sram in the chip is emptied), and found that after the firmware upload the encoder is apparently not muted, making the unmutes unnecessary. Signed-off-by: Jelle Foks Signed-off-by: Michael Krufky --- linux/drivers/media/video/cx88/cx88-blackbird.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'linux') diff --git a/linux/drivers/media/video/cx88/cx88-blackbird.c b/linux/drivers/media/video/cx88/cx88-blackbird.c index f0a49f24c..3cb76e235 100644 --- a/linux/drivers/media/video/cx88/cx88-blackbird.c +++ b/linux/drivers/media/video/cx88/cx88-blackbird.c @@ -620,9 +620,6 @@ static int blackbird_start_codec(struct file *file, void *priv) /* unmute audio source */ cx_clear(AUD_VOL_CTL, (1 << 6)); - blackbird_api_cmd(dev, CX2341X_ENC_MUTE_VIDEO, 1, 0, BLACKBIRD_UNMUTE); - blackbird_api_cmd(dev, CX2341X_ENC_MUTE_AUDIO, 1, 0, BLACKBIRD_UNMUTE); - blackbird_api_cmd(dev, CX2341X_ENC_REFRESH_INPUT, 0,0); /* initialize the video input */ -- cgit v1.2.3 From d3fa07b4cb52978d356672273b63a4e4674753fa Mon Sep 17 00:00:00 2001 From: Ricardo Cerqueira Date: Sun, 30 Sep 2007 17:02:49 +0100 Subject: Audio routes fix for blackbird boards with the wm8775 ADC From: Ricardo Cerqueira Fix lack of audio on the MPEG-2 stream of wm8775 based blackbirds. The wm8775 module initializes the audio input at "route 2", which doesn't hold true for all boards. The HVR-1300, for example, uses route 1 for tuner audio, and route 2 for baseband. So we must route the audio to the proper input depending on what video input is being used. Signed-off-by: Ricardo Cerqueira Signed-off-by: Michael Krufky --- linux/drivers/media/video/cx88/cx88-cards.c | 38 ++++++++++++++--------------- linux/drivers/media/video/cx88/cx88-video.c | 16 ++++++++++-- linux/drivers/media/video/cx88/cx88.h | 2 +- 3 files changed, 34 insertions(+), 22 deletions(-) (limited to 'linux') diff --git a/linux/drivers/media/video/cx88/cx88-cards.c b/linux/drivers/media/video/cx88/cx88-cards.c index 9c76afeb8..ec4133254 100644 --- a/linux/drivers/media/video/cx88/cx88-cards.c +++ b/linux/drivers/media/video/cx88/cx88-cards.c @@ -316,22 +316,22 @@ static const struct cx88_board cx88_boards[] = { .type = CX88_VMUX_TELEVISION, .vmux = 0, .gpio0 = 0x0000bde2, - .extadc = 1, + .audioroute = 1, },{ .type = CX88_VMUX_COMPOSITE1, .vmux = 1, .gpio0 = 0x0000bde6, - .extadc = 1, + .audioroute = 1, },{ .type = CX88_VMUX_SVIDEO, .vmux = 2, .gpio0 = 0x0000bde6, - .extadc = 1, + .audioroute = 1, }}, .radio = { .type = CX88_RADIO, .gpio0 = 0x0000bd62, - .extadc = 1, + .audioroute = 1, }, .mpeg = CX88_MPEG_BLACKBIRD, }, @@ -392,7 +392,7 @@ static const struct cx88_board cx88_boards[] = { .type = CX88_VMUX_SVIDEO, .vmux = 2, .gpio0 = 0x0000fde6, // 0x0000fda6 L,R RCA audio in? - .extadc = 1, + .audioroute = 1, }}, .radio = { .type = CX88_RADIO, @@ -563,7 +563,7 @@ static const struct cx88_board cx88_boards[] = { .input = {{ .type = CX88_VMUX_TELEVISION, .vmux = 0, - .extadc = 1, + .audioroute = 1, }}, .mpeg = CX88_MPEG_BLACKBIRD, }, @@ -686,22 +686,22 @@ static const struct cx88_board cx88_boards[] = { .type = CX88_VMUX_TELEVISION, .vmux = 0, .gpio0 = 0x00009d80, - .extadc = 1, + .audioroute = 1, },{ .type = CX88_VMUX_COMPOSITE1, .vmux = 1, .gpio0 = 0x00009d76, - .extadc = 1, + .audioroute = 1, },{ .type = CX88_VMUX_SVIDEO, .vmux = 2, .gpio0 = 0x00009d76, - .extadc = 1, + .audioroute = 1, }}, .radio = { .type = CX88_RADIO, .gpio0 = 0x00009d00, - .extadc = 1, + .audioroute = 1, }, .mpeg = CX88_MPEG_BLACKBIRD, }, @@ -840,23 +840,23 @@ static const struct cx88_board cx88_boards[] = { .type = CX88_VMUX_COMPOSITE1, .vmux = 0, .gpio0 = 0x0000cd73, - .extadc = 1, + .audioroute = 1, },{ .type = CX88_VMUX_SVIDEO, .vmux = 1, .gpio0 = 0x0000cd73, - .extadc = 1, + .audioroute = 1, },{ .type = CX88_VMUX_TELEVISION, .vmux = 3, .gpio0 = 0x0000cdb3, - .extadc = 1, + .audioroute = 1, }}, .radio = { .type = CX88_RADIO, .vmux = 2, .gpio0 = 0x0000cdf3, - .extadc = 1, + .audioroute = 1, }, .mpeg = CX88_MPEG_BLACKBIRD, }, @@ -1124,12 +1124,12 @@ static const struct cx88_board cx88_boards[] = { .type = CX88_VMUX_COMPOSITE1, .vmux = 1, .gpio0 = 0x3de6, - .extadc = 1, + .audioroute = 1, },{ .type = CX88_VMUX_SVIDEO, .vmux = 2, .gpio0 = 0x3de6, - .extadc = 1, + .audioroute = 1, }}, .radio = { .type = CX88_RADIO, @@ -1386,17 +1386,17 @@ static const struct cx88_board cx88_boards[] = { .type = CX88_VMUX_TELEVISION, .vmux = 0, .gpio0 = 0xe780, - .extadc = 1, + .audioroute = 1, },{ .type = CX88_VMUX_COMPOSITE1, .vmux = 1, .gpio0 = 0xe780, - .extadc = 1, + .audioroute = 2, },{ .type = CX88_VMUX_SVIDEO, .vmux = 2, .gpio0 = 0xe780, - .extadc = 1, + .audioroute = 2, }}, /* fixme: Add radio support */ .mpeg = CX88_MPEG_DVB | CX88_MPEG_BLACKBIRD, diff --git a/linux/drivers/media/video/cx88/cx88-video.c b/linux/drivers/media/video/cx88/cx88-video.c index 14b026820..9feb5c4bb 100644 --- a/linux/drivers/media/video/cx88/cx88-video.c +++ b/linux/drivers/media/video/cx88/cx88-video.c @@ -410,9 +410,21 @@ int cx88_video_mux(struct cx88_core *core, unsigned int input) if (core->board.mpeg & CX88_MPEG_BLACKBIRD) { /* sets sound input from external adc */ - if (INPUT(input).extadc) + if (INPUT(input).audioroute) { + /* The wm8775 module has the "2" route hardwired into + the initialization. Some boards may use different + routes for different inputs. HVR-1300 surely does */ + if (core->board.audio_chip && + core->board.audio_chip == AUDIO_CHIP_WM8775) { + struct v4l2_routing route; + + route.input = INPUT(input).audioroute; + cx88_call_i2c_clients(core, + VIDIOC_INT_S_AUDIO_ROUTING,&route); + } + cx_set(AUD_CTL, EN_I2SIN_ENABLE); - else + } else cx_clear(AUD_CTL, EN_I2SIN_ENABLE); } return 0; diff --git a/linux/drivers/media/video/cx88/cx88.h b/linux/drivers/media/video/cx88/cx88.h index 767bad56a..b193a26ce 100644 --- a/linux/drivers/media/video/cx88/cx88.h +++ b/linux/drivers/media/video/cx88/cx88.h @@ -231,7 +231,7 @@ struct cx88_input { enum cx88_itype type; u32 gpio0, gpio1, gpio2, gpio3; unsigned int vmux:2; - unsigned int extadc:1; + unsigned int audioroute; }; struct cx88_board { -- cgit v1.2.3 From 7bbfb93108980416344e1851b2d045336540c529 Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Sat, 13 Oct 2007 19:42:45 -0400 Subject: cx88-blackbird: don't mute audio when stopping the codec From: Michael Krufky We should not mute the audio input when we stop the codec, because it will interfere with the live uncompressed stream. Signed-off-by: Michael Krufky Reviewed-by: Jelle Foks --- linux/drivers/media/video/cx88/cx88-blackbird.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'linux') diff --git a/linux/drivers/media/video/cx88/cx88-blackbird.c b/linux/drivers/media/video/cx88/cx88-blackbird.c index 3cb76e235..d16a3cd72 100644 --- a/linux/drivers/media/video/cx88/cx88-blackbird.c +++ b/linux/drivers/media/video/cx88/cx88-blackbird.c @@ -637,15 +637,11 @@ static int blackbird_start_codec(struct file *file, void *priv) static int blackbird_stop_codec(struct cx8802_dev *dev) { - struct cx88_core *core = dev->core; - blackbird_api_cmd(dev, CX2341X_ENC_STOP_CAPTURE, 3, 0, BLACKBIRD_END_NOW, BLACKBIRD_MPEG_CAPTURE, BLACKBIRD_RAW_BITS_NONE ); - /* mute audio source */ - cx_set(AUD_VOL_CTL, (1 << 6)); dev->mpeg_active = 0; return 0; -- cgit v1.2.3 From c085c020a6af7faa8ab0bbf4c010ca9104aa04f0 Mon Sep 17 00:00:00 2001 From: Ricardo Cerqueira Date: Wed, 17 Oct 2007 00:52:08 +0100 Subject: Don't limit cx88 audio routing to blackbird boards From: Ricardo Cerqueira All cx2388 boards need the line-in audio to be routed from an external ADC (refered to as "ADC mode" in the spec sheet), since the chip is uncapable of dealing with baseband audio directly. So... this patch enables normal mode when using the tuner (TV or Radio), and enables ADC mode with any other source. It'll probably only work with boards that have supported ADCs (such as the Wolfson wm9775) Signed-off-by: Ricardo Cerqueira --- linux/drivers/media/video/cx88/cx88-video.c | 46 +++++++++++++++++++---------- 1 file changed, 31 insertions(+), 15 deletions(-) (limited to 'linux') diff --git a/linux/drivers/media/video/cx88/cx88-video.c b/linux/drivers/media/video/cx88/cx88-video.c index 9feb5c4bb..fe6c66a58 100644 --- a/linux/drivers/media/video/cx88/cx88-video.c +++ b/linux/drivers/media/video/cx88/cx88-video.c @@ -408,25 +408,41 @@ int cx88_video_mux(struct cx88_core *core, unsigned int input) break; } - if (core->board.mpeg & CX88_MPEG_BLACKBIRD) { - /* sets sound input from external adc */ - if (INPUT(input).audioroute) { - /* The wm8775 module has the "2" route hardwired into - the initialization. Some boards may use different - routes for different inputs. HVR-1300 surely does */ - if (core->board.audio_chip && - core->board.audio_chip == AUDIO_CHIP_WM8775) { - struct v4l2_routing route; - - route.input = INPUT(input).audioroute; - cx88_call_i2c_clients(core, - VIDIOC_INT_S_AUDIO_ROUTING,&route); - } + /* if there are audioroutes defined, we have an external + ADC to deal with audio */ + + if (INPUT(input).audioroute) { + + /* cx2388's C-ADC is connected to the tuner only. + When used with S-Video, that ADC is busy dealing with + chroma, so an external must be used for baseband audio */ + if (INPUT(input).type != CX88_VMUX_TELEVISION && + INPUT(input).type != CX88_RADIO) { + /* "ADC mode" */ + cx_write(AUD_I2SCNTL, 0x1); cx_set(AUD_CTL, EN_I2SIN_ENABLE); - } else + } else { + /* Normal mode */ + cx_write(AUD_I2SCNTL, 0x0); cx_clear(AUD_CTL, EN_I2SIN_ENABLE); + } + + /* The wm8775 module has the "2" route hardwired into + the initialization. Some boards may use different + routes for different inputs. HVR-1300 surely does */ + if (core->board.audio_chip && + core->board.audio_chip == AUDIO_CHIP_WM8775) { + struct v4l2_routing route; + + route.input = INPUT(input).audioroute; + cx88_call_i2c_clients(core, + VIDIOC_INT_S_AUDIO_ROUTING,&route); + + } + } + return 0; } EXPORT_SYMBOL(cx88_video_mux); -- cgit v1.2.3 From c89810275c44948f74bf45b42b5057353399bc2e Mon Sep 17 00:00:00 2001 From: Ricardo Cerqueira Date: Mon, 5 Nov 2007 21:57:11 +0100 Subject: cx88-video: Enable selection of the WM8775 for cx88 cards From: Frej Drejhammar The auto selection of pertinent helper chips (VIDEO_HELPER_CHIPS_AUTO) should select the wm8775 driver, which is used by at least one Conexant 2388x based card (Hauppauge HVR-1300), if VIDEO_CX88 is selected. Signed-off-by: Frej Drejhammar Signed-off-by: Ricardo Cerqueira --- linux/drivers/media/video/cx88/Kconfig | 1 + 1 file changed, 1 insertion(+) (limited to 'linux') diff --git a/linux/drivers/media/video/cx88/Kconfig b/linux/drivers/media/video/cx88/Kconfig index ceb31d4a2..49d3813a9 100644 --- a/linux/drivers/media/video/cx88/Kconfig +++ b/linux/drivers/media/video/cx88/Kconfig @@ -8,6 +8,7 @@ config VIDEO_CX88 select VIDEO_TUNER select VIDEO_TVEEPROM select VIDEO_IR + select VIDEO_WM8775 if VIDEO_HELPER_CHIPS_AUTO ---help--- This is a video4linux driver for Conexant 2388x based TV cards. -- cgit v1.2.3