diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2006-01-09 15:21:37 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@brturbo.com.br> | 2006-01-09 15:21:37 -0500 |
commit | 5af0c8f6a09534ebc6c56b4e5d79d0d521364750 (patch) | |
tree | abc3f4ed2281d5113c053997b1fa2e6b44283b38 /drivers | |
parent | 5b0fa4fff17d944b6a0d4cb35d8e8b5ad0ac3669 (diff) |
V4L/DVB (3326): Fix stereo and standard reporting of msp3400 (esp. for radio)
- Add VIDIOC_LOG_STATUS to the radio device ioctl list.
- Reduce the confusion between modes and standards
- Fix stereo reporting for radio.
- Don't set i2c configuration if the chip doesn't support it.
- Fix reporting of current standard for radio.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/video/bttv-driver.c | 1 | ||||
-rw-r--r-- | drivers/media/video/msp3400-driver.c | 62 | ||||
-rw-r--r-- | drivers/media/video/msp3400-kthreads.c | 68 | ||||
-rw-r--r-- | drivers/media/video/msp3400.h | 28 |
4 files changed, 100 insertions, 59 deletions
diff --git a/drivers/media/video/bttv-driver.c b/drivers/media/video/bttv-driver.c index f3de85251719..0e6970346788 100644 --- a/drivers/media/video/bttv-driver.c +++ b/drivers/media/video/bttv-driver.c | |||
@@ -3220,6 +3220,7 @@ static int radio_do_ioctl(struct inode *inode, struct file *file, | |||
3220 | case VIDIOCSFREQ: | 3220 | case VIDIOCSFREQ: |
3221 | case VIDIOCGAUDIO: | 3221 | case VIDIOCGAUDIO: |
3222 | case VIDIOCSAUDIO: | 3222 | case VIDIOCSAUDIO: |
3223 | case VIDIOC_LOG_STATUS: | ||
3223 | return bttv_common_ioctls(btv,cmd,arg); | 3224 | return bttv_common_ioctls(btv,cmd,arg); |
3224 | 3225 | ||
3225 | default: | 3226 | default: |
diff --git a/drivers/media/video/msp3400-driver.c b/drivers/media/video/msp3400-driver.c index 04a05d7dd470..aa8c556b6ba1 100644 --- a/drivers/media/video/msp3400-driver.c +++ b/drivers/media/video/msp3400-driver.c | |||
@@ -345,7 +345,7 @@ int msp_modus(struct i2c_client *client) | |||
345 | return 0x0003; | 345 | return 0x0003; |
346 | } | 346 | } |
347 | 347 | ||
348 | if (state->std & V4L2_STD_PAL) { | 348 | if (state->v4l2_std & V4L2_STD_PAL) { |
349 | v4l_dbg(1, client, "video mode selected to PAL\n"); | 349 | v4l_dbg(1, client, "video mode selected to PAL\n"); |
350 | 350 | ||
351 | #if 1 | 351 | #if 1 |
@@ -356,11 +356,11 @@ int msp_modus(struct i2c_client *client) | |||
356 | return 0x1003; | 356 | return 0x1003; |
357 | #endif | 357 | #endif |
358 | } | 358 | } |
359 | if (state->std & V4L2_STD_NTSC) { | 359 | if (state->v4l2_std & V4L2_STD_NTSC) { |
360 | v4l_dbg(1, client, "video mode selected to NTSC\n"); | 360 | v4l_dbg(1, client, "video mode selected to NTSC\n"); |
361 | return 0x2003; | 361 | return 0x2003; |
362 | } | 362 | } |
363 | if (state->std & V4L2_STD_SECAM) { | 363 | if (state->v4l2_std & V4L2_STD_SECAM) { |
364 | v4l_dbg(1, client, "video mode selected to SECAM\n"); | 364 | v4l_dbg(1, client, "video mode selected to SECAM\n"); |
365 | return 0x0003; | 365 | return 0x0003; |
366 | } | 366 | } |
@@ -663,6 +663,8 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg) | |||
663 | break; | 663 | break; |
664 | 664 | ||
665 | case AUDC_SET_RADIO: | 665 | case AUDC_SET_RADIO: |
666 | if (state->radio) | ||
667 | return 0; | ||
666 | state->radio = 1; | 668 | state->radio = 1; |
667 | v4l_dbg(1, client, "switching to radio mode\n"); | 669 | v4l_dbg(1, client, "switching to radio mode\n"); |
668 | state->watch_stereo = 0; | 670 | state->watch_stereo = 0; |
@@ -701,6 +703,8 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg) | |||
701 | va->bass = state->bass; | 703 | va->bass = state->bass; |
702 | va->treble = state->treble; | 704 | va->treble = state->treble; |
703 | 705 | ||
706 | if (state->radio) | ||
707 | break; | ||
704 | if (state->opmode == OPMODE_AUTOSELECT) | 708 | if (state->opmode == OPMODE_AUTOSELECT) |
705 | msp_any_detect_stereo(client); | 709 | msp_any_detect_stereo(client); |
706 | va->mode = msp_mode_v4l2_to_v4l1(state->rxsubchans); | 710 | va->mode = msp_mode_v4l2_to_v4l1(state->rxsubchans); |
@@ -738,8 +742,8 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg) | |||
738 | std = V4L2_STD_SECAM; | 742 | std = V4L2_STD_SECAM; |
739 | else | 743 | else |
740 | std = V4L2_STD_NTSC; | 744 | std = V4L2_STD_NTSC; |
741 | if (std != state->std) { | 745 | if (std != state->v4l2_std) { |
742 | state->std = std; | 746 | state->v4l2_std = std; |
743 | update = 1; | 747 | update = 1; |
744 | } | 748 | } |
745 | if (update) | 749 | if (update) |
@@ -768,9 +772,9 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg) | |||
768 | case VIDIOC_S_STD: | 772 | case VIDIOC_S_STD: |
769 | { | 773 | { |
770 | v4l2_std_id *id = arg; | 774 | v4l2_std_id *id = arg; |
771 | int update = state->radio || state->std != *id; | 775 | int update = state->radio || state->v4l2_std != *id; |
772 | 776 | ||
773 | state->std = *id; | 777 | state->v4l2_std = *id; |
774 | state->radio = 0; | 778 | state->radio = 0; |
775 | if (update) | 779 | if (update) |
776 | msp_wake_thread(client); | 780 | msp_wake_thread(client); |
@@ -879,6 +883,8 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg) | |||
879 | { | 883 | { |
880 | struct v4l2_tuner *vt = arg; | 884 | struct v4l2_tuner *vt = arg; |
881 | 885 | ||
886 | if (state->radio) | ||
887 | break; | ||
882 | if (state->opmode == OPMODE_AUTOSELECT) | 888 | if (state->opmode == OPMODE_AUTOSELECT) |
883 | msp_any_detect_stereo(client); | 889 | msp_any_detect_stereo(client); |
884 | vt->audmode = state->audmode; | 890 | vt->audmode = state->audmode; |
@@ -892,6 +898,8 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg) | |||
892 | { | 898 | { |
893 | struct v4l2_tuner *vt = (struct v4l2_tuner *)arg; | 899 | struct v4l2_tuner *vt = (struct v4l2_tuner *)arg; |
894 | 900 | ||
901 | if (state->radio) | ||
902 | break; | ||
895 | /* only set audmode */ | 903 | /* only set audmode */ |
896 | if (vt->audmode != -1 && vt->audmode != 0) | 904 | if (vt->audmode != -1 && vt->audmode != 0) |
897 | msp_any_set_audmode(client, vt->audmode); | 905 | msp_any_set_audmode(client, vt->audmode); |
@@ -981,22 +989,46 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg) | |||
981 | return msp_set_ctrl(client, arg); | 989 | return msp_set_ctrl(client, arg); |
982 | 990 | ||
983 | case VIDIOC_LOG_STATUS: | 991 | case VIDIOC_LOG_STATUS: |
992 | { | ||
993 | const char *p; | ||
994 | |||
984 | if (state->opmode == OPMODE_AUTOSELECT) | 995 | if (state->opmode == OPMODE_AUTOSELECT) |
985 | msp_any_detect_stereo(client); | 996 | msp_any_detect_stereo(client); |
986 | v4l_info(client, "%s rev1 = 0x%04x rev2 = 0x%04x\n", | 997 | v4l_info(client, "%s rev1 = 0x%04x rev2 = 0x%04x\n", |
987 | client->name, state->rev1, state->rev2); | 998 | client->name, state->rev1, state->rev2); |
988 | v4l_info(client, "Audio: volume %d%s\n", | 999 | v4l_info(client, "Audio: volume %d%s\n", |
989 | state->volume, state->muted ? " (muted)" : ""); | 1000 | state->volume, state->muted ? " (muted)" : ""); |
990 | if (state->has_sound_processing) { | 1001 | if (state->has_sound_processing) { |
991 | v4l_info(client, "Audio: balance %d bass %d treble %d loudness %s\n", | 1002 | v4l_info(client, "Audio: balance %d bass %d treble %d loudness %s\n", |
992 | state->balance, state->bass, state->treble, | 1003 | state->balance, state->bass, state->treble, |
993 | state->loudness ? "on" : "off"); | 1004 | state->loudness ? "on" : "off"); |
994 | } | 1005 | } |
995 | v4l_info(client, "Mode: %s (%s%s)\n", msp_standard_mode_name(state->mode), | 1006 | switch (state->mode) { |
996 | (state->rxsubchans & V4L2_TUNER_SUB_STEREO) ? "stereo" : "mono", | 1007 | case MSP_MODE_AM_DETECT: p = "AM (for carrier detect)"; break; |
997 | (state->rxsubchans & V4L2_TUNER_SUB_LANG2) ? ", dual" : ""); | 1008 | case MSP_MODE_FM_RADIO: p = "FM Radio"; break; |
998 | v4l_info(client, "ACB: 0x%04x\n", state->acb); | 1009 | case MSP_MODE_FM_TERRA: p = "Terrestial FM-mono + FM-stereo"; break; |
1010 | case MSP_MODE_FM_SAT: p = "Satellite FM-mono"; break; | ||
1011 | case MSP_MODE_FM_NICAM1: p = "NICAM/FM (B/G, D/K)"; break; | ||
1012 | case MSP_MODE_FM_NICAM2: p = "NICAM/FM (I)"; break; | ||
1013 | case MSP_MODE_AM_NICAM: p = "NICAM/AM (L)"; break; | ||
1014 | case MSP_MODE_BTSC: p = "BTSC"; break; | ||
1015 | case MSP_MODE_EXTERN: p = "External input"; break; | ||
1016 | default: p = "unknown"; break; | ||
1017 | } | ||
1018 | if (state->opmode == OPMODE_MANUAL) { | ||
1019 | v4l_info(client, "Mode: %s (%s%s)\n", p, | ||
1020 | (state->rxsubchans & V4L2_TUNER_SUB_STEREO) ? "stereo" : "mono", | ||
1021 | (state->rxsubchans & V4L2_TUNER_SUB_LANG2) ? ", dual" : ""); | ||
1022 | } else { | ||
1023 | v4l_info(client, "Mode: %s\n", p); | ||
1024 | v4l_info(client, "Standard: %s (%s%s)\n", | ||
1025 | msp_standard_std_name(state->std), | ||
1026 | (state->rxsubchans & V4L2_TUNER_SUB_STEREO) ? "stereo" : "mono", | ||
1027 | (state->rxsubchans & V4L2_TUNER_SUB_LANG2) ? ", dual" : ""); | ||
1028 | } | ||
1029 | v4l_info(client, "ACB: 0x%04x\n", state->acb); | ||
999 | break; | 1030 | break; |
1031 | } | ||
1000 | 1032 | ||
1001 | default: | 1033 | default: |
1002 | /* nothing */ | 1034 | /* nothing */ |
@@ -1061,7 +1093,7 @@ static int msp_attach(struct i2c_adapter *adapter, int address, int kind) | |||
1061 | i2c_set_clientdata(client, state); | 1093 | i2c_set_clientdata(client, state); |
1062 | 1094 | ||
1063 | memset(state, 0, sizeof(*state)); | 1095 | memset(state, 0, sizeof(*state)); |
1064 | state->std = V4L2_STD_NTSC; | 1096 | state->v4l2_std = V4L2_STD_NTSC; |
1065 | state->volume = 58880; /* 0db gain */ | 1097 | state->volume = 58880; /* 0db gain */ |
1066 | state->balance = 32768; /* 0db gain */ | 1098 | state->balance = 32768; /* 0db gain */ |
1067 | state->bass = 32768; | 1099 | state->bass = 32768; |
@@ -1109,6 +1141,8 @@ static int msp_attach(struct i2c_adapter *adapter, int address, int kind) | |||
1109 | state->has_scart23_in_scart2_out = msp_family >= 4 || msp_prod_lo < 5; | 1141 | state->has_scart23_in_scart2_out = msp_family >= 4 || msp_prod_lo < 5; |
1110 | /* Has scart2 a volume control? Not in pre-D revisions. */ | 1142 | /* Has scart2 a volume control? Not in pre-D revisions. */ |
1111 | state->has_scart2_out_volume = msp_revision > 'C' && state->has_scart23_in_scart2_out; | 1143 | state->has_scart2_out_volume = msp_revision > 'C' && state->has_scart23_in_scart2_out; |
1144 | /* Has a configurable i2s out? */ | ||
1145 | state->has_i2s_conf = msp_revision >= 'G' && msp_prod_lo < 7; | ||
1112 | /* Has subwoofer output: not in pre-D revs and not in stripped down products */ | 1146 | /* Has subwoofer output: not in pre-D revs and not in stripped down products */ |
1113 | state->has_subwoofer = msp_revision >= 'D' && msp_prod_lo < 5; | 1147 | state->has_subwoofer = msp_revision >= 'D' && msp_prod_lo < 5; |
1114 | /* Has soundprocessing (bass/treble/balance/loudness/equalizer): not in | 1148 | /* Has soundprocessing (bass/treble/balance/loudness/equalizer): not in |
diff --git a/drivers/media/video/msp3400-kthreads.c b/drivers/media/video/msp3400-kthreads.c index 14a425a6ff85..2b59b6847535 100644 --- a/drivers/media/video/msp3400-kthreads.c +++ b/drivers/media/video/msp3400-kthreads.c | |||
@@ -37,7 +37,7 @@ static struct { | |||
37 | int retval; | 37 | int retval; |
38 | int main, second; | 38 | int main, second; |
39 | char *name; | 39 | char *name; |
40 | } msp_modelist[] = { | 40 | } msp_stdlist[] = { |
41 | { 0x0000, 0, 0, "could not detect sound standard" }, | 41 | { 0x0000, 0, 0, "could not detect sound standard" }, |
42 | { 0x0001, 0, 0, "autodetect start" }, | 42 | { 0x0001, 0, 0, "autodetect start" }, |
43 | { 0x0002, MSP_CARRIER(4.5), MSP_CARRIER(4.72), "4.5/4.72 M Dual FM-Stereo" }, | 43 | { 0x0002, MSP_CARRIER(4.5), MSP_CARRIER(4.72), "4.5/4.72 M Dual FM-Stereo" }, |
@@ -144,13 +144,13 @@ static struct msp3400c_carrier_detect msp3400c_carrier_detect_65[] = { | |||
144 | 144 | ||
145 | /* ------------------------------------------------------------------------ */ | 145 | /* ------------------------------------------------------------------------ */ |
146 | 146 | ||
147 | const char *msp_standard_mode_name(int mode) | 147 | const char *msp_standard_std_name(int std) |
148 | { | 148 | { |
149 | int i; | 149 | int i; |
150 | 150 | ||
151 | for (i = 0; msp_modelist[i].name != NULL; i++) | 151 | for (i = 0; msp_stdlist[i].name != NULL; i++) |
152 | if (msp_modelist[i].retval == mode) | 152 | if (msp_stdlist[i].retval == std) |
153 | return msp_modelist[i].name; | 153 | return msp_stdlist[i].name; |
154 | return "unknown"; | 154 | return "unknown"; |
155 | } | 155 | } |
156 | 156 | ||
@@ -498,7 +498,7 @@ int msp3400c_thread(void *data) | |||
498 | cd = msp3400c_carrier_detect_main; | 498 | cd = msp3400c_carrier_detect_main; |
499 | count = ARRAY_SIZE(msp3400c_carrier_detect_main); | 499 | count = ARRAY_SIZE(msp3400c_carrier_detect_main); |
500 | 500 | ||
501 | if (amsound && (state->std & V4L2_STD_SECAM)) { | 501 | if (amsound && (state->v4l2_std & V4L2_STD_SECAM)) { |
502 | /* autodetect doesn't work well with AM ... */ | 502 | /* autodetect doesn't work well with AM ... */ |
503 | max1 = 3; | 503 | max1 = 3; |
504 | count = 0; | 504 | count = 0; |
@@ -535,7 +535,7 @@ int msp3400c_thread(void *data) | |||
535 | break; | 535 | break; |
536 | } | 536 | } |
537 | 537 | ||
538 | if (amsound && (state->std & V4L2_STD_SECAM)) { | 538 | if (amsound && (state->v4l2_std & V4L2_STD_SECAM)) { |
539 | /* autodetect doesn't work well with AM ... */ | 539 | /* autodetect doesn't work well with AM ... */ |
540 | cd = NULL; | 540 | cd = NULL; |
541 | count = 0; | 541 | count = 0; |
@@ -591,7 +591,7 @@ int msp3400c_thread(void *data) | |||
591 | state->nicam_on = 0; | 591 | state->nicam_on = 0; |
592 | msp3400c_setstereo(client, V4L2_TUNER_MODE_MONO); | 592 | msp3400c_setstereo(client, V4L2_TUNER_MODE_MONO); |
593 | state->watch_stereo = 1; | 593 | state->watch_stereo = 1; |
594 | } else if (max2 == 0 && (state->std & V4L2_STD_SECAM)) { | 594 | } else if (max2 == 0 && (state->v4l2_std & V4L2_STD_SECAM)) { |
595 | /* L NICAM or AM-mono */ | 595 | /* L NICAM or AM-mono */ |
596 | state->second = msp3400c_carrier_detect_65[max2].cdo; | 596 | state->second = msp3400c_carrier_detect_65[max2].cdo; |
597 | msp3400c_setmode(client, MSP_MODE_AM_NICAM); | 597 | msp3400c_setmode(client, MSP_MODE_AM_NICAM); |
@@ -676,22 +676,22 @@ int msp3410d_thread(void *data) | |||
676 | goto restart; | 676 | goto restart; |
677 | 677 | ||
678 | /* start autodetect */ | 678 | /* start autodetect */ |
679 | std = 1; | 679 | if (state->radio) |
680 | if (state->std & V4L2_STD_NTSC) | 680 | std = 0x40; |
681 | std = 0x20; | ||
682 | else | 681 | else |
683 | msp_write_dem(client, 0x20, std); | 682 | std = (state->v4l2_std & V4L2_STD_NTSC) ? 0x20 : 1; |
684 | state->watch_stereo = 0; | 683 | state->watch_stereo = 0; |
685 | 684 | ||
686 | if (debug) | 685 | if (debug) |
687 | v4l_dbg(1, client, "setting mode: %s (0x%04x)\n", | 686 | v4l_dbg(1, client, "setting standard: %s (0x%04x)\n", |
688 | msp_standard_mode_name(std), std); | 687 | msp_standard_std_name(std), std); |
689 | 688 | ||
690 | if (std != 1) { | 689 | if (std != 1) { |
691 | /* programmed some specific mode */ | 690 | /* programmed some specific mode */ |
692 | val = std; | 691 | val = std; |
693 | } else { | 692 | } else { |
694 | /* triggered autodetect */ | 693 | /* triggered autodetect */ |
694 | msp_write_dem(client, 0x20, std); | ||
695 | for (;;) { | 695 | for (;;) { |
696 | if (msp_sleep(state, 100)) | 696 | if (msp_sleep(state, 100)) |
697 | goto restart; | 697 | goto restart; |
@@ -703,19 +703,21 @@ int msp3410d_thread(void *data) | |||
703 | v4l_dbg(1, client, "detection still in progress\n"); | 703 | v4l_dbg(1, client, "detection still in progress\n"); |
704 | } | 704 | } |
705 | } | 705 | } |
706 | for (i = 0; msp_modelist[i].name != NULL; i++) | 706 | for (i = 0; msp_stdlist[i].name != NULL; i++) |
707 | if (msp_modelist[i].retval == val) | 707 | if (msp_stdlist[i].retval == val) |
708 | break; | 708 | break; |
709 | v4l_dbg(1, client, "current mode: %s (0x%04x)\n", | 709 | v4l_dbg(1, client, "current standard: %s (0x%04x)\n", |
710 | msp_standard_mode_name(val), val); | 710 | msp_standard_std_name(val), val); |
711 | state->main = msp_modelist[i].main; | 711 | state->main = msp_stdlist[i].main; |
712 | state->second = msp_modelist[i].second; | 712 | state->second = msp_stdlist[i].second; |
713 | 713 | state->std = val; | |
714 | if (amsound && (state->std & V4L2_STD_SECAM) && (val != 0x0009)) { | 714 | |
715 | if (amsound && !state->radio && (state->v4l2_std & V4L2_STD_SECAM) && | ||
716 | (val != 0x0009)) { | ||
715 | /* autodetection has failed, let backup */ | 717 | /* autodetection has failed, let backup */ |
716 | v4l_dbg(1, client, "autodetection failed," | 718 | v4l_dbg(1, client, "autodetection failed," |
717 | " switching to backup mode: %s (0x%04x)\n", | 719 | " switching to backup standard: %s (0x%04x)\n", |
718 | msp_modelist[8].name ? msp_modelist[8].name : "unknown",val); | 720 | msp_stdlist[8].name ? msp_stdlist[8].name : "unknown",val); |
719 | val = 0x0009; | 721 | val = 0x0009; |
720 | msp_write_dem(client, 0x20, val); | 722 | msp_write_dem(client, 0x20, val); |
721 | } | 723 | } |
@@ -762,7 +764,7 @@ int msp3410d_thread(void *data) | |||
762 | state->watch_stereo = 0; | 764 | state->watch_stereo = 0; |
763 | /* not needed in theory if we have radio, but | 765 | /* not needed in theory if we have radio, but |
764 | short programming enables carrier mute */ | 766 | short programming enables carrier mute */ |
765 | msp3400c_setmode(client,MSP_MODE_FM_RADIO); | 767 | msp3400c_setmode(client, MSP_MODE_FM_RADIO); |
766 | msp3400c_setcarrier(client, MSP_CARRIER(10.7), | 768 | msp3400c_setcarrier(client, MSP_CARRIER(10.7), |
767 | MSP_CARRIER(10.7)); | 769 | MSP_CARRIER(10.7)); |
768 | /* scart routing */ | 770 | /* scart routing */ |
@@ -775,7 +777,7 @@ int msp3410d_thread(void *data) | |||
775 | case 0x0003: | 777 | case 0x0003: |
776 | case 0x0004: | 778 | case 0x0004: |
777 | case 0x0005: | 779 | case 0x0005: |
778 | state->mode = MSP_MODE_FM_TERRA; | 780 | state->mode = MSP_MODE_FM_TERRA; |
779 | state->rxsubchans = V4L2_TUNER_SUB_MONO; | 781 | state->rxsubchans = V4L2_TUNER_SUB_MONO; |
780 | state->audmode = V4L2_TUNER_MODE_MONO; | 782 | state->audmode = V4L2_TUNER_MODE_MONO; |
781 | state->nicam_on = 0; | 783 | state->nicam_on = 0; |
@@ -786,7 +788,8 @@ int msp3410d_thread(void *data) | |||
786 | /* unmute, restore misc registers */ | 788 | /* unmute, restore misc registers */ |
787 | msp_set_audio(client); | 789 | msp_set_audio(client); |
788 | msp_write_dsp(client, 0x13, state->acb); | 790 | msp_write_dsp(client, 0x13, state->acb); |
789 | msp_write_dem(client, 0x40, state->i2s_mode); | 791 | if (state->has_i2s_conf) |
792 | msp_write_dem(client, 0x40, state->i2s_mode); | ||
790 | 793 | ||
791 | /* monitor tv audio mode */ | 794 | /* monitor tv audio mode */ |
792 | while (state->watch_stereo) { | 795 | while (state->watch_stereo) { |
@@ -857,14 +860,15 @@ static int msp34xxg_reset(struct i2c_client *client) | |||
857 | if (msp_write_dsp(client, 0x13, 0x0f20)) | 860 | if (msp_write_dsp(client, 0x13, 0x0f20)) |
858 | return -1; | 861 | return -1; |
859 | 862 | ||
860 | msp_write_dem(client, 0x40, state->i2s_mode); | 863 | if (state->has_i2s_conf) |
864 | msp_write_dem(client, 0x40, state->i2s_mode); | ||
861 | 865 | ||
862 | /* step-by-step initialisation, as described in the manual */ | 866 | /* step-by-step initialisation, as described in the manual */ |
863 | modus = msp_modus(client); | 867 | modus = msp_modus(client); |
864 | if (state->radio) | 868 | if (state->radio) |
865 | std = 0x40; | 869 | std = 0x40; |
866 | else | 870 | else |
867 | std = (state->std & V4L2_STD_NTSC) ? 0x20 : 1; | 871 | std = (state->v4l2_std & V4L2_STD_NTSC) ? 0x20 : 1; |
868 | modus &= ~0x03; /* STATUS_CHANGE = 0 */ | 872 | modus &= ~0x03; /* STATUS_CHANGE = 0 */ |
869 | modus |= 0x01; /* AUTOMATIC_SOUND_DETECTION = 1 */ | 873 | modus |= 0x01; /* AUTOMATIC_SOUND_DETECTION = 1 */ |
870 | if (msp_write_dem(client, 0x30, modus)) | 874 | if (msp_write_dem(client, 0x30, modus)) |
@@ -933,9 +937,9 @@ int msp34xxg_thread(void *data) | |||
933 | } | 937 | } |
934 | 938 | ||
935 | unmute: | 939 | unmute: |
936 | state->mode = std; | 940 | state->std = std; |
937 | v4l_dbg(1, client, "current mode: %s (0x%04x)\n", | 941 | v4l_dbg(1, client, "current standard: %s (0x%04x)\n", |
938 | msp_standard_mode_name(std), std); | 942 | msp_standard_std_name(std), std); |
939 | 943 | ||
940 | /* unmute: dispatch sound to scart output, set scart volume */ | 944 | /* unmute: dispatch sound to scart output, set scart volume */ |
941 | msp_set_audio(client); | 945 | msp_set_audio(client); |
diff --git a/drivers/media/video/msp3400.h b/drivers/media/video/msp3400.h index fb44eef5d513..8a05cf500a8c 100644 --- a/drivers/media/video/msp3400.h +++ b/drivers/media/video/msp3400.h | |||
@@ -57,22 +57,24 @@ extern int stereo_threshold; | |||
57 | 57 | ||
58 | struct msp_state { | 58 | struct msp_state { |
59 | int rev1, rev2; | 59 | int rev1, rev2; |
60 | int has_nicam; | 60 | u8 has_nicam; |
61 | int has_radio; | 61 | u8 has_radio; |
62 | int has_headphones; | 62 | u8 has_headphones; |
63 | int has_ntsc_jp_d_k3; | 63 | u8 has_ntsc_jp_d_k3; |
64 | int has_scart4; | 64 | u8 has_scart4; |
65 | int has_scart23_in_scart2_out; | 65 | u8 has_scart23_in_scart2_out; |
66 | int has_scart2_out_volume; | 66 | u8 has_scart2_out_volume; |
67 | int has_subwoofer; | 67 | u8 has_i2s_conf; |
68 | int has_sound_processing; | 68 | u8 has_subwoofer; |
69 | int has_virtual_dolby_surround; | 69 | u8 has_sound_processing; |
70 | int has_dolby_pro_logic; | 70 | u8 has_virtual_dolby_surround; |
71 | u8 has_dolby_pro_logic; | ||
71 | 72 | ||
72 | int radio; | 73 | int radio; |
73 | int opmode; | 74 | int opmode; |
75 | int std; | ||
74 | int mode; | 76 | int mode; |
75 | v4l2_std_id std; | 77 | v4l2_std_id v4l2_std; |
76 | int nicam_on; | 78 | int nicam_on; |
77 | int acb; | 79 | int acb; |
78 | int in_scart; | 80 | int in_scart; |
@@ -109,7 +111,7 @@ int msp_modus(struct i2c_client *client); | |||
109 | int msp_sleep(struct msp_state *state, int timeout); | 111 | int msp_sleep(struct msp_state *state, int timeout); |
110 | 112 | ||
111 | /* msp3400-kthreads.c */ | 113 | /* msp3400-kthreads.c */ |
112 | const char *msp_standard_mode_name(int mode); | 114 | const char *msp_standard_std_name(int std); |
113 | void msp3400c_setcarrier(struct i2c_client *client, int cdo1, int cdo2); | 115 | void msp3400c_setcarrier(struct i2c_client *client, int cdo1, int cdo2); |
114 | void msp3400c_setmode(struct i2c_client *client, int type); | 116 | void msp3400c_setmode(struct i2c_client *client, int type); |
115 | void msp3400c_setstereo(struct i2c_client *client, int mode); | 117 | void msp3400c_setstereo(struct i2c_client *client, int mode); |