/* Selects the audio input and output according to the current settings. */ void ivtv_audio_set_io(struct ivtv *itv) { const struct ivtv_card_audio_input *in; u32 input, output = 0; /* Determine which input to use */ if (test_bit(IVTV_F_I_RADIO_USER, &itv->i_flags)) in = &itv->card->radio_input; else in = &itv->card->audio_inputs[itv->audio_input]; /* handle muxer chips */ input = in->muxer_input; if (itv->card->hw_muxer & IVTV_HW_M52790) output = M52790_OUT_STEREO; v4l2_subdev_call(itv->sd_muxer, audio, s_routing, input, output, 0); input = in->audio_input; output = 0; if (itv->card->hw_audio & IVTV_HW_MSP34XX) output = MSP_OUTPUT(MSP_SC_IN_DSP_SCART1); ivtv_call_hw(itv, itv->card->hw_audio, audio, s_routing, input, output, 0); }
/* This function selects the correct audio input source */ static void set_stereo(struct pvr2_msp3400_handler *ctxt) { struct pvr2_hdw *hdw = ctxt->hdw; struct v4l2_routing route; pvr2_trace(PVR2_TRACE_CHIPS,"i2c msp3400 v4l2 set_stereo"); route.input = MSP_INPUT_DEFAULT; route.output = MSP_OUTPUT(MSP_SC_IN_DSP_SCART1); switch (hdw->input_val) { case PVR2_CVAL_INPUT_TV: break; case PVR2_CVAL_INPUT_RADIO: /* Assume that msp34xx also handle FM decoding, in which case we're still using the tuner. */ /* HV: actually it is more likely to be the SCART2 input if the ivtv experience is any indication. */ route.input = MSP_INPUT(MSP_IN_SCART2, MSP_IN_TUNER1, MSP_DSP_IN_SCART, MSP_DSP_IN_SCART); break; case PVR2_CVAL_INPUT_SVIDEO: case PVR2_CVAL_INPUT_COMPOSITE: /* SCART 1 input */ route.input = MSP_INPUT(MSP_IN_SCART1, MSP_IN_TUNER1, MSP_DSP_IN_SCART, MSP_DSP_IN_SCART); break; } pvr2_i2c_client_cmd(ctxt->client,VIDIOC_INT_S_AUDIO_ROUTING,&route); }
void tl880_msp_config(struct tl880_dev *tl880dev) { unsigned short msp_type[2]; struct v4l2_routing msp_routing; int standard; printk(KERN_DEBUG "tl880: Configuring the MSP chip\n"); #ifdef WILLNOTCOMPILE tl880_msp_set_std(tl880dev, /* gpJanus+16714 */ 2); #endif memset(&msp_routing, 0, sizeof(msp_routing)); // TODO: call only the MSP standard = V4L2_STD_NTSC_M; tl880_call_i2c_clients(tl880dev, VIDIOC_S_STD, (void *)&standard); tl880_call_i2c_clients(tl880dev, VIDIOC_INT_G_AUDIO_ROUTING, (void *)&msp_routing); printk(KERN_DEBUG "tl880: msp routing is %04x by %04x\n", msp_routing.input, msp_routing.output); msp_routing.input = MSP_INPUT(MSP_IN_MUTE, MSP_IN_TUNER1, MSP_DSP_IN_TUNER, MSP_DSP_IN_TUNER); msp_routing.output = MSP_OUTPUT(MSP_SC_IN_MUTE); printk(KERN_DEBUG "tl880: setting msp routing to %04x x %04x\n", msp_routing.input, msp_routing.output); tl880_call_i2c_clients(tl880dev, VIDIOC_INT_S_AUDIO_ROUTING, (void *)&msp_routing); tl880_msp_init(tl880dev, msp_type); }