diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2006-01-23 06:46:02 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@brturbo.com.br> | 2006-01-23 06:46:02 -0500 |
commit | 53a7240416adabb84e32334a9f118b7f05392ba2 (patch) | |
tree | 3589d708545b4ba84fcdc39b696f4bd7269dcd5f /drivers/media/video/msp3400-kthreads.c | |
parent | b639f9d286f2216795492eac2a39b8ed6b4d555c (diff) |
V4L/DVB (3402): Fix handling of VIDIOC_G_TUNER audmode in msp3400
- Fix handling of VIDIOC_G_TUNER audmode in msp3400: audmode
is only changed by the user with S_TUNER, never by the driver.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/msp3400-kthreads.c')
-rw-r--r-- | drivers/media/video/msp3400-kthreads.c | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/drivers/media/video/msp3400-kthreads.c b/drivers/media/video/msp3400-kthreads.c index 2072c3efebb3..3235a15db59f 100644 --- a/drivers/media/video/msp3400-kthreads.c +++ b/drivers/media/video/msp3400-kthreads.c | |||
@@ -170,7 +170,6 @@ void msp3400c_setmode(struct i2c_client *client, int type) | |||
170 | 170 | ||
171 | v4l_dbg(1, msp_debug, client, "setmode: %d\n", type); | 171 | v4l_dbg(1, msp_debug, client, "setmode: %d\n", type); |
172 | state->mode = type; | 172 | state->mode = type; |
173 | state->audmode = V4L2_TUNER_MODE_MONO; | ||
174 | state->rxsubchans = V4L2_TUNER_SUB_MONO; | 173 | state->rxsubchans = V4L2_TUNER_SUB_MONO; |
175 | 174 | ||
176 | msp_write_dem(client, 0x00bb, msp3400c_init_data[type].ad_cv); | 175 | msp_write_dem(client, 0x00bb, msp3400c_init_data[type].ad_cv); |
@@ -210,7 +209,7 @@ void msp3400c_setmode(struct i2c_client *client, int type) | |||
210 | } | 209 | } |
211 | 210 | ||
212 | /* turn on/off nicam + stereo */ | 211 | /* turn on/off nicam + stereo */ |
213 | void msp3400c_setstereo(struct i2c_client *client, int mode) | 212 | void msp3400c_setstereo(struct i2c_client *client, int audmode) |
214 | { | 213 | { |
215 | static char *strmode[] = { "mono", "stereo", "lang2", "lang1" }; | 214 | static char *strmode[] = { "mono", "stereo", "lang2", "lang1" }; |
216 | struct msp_state *state = i2c_get_clientdata(client); | 215 | struct msp_state *state = i2c_get_clientdata(client); |
@@ -222,16 +221,16 @@ void msp3400c_setstereo(struct i2c_client *client, int mode) | |||
222 | * it's never called | 221 | * it's never called |
223 | */ | 222 | */ |
224 | v4l_dbg(1, msp_debug, client, "setstereo called with mode=%d instead of set_source (ignored)\n", | 223 | v4l_dbg(1, msp_debug, client, "setstereo called with mode=%d instead of set_source (ignored)\n", |
225 | mode); | 224 | audmode); |
226 | return; | 225 | return; |
227 | } | 226 | } |
228 | 227 | ||
229 | /* switch demodulator */ | 228 | /* switch demodulator */ |
230 | switch (state->mode) { | 229 | switch (state->mode) { |
231 | case MSP_MODE_FM_TERRA: | 230 | case MSP_MODE_FM_TERRA: |
232 | v4l_dbg(1, msp_debug, client, "FM setstereo: %s\n", strmode[mode]); | 231 | v4l_dbg(1, msp_debug, client, "FM setstereo: %s\n", strmode[audmode]); |
233 | msp3400c_setcarrier(client, state->second, state->main); | 232 | msp3400c_setcarrier(client, state->second, state->main); |
234 | switch (mode) { | 233 | switch (audmode) { |
235 | case V4L2_TUNER_MODE_STEREO: | 234 | case V4L2_TUNER_MODE_STEREO: |
236 | msp_write_dsp(client, 0x000e, 0x3001); | 235 | msp_write_dsp(client, 0x000e, 0x3001); |
237 | break; | 236 | break; |
@@ -243,8 +242,8 @@ void msp3400c_setstereo(struct i2c_client *client, int mode) | |||
243 | } | 242 | } |
244 | break; | 243 | break; |
245 | case MSP_MODE_FM_SAT: | 244 | case MSP_MODE_FM_SAT: |
246 | v4l_dbg(1, msp_debug, client, "SAT setstereo: %s\n", strmode[mode]); | 245 | v4l_dbg(1, msp_debug, client, "SAT setstereo: %s\n", strmode[audmode]); |
247 | switch (mode) { | 246 | switch (audmode) { |
248 | case V4L2_TUNER_MODE_MONO: | 247 | case V4L2_TUNER_MODE_MONO: |
249 | msp3400c_setcarrier(client, MSP_CARRIER(6.5), MSP_CARRIER(6.5)); | 248 | msp3400c_setcarrier(client, MSP_CARRIER(6.5), MSP_CARRIER(6.5)); |
250 | break; | 249 | break; |
@@ -262,21 +261,21 @@ void msp3400c_setstereo(struct i2c_client *client, int mode) | |||
262 | case MSP_MODE_FM_NICAM1: | 261 | case MSP_MODE_FM_NICAM1: |
263 | case MSP_MODE_FM_NICAM2: | 262 | case MSP_MODE_FM_NICAM2: |
264 | case MSP_MODE_AM_NICAM: | 263 | case MSP_MODE_AM_NICAM: |
265 | v4l_dbg(1, msp_debug, client, "NICAM setstereo: %s\n",strmode[mode]); | 264 | v4l_dbg(1, msp_debug, client, "NICAM setstereo: %s\n",strmode[audmode]); |
266 | msp3400c_setcarrier(client,state->second,state->main); | 265 | msp3400c_setcarrier(client,state->second,state->main); |
267 | if (state->nicam_on) | 266 | if (state->nicam_on) |
268 | nicam=0x0100; | 267 | nicam=0x0100; |
269 | break; | 268 | break; |
270 | case MSP_MODE_BTSC: | 269 | case MSP_MODE_BTSC: |
271 | v4l_dbg(1, msp_debug, client, "BTSC setstereo: %s\n",strmode[mode]); | 270 | v4l_dbg(1, msp_debug, client, "BTSC setstereo: %s\n",strmode[audmode]); |
272 | nicam=0x0300; | 271 | nicam=0x0300; |
273 | break; | 272 | break; |
274 | case MSP_MODE_EXTERN: | 273 | case MSP_MODE_EXTERN: |
275 | v4l_dbg(1, msp_debug, client, "extern setstereo: %s\n",strmode[mode]); | 274 | v4l_dbg(1, msp_debug, client, "extern setstereo: %s\n",strmode[audmode]); |
276 | nicam = 0x0200; | 275 | nicam = 0x0200; |
277 | break; | 276 | break; |
278 | case MSP_MODE_FM_RADIO: | 277 | case MSP_MODE_FM_RADIO: |
279 | v4l_dbg(1, msp_debug, client, "FM-Radio setstereo: %s\n",strmode[mode]); | 278 | v4l_dbg(1, msp_debug, client, "FM-Radio setstereo: %s\n",strmode[audmode]); |
280 | break; | 279 | break; |
281 | default: | 280 | default: |
282 | v4l_dbg(1, msp_debug, client, "mono setstereo\n"); | 281 | v4l_dbg(1, msp_debug, client, "mono setstereo\n"); |
@@ -284,7 +283,7 @@ void msp3400c_setstereo(struct i2c_client *client, int mode) | |||
284 | } | 283 | } |
285 | 284 | ||
286 | /* switch audio */ | 285 | /* switch audio */ |
287 | switch (mode) { | 286 | switch (audmode) { |
288 | case V4L2_TUNER_MODE_STEREO: | 287 | case V4L2_TUNER_MODE_STEREO: |
289 | src = 0x0020 | nicam; | 288 | src = 0x0020 | nicam; |
290 | break; | 289 | break; |
@@ -759,7 +758,6 @@ int msp3410d_thread(void *data) | |||
759 | case 0x0040: /* FM radio */ | 758 | case 0x0040: /* FM radio */ |
760 | state->mode = MSP_MODE_FM_RADIO; | 759 | state->mode = MSP_MODE_FM_RADIO; |
761 | state->rxsubchans = V4L2_TUNER_SUB_STEREO; | 760 | state->rxsubchans = V4L2_TUNER_SUB_STEREO; |
762 | state->audmode = V4L2_TUNER_MODE_STEREO; | ||
763 | state->nicam_on = 0; | 761 | state->nicam_on = 0; |
764 | state->watch_stereo = 0; | 762 | state->watch_stereo = 0; |
765 | /* not needed in theory if we have radio, but | 763 | /* not needed in theory if we have radio, but |
@@ -779,7 +777,6 @@ int msp3410d_thread(void *data) | |||
779 | case 0x0005: | 777 | case 0x0005: |
780 | state->mode = MSP_MODE_FM_TERRA; | 778 | state->mode = MSP_MODE_FM_TERRA; |
781 | state->rxsubchans = V4L2_TUNER_SUB_MONO; | 779 | state->rxsubchans = V4L2_TUNER_SUB_MONO; |
782 | state->audmode = V4L2_TUNER_MODE_MONO; | ||
783 | state->nicam_on = 0; | 780 | state->nicam_on = 0; |
784 | state->watch_stereo = 1; | 781 | state->watch_stereo = 1; |
785 | break; | 782 | break; |