}
if (scart) {
state->rxsubchans = V4L2_TUNER_SUB_STEREO;
- state->audmode = V4L2_TUNER_MODE_STEREO;
msp_set_scart(client, scart, 0);
msp_write_dsp(client, 0x000d, 0x1900);
if (state->opmode != OPMODE_AUTOSELECT)
return -EINVAL;
}
- msp_any_detect_stereo(client);
- if (state->audmode == V4L2_TUNER_MODE_STEREO) {
- a->capability = V4L2_AUDCAP_STEREO;
- }
-
+ a->capability = V4L2_AUDCAP_STEREO;
+ a->mode = 0; /* TODO: add support for AVL */
break;
}
}
if (scart) {
state->rxsubchans = V4L2_TUNER_SUB_STEREO;
- state->audmode = V4L2_TUNER_MODE_STEREO;
msp_set_scart(client, scart, 0);
msp_write_dsp(client, 0x000d, 0x1900);
}
- if (sarg->capability == V4L2_AUDCAP_STEREO) {
- state->audmode = V4L2_TUNER_MODE_STEREO;
- } else {
- state->audmode &= ~V4L2_TUNER_MODE_STEREO;
- }
msp_any_set_audmode(client, state->audmode);
msp_wake_thread(client);
break;
{
struct v4l2_tuner *vt = (struct v4l2_tuner *)arg;
- if (state->radio)
+ if (state->radio) /* TODO: add mono/stereo support for radio */
break;
/* only set audmode */
- if (vt->audmode != -1 && vt->audmode != 0)
- msp_any_set_audmode(client, vt->audmode);
+ msp_any_set_audmode(client, vt->audmode);
break;
}
return -EINVAL;
}
break;
-
}
case VIDIOC_S_AUDOUT:
memset(state, 0, sizeof(*state));
state->v4l2_std = V4L2_STD_NTSC;
+ state->audmode = V4L2_TUNER_MODE_STEREO;
state->volume = 58880; /* 0db gain */
state->balance = 32768; /* 0db gain */
state->bass = 32768;
v4l_dbg(1, msp_debug, client, "setmode: %d\n", type);
state->mode = type;
- state->audmode = V4L2_TUNER_MODE_MONO;
state->rxsubchans = V4L2_TUNER_SUB_MONO;
msp_write_dem(client, 0x00bb, msp3400c_init_data[type].ad_cv);
}
/* turn on/off nicam + stereo */
-void msp3400c_setstereo(struct i2c_client *client, int mode)
+void msp3400c_setstereo(struct i2c_client *client, int audmode)
{
static char *strmode[] = { "mono", "stereo", "lang2", "lang1" };
struct msp_state *state = i2c_get_clientdata(client);
* it's never called
*/
v4l_dbg(1, msp_debug, client, "setstereo called with mode=%d instead of set_source (ignored)\n",
- mode);
+ audmode);
return;
}
/* switch demodulator */
switch (state->mode) {
case MSP_MODE_FM_TERRA:
- v4l_dbg(1, msp_debug, client, "FM setstereo: %s\n", strmode[mode]);
+ v4l_dbg(1, msp_debug, client, "FM setstereo: %s\n", strmode[audmode]);
msp3400c_setcarrier(client, state->second, state->main);
- switch (mode) {
+ switch (audmode) {
case V4L2_TUNER_MODE_STEREO:
msp_write_dsp(client, 0x000e, 0x3001);
break;
}
break;
case MSP_MODE_FM_SAT:
- v4l_dbg(1, msp_debug, client, "SAT setstereo: %s\n", strmode[mode]);
- switch (mode) {
+ v4l_dbg(1, msp_debug, client, "SAT setstereo: %s\n", strmode[audmode]);
+ switch (audmode) {
case V4L2_TUNER_MODE_MONO:
msp3400c_setcarrier(client, MSP_CARRIER(6.5), MSP_CARRIER(6.5));
break;
case MSP_MODE_FM_NICAM1:
case MSP_MODE_FM_NICAM2:
case MSP_MODE_AM_NICAM:
- v4l_dbg(1, msp_debug, client, "NICAM setstereo: %s\n",strmode[mode]);
+ v4l_dbg(1, msp_debug, client, "NICAM setstereo: %s\n",strmode[audmode]);
msp3400c_setcarrier(client,state->second,state->main);
if (state->nicam_on)
nicam=0x0100;
break;
case MSP_MODE_BTSC:
- v4l_dbg(1, msp_debug, client, "BTSC setstereo: %s\n",strmode[mode]);
+ v4l_dbg(1, msp_debug, client, "BTSC setstereo: %s\n",strmode[audmode]);
nicam=0x0300;
break;
case MSP_MODE_EXTERN:
- v4l_dbg(1, msp_debug, client, "extern setstereo: %s\n",strmode[mode]);
+ v4l_dbg(1, msp_debug, client, "extern setstereo: %s\n",strmode[audmode]);
nicam = 0x0200;
break;
case MSP_MODE_FM_RADIO:
- v4l_dbg(1, msp_debug, client, "FM-Radio setstereo: %s\n",strmode[mode]);
+ v4l_dbg(1, msp_debug, client, "FM-Radio setstereo: %s\n",strmode[audmode]);
break;
default:
v4l_dbg(1, msp_debug, client, "mono setstereo\n");
}
/* switch audio */
- switch (mode) {
+ switch (audmode) {
case V4L2_TUNER_MODE_STEREO:
src = 0x0020 | nicam;
break;
case 0x0040: /* FM radio */
state->mode = MSP_MODE_FM_RADIO;
state->rxsubchans = V4L2_TUNER_SUB_STEREO;
- state->audmode = V4L2_TUNER_MODE_STEREO;
state->nicam_on = 0;
state->watch_stereo = 0;
/* not needed in theory if we have radio, but
case 0x0005:
state->mode = MSP_MODE_FM_TERRA;
state->rxsubchans = V4L2_TUNER_SUB_MONO;
- state->audmode = V4L2_TUNER_MODE_MONO;
state->nicam_on = 0;
state->watch_stereo = 1;
break;