/* 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); }
static void set_input(struct pvr2_v4l_decoder *ctxt) { struct pvr2_hdw *hdw = ctxt->hdw; struct v4l2_routing route; pvr2_trace(PVR2_TRACE_CHIPS,"i2c v4l2 set_input(%d)",hdw->input_val); switch(hdw->input_val) { case PVR2_CVAL_INPUT_TV: route.input = SAA7115_COMPOSITE4; break; case PVR2_CVAL_INPUT_COMPOSITE: route.input = SAA7115_COMPOSITE5; break; case PVR2_CVAL_INPUT_SVIDEO: route.input = SAA7115_SVIDEO2; break; case PVR2_CVAL_INPUT_RADIO: // In radio mode, we mute the video, but point at one // spot just to stay consistent route.input = SAA7115_COMPOSITE5; default: return; } route.output = 0; pvr2_i2c_client_cmd(ctxt->client,VIDIOC_INT_S_VIDEO_ROUTING,&route); }
static void set_type(struct pvr2_tuner_handler *ctxt) { struct pvr2_hdw *hdw = ctxt->hdw; struct tuner_setup setup; pvr2_trace(PVR2_TRACE_CHIPS,"i2c tuner set_type(%d)",hdw->tuner_type); if (((int)(hdw->tuner_type)) < 0) return; setup.addr = ADDR_UNSET; setup.type = hdw->tuner_type; setup.mode_mask = T_RADIO | T_ANALOG_TV; /* We may really want mode_mask to be T_ANALOG_TV for now */ pvr2_i2c_client_cmd(ctxt->client,TUNER_SET_TYPE_ADDR,&setup); ctxt->type_update_fl = 0; }
static void set_input(struct pvr2_v4l_cx2584x *ctxt) { struct pvr2_hdw *hdw = ctxt->hdw; struct v4l2_routing route; enum cx25840_video_input vid_input; enum cx25840_audio_input aud_input; memset(&route,0,sizeof(route)); switch(hdw->input_val) { case PVR2_CVAL_INPUT_TV: vid_input = CX25840_COMPOSITE7; aud_input = CX25840_AUDIO8; break; case PVR2_CVAL_INPUT_COMPOSITE: vid_input = CX25840_COMPOSITE3; aud_input = CX25840_AUDIO_SERIAL; break; case PVR2_CVAL_INPUT_SVIDEO: vid_input = CX25840_SVIDEO1; aud_input = CX25840_AUDIO_SERIAL; break; case PVR2_CVAL_INPUT_RADIO: default: // Just set it to be composite input for now... vid_input = CX25840_COMPOSITE3; aud_input = CX25840_AUDIO_SERIAL; break; } pvr2_trace(PVR2_TRACE_CHIPS,"i2c cx2584x set_input vid=0x%x aud=0x%x", vid_input,aud_input); route.input = (u32)vid_input; pvr2_i2c_client_cmd(ctxt->client,VIDIOC_INT_S_VIDEO_ROUTING,&route); route.input = (u32)aud_input; pvr2_i2c_client_cmd(ctxt->client,VIDIOC_INT_S_AUDIO_ROUTING,&route); }
static void set_input(struct pvr2_v4l_wm8775 *ctxt) { struct v4l2_routing route; struct pvr2_hdw *hdw = ctxt->hdw; memset(&route,0,sizeof(route)); switch(hdw->input_val) { case PVR2_CVAL_INPUT_RADIO: route.input = 1; break; default: /* All other cases just use the second input */ route.input = 2; break; } pvr2_trace(PVR2_TRACE_CHIPS,"i2c wm8775 set_input(val=%d route=0x%x)", hdw->input_val,route.input); pvr2_i2c_client_cmd(ctxt->client,VIDIOC_INT_S_AUDIO_ROUTING,&route); }
static void set_audio(struct pvr2_v4l_decoder *ctxt) { u32 val; struct pvr2_hdw *hdw = ctxt->hdw; pvr2_trace(PVR2_TRACE_CHIPS,"i2c v4l2 set_audio %d", hdw->srate_val); switch (hdw->srate_val) { default: case V4L2_MPEG_AUDIO_SAMPLING_FREQ_48000: val = 48000; break; case V4L2_MPEG_AUDIO_SAMPLING_FREQ_44100: val = 44100; break; case V4L2_MPEG_AUDIO_SAMPLING_FREQ_32000: val = 32000; break; } pvr2_i2c_client_cmd(ctxt->client,VIDIOC_INT_AUDIO_CLOCK_FREQ,&val); }
void pvr2_v4l2_cmd_status_poll(struct pvr2_i2c_client *cp) { pvr2_i2c_client_cmd(cp,VIDIOC_G_TUNER,&cp->hdw->tuner_signal_info); }
void pvr2_v4l2_cmd_stream(struct pvr2_i2c_client *cp,int fl) { pvr2_i2c_client_cmd(cp, (fl ? VIDIOC_STREAMON : VIDIOC_STREAMOFF),NULL); }