Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 25161
b: refs/heads/master
c: 7061561
h: refs/heads/master
i:
  25159: 49ff941
v: v3
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Apr 2, 2006
1 parent 69e64bd commit 0c12179
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dc555aa63c798af097f5c303bcf72a8390b03da5
refs/heads/master: 7061561e640c2947ab93c4e2a437327657c4482e
24 changes: 16 additions & 8 deletions trunk/drivers/media/video/msp3400-kthreads.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ static void msp3400c_set_audmode(struct i2c_client *client)
char *modestr = (state->audmode >= 0 && state->audmode < 5) ?
strmode[state->audmode] : "unknown";
int src = 0; /* channel source: FM/AM, nicam or SCART */
int audmode = state->audmode;

if (state->opmode == OPMODE_AUTOSELECT) {
/* this method would break everything, let's make sure
Expand All @@ -239,11 +240,22 @@ static void msp3400c_set_audmode(struct i2c_client *client)
return;
}

/* If no second language is available, switch to the first language */
if ((audmode == V4L2_TUNER_MODE_LANG2 ||
audmode == V4L2_TUNER_MODE_LANG1_LANG2) &&
!(state->rxsubchans & V4L2_TUNER_SUB_LANG2))
audmode = V4L2_TUNER_MODE_LANG1;
/* switch to stereo for stereo transmission, otherwise
keep first language */
if (audmode == V4L2_TUNER_MODE_LANG1 &&
(state->rxsubchans & V4L2_TUNER_SUB_STEREO))
audmode = V4L2_TUNER_MODE_STEREO;

/* switch demodulator */
switch (state->mode) {
case MSP_MODE_FM_TERRA:
v4l_dbg(1, msp_debug, client, "FM set_audmode: %s\n", modestr);
switch (state->audmode) {
switch (audmode) {
case V4L2_TUNER_MODE_STEREO:
msp_write_dsp(client, 0x000e, 0x3001);
break;
Expand All @@ -257,7 +269,7 @@ static void msp3400c_set_audmode(struct i2c_client *client)
break;
case MSP_MODE_FM_SAT:
v4l_dbg(1, msp_debug, client, "SAT set_audmode: %s\n", modestr);
switch (state->audmode) {
switch (audmode) {
case V4L2_TUNER_MODE_MONO:
msp3400c_set_carrier(client, MSP_CARRIER(6.5), MSP_CARRIER(6.5));
break;
Expand Down Expand Up @@ -296,7 +308,7 @@ static void msp3400c_set_audmode(struct i2c_client *client)
}

/* switch audio */
switch (state->audmode) {
switch (audmode) {
case V4L2_TUNER_MODE_STEREO:
case V4L2_TUNER_MODE_LANG1_LANG2:
src |= 0x0020;
Expand All @@ -314,10 +326,6 @@ static void msp3400c_set_audmode(struct i2c_client *client)
src = 0x0030;
break;
case V4L2_TUNER_MODE_LANG1:
/* switch to stereo for stereo transmission, otherwise
keep first language */
if (state->rxsubchans & V4L2_TUNER_SUB_STEREO)
src |= 0x0020;
break;
case V4L2_TUNER_MODE_LANG2:
src |= 0x0010;
Expand Down Expand Up @@ -612,9 +620,9 @@ int msp3400c_thread(void *data)
if (msp_sleep(state, 1000))
goto restart;
while (state->watch_stereo) {
watch_stereo(client);
if (msp_sleep(state, 5000))
goto restart;
watch_stereo(client);
}
}
v4l_dbg(1, msp_debug, client, "thread: exit\n");
Expand Down

0 comments on commit 0c12179

Please sign in to comment.