diff options
Diffstat (limited to 'drivers/media/video')
-rw-r--r-- | drivers/media/video/cx88/cx88-tvaudio.c | 51 |
1 files changed, 33 insertions, 18 deletions
diff --git a/drivers/media/video/cx88/cx88-tvaudio.c b/drivers/media/video/cx88/cx88-tvaudio.c index f9501eb8557c..0a8699fa7292 100644 --- a/drivers/media/video/cx88/cx88-tvaudio.c +++ b/drivers/media/video/cx88/cx88-tvaudio.c | |||
@@ -976,24 +976,39 @@ int cx88_audio_thread(void *data) | |||
976 | break; | 976 | break; |
977 | try_to_freeze(); | 977 | try_to_freeze(); |
978 | 978 | ||
979 | /* just monitor the audio status for now ... */ | 979 | switch (core->tvaudio) { |
980 | memset(&t, 0, sizeof(t)); | 980 | case WW_BG: |
981 | cx88_get_stereo(core, &t); | 981 | case WW_DK: |
982 | 982 | case WW_M: | |
983 | if (UNSET != core->audiomode_manual) | 983 | case WW_I: |
984 | /* manually set, don't do anything. */ | 984 | case WW_L: |
985 | continue; | 985 | if (core->use_nicam) |
986 | 986 | goto hw_autodetect; | |
987 | /* monitor signal */ | 987 | |
988 | if (t.rxsubchans & V4L2_TUNER_SUB_STEREO) | 988 | /* just monitor the audio status for now ... */ |
989 | mode = V4L2_TUNER_MODE_STEREO; | 989 | memset(&t, 0, sizeof(t)); |
990 | else | 990 | cx88_get_stereo(core, &t); |
991 | mode = V4L2_TUNER_MODE_MONO; | 991 | |
992 | if (mode == core->audiomode_current) | 992 | if (UNSET != core->audiomode_manual) |
993 | continue; | 993 | /* manually set, don't do anything. */ |
994 | 994 | continue; | |
995 | /* automatically switch to best available mode */ | 995 | |
996 | cx88_set_stereo(core, mode, 0); | 996 | /* monitor signal and set stereo if available */ |
997 | if (t.rxsubchans & V4L2_TUNER_SUB_STEREO) | ||
998 | mode = V4L2_TUNER_MODE_STEREO; | ||
999 | else | ||
1000 | mode = V4L2_TUNER_MODE_MONO; | ||
1001 | if (mode == core->audiomode_current) | ||
1002 | continue; | ||
1003 | /* automatically switch to best available mode */ | ||
1004 | cx88_set_stereo(core, mode, 0); | ||
1005 | break; | ||
1006 | default: | ||
1007 | hw_autodetect: | ||
1008 | /* stereo autodetection is supported by hardware so | ||
1009 | we don't need to do it manually. Do nothing. */ | ||
1010 | break; | ||
1011 | } | ||
997 | } | 1012 | } |
998 | 1013 | ||
999 | dprintk("cx88: tvaudio thread exiting\n"); | 1014 | dprintk("cx88: tvaudio thread exiting\n"); |