Lines Matching refs:state

177 	struct msp_state *state = to_state(i2c_get_clientdata(client));
189 if (state->has_scart2_out)
204 struct msp_state *state = to_state(i2c_get_clientdata(client));
206 int tuner = (state->route_in >> 3) & 1;
210 state->mode = mode;
211 state->rxsubchans = V4L2_TUNER_SUB_MONO;
234 if (state->has_nicam) /* nicam prescale */
245 struct msp_state *state = to_state(i2c_get_clientdata(client));
246 char *modestr = (state->audmode >= 0 && state->audmode < 5) ?
247 strmode[state->audmode] : "unknown";
249 int audmode = state->audmode;
251 if (state->opmode == OPMODE_AUTOSELECT) {
257 state->audmode);
265 if (state->mode != MSP_MODE_EXTERN) {
267 if (state->rxsubchans == V4L2_TUNER_SUB_MONO)
270 else if (state->rxsubchans & V4L2_TUNER_SUB_LANG2) {
282 switch (state->mode) {
320 if (state->nicam_on)
349 if (state->mode == MSP_MODE_AM_NICAM) {
357 if (state->rxsubchans & V4L2_TUNER_SUB_STEREO)
374 struct msp_state *state = to_state(i2c_get_clientdata(client));
376 if (state->main == state->second)
379 state->main / 910000, (state->main / 910) % 1000);
383 state->main / 910000, (state->main / 910) % 1000);
384 if (state->mode == MSP_MODE_FM_NICAM1 || state->mode == MSP_MODE_FM_NICAM2)
387 state->second / 910000, (state->second/910) % 1000);
388 if (state->mode == MSP_MODE_AM_NICAM)
391 state->second / 910000, (state->second / 910) % 1000);
392 if (state->mode == MSP_MODE_FM_TERRA && state->main != state->second) {
395 state->second / 910000, (state->second / 910) % 1000);
403 struct msp_state *state = to_state(i2c_get_clientdata(client));
405 int rxsubchans = state->rxsubchans;
406 int newnicam = state->nicam_on;
409 switch (state->mode) {
458 if (rxsubchans != state->rxsubchans) {
462 state->rxsubchans, rxsubchans);
463 state->rxsubchans = rxsubchans;
465 if (newnicam != state->nicam_on) {
468 state->nicam_on, newnicam);
469 state->nicam_on = newnicam;
481 struct msp_state *state = to_state(i2c_get_clientdata(client));
487 state->watch_stereo = 0;
493 struct msp_state *state = to_state(i2c_get_clientdata(client));
498 state->detected_std = V4L2_STD_ALL;
502 msp_sleep(state, -1);
507 state->restart = 0;
511 if (state->radio || MSP_MODE_EXTERN == state->mode) {
515 state->scan_in_progress = 0;
516 msp_update_volume(state);
521 state->scan_in_progress = 1;
522 msp_update_volume(state);
527 state->watch_stereo = 0;
528 state->nicam_on = 0;
531 if (msp_sleep(state, 200))
538 if (msp_amsound && (state->v4l2_std & V4L2_STD_SECAM)) {
547 if (msp_sleep(state, 100))
578 if (msp_amsound && (state->v4l2_std & V4L2_STD_SECAM)) {
586 if (msp_sleep(state, 100))
600 state->main = msp3400c_carrier_detect_main[max1].cdo;
603 state->detected_std = V4L2_STD_BG | V4L2_STD_PAL_H;
606 state->second = msp3400c_carrier_detect_55[max2].cdo;
608 state->watch_stereo = 1;
609 } else if (max2 == 1 && state->has_nicam) {
611 state->second = msp3400c_carrier_detect_55[max2].cdo;
613 state->nicam_on = 1;
614 state->watch_stereo = 1;
621 state->detected_std = V4L2_STD_PAL_I;
622 state->second = MSP_CARRIER(6.552);
624 state->nicam_on = 1;
625 state->watch_stereo = 1;
630 state->second = msp3400c_carrier_detect_65[max2].cdo;
632 state->watch_stereo = 1;
633 state->detected_std = V4L2_STD_DK;
634 } else if (max2 == 0 && (state->v4l2_std & V4L2_STD_SECAM)) {
636 state->second = msp3400c_carrier_detect_65[max2].cdo;
638 state->watch_stereo = 1;
639 state->detected_std = V4L2_STD_L;
640 } else if (max2 == 0 && state->has_nicam) {
642 state->second = msp3400c_carrier_detect_65[max2].cdo;
644 state->nicam_on = 1;
645 state->watch_stereo = 1;
646 state->detected_std = V4L2_STD_DK;
652 state->detected_std = V4L2_STD_MN;
656 state->second = msp3400c_carrier_detect_main[max1].cdo;
660 msp3400c_set_carrier(client, state->second, state->main);
663 state->scan_in_progress = 0;
665 msp_update_volume(state);
673 while (state->watch_stereo) {
674 if (msp_sleep(state, count ? 1000 : 5000))
689 struct msp_state *state = to_state(i2c_get_clientdata(client));
693 state->detected_std = V4L2_STD_ALL;
697 msp_sleep(state, -1);
702 state->restart = 0;
706 if (state->mode == MSP_MODE_EXTERN) {
710 state->scan_in_progress = 0;
711 msp_update_volume(state);
716 state->scan_in_progress = 1;
717 msp_update_volume(state);
722 if (state->radio)
725 std = (state->v4l2_std & V4L2_STD_NTSC) ? 0x20 : 1;
726 state->watch_stereo = 0;
727 state->nicam_on = 0;
730 if (msp_sleep(state, 200))
745 if (msp_sleep(state, 100))
761 state->main = msp_stdlist[i].main;
762 state->second = msp_stdlist[i].second;
763 state->std = val;
764 state->rxsubchans = V4L2_TUNER_SUB_MONO;
766 if (msp_amsound && !state->radio &&
767 (state->v4l2_std & V4L2_STD_SECAM) && (val != 0x0009)) {
772 state->std = val = 0x0009;
775 state->detected_std = msp_standard_std(state->std);
784 state->mode = MSP_MODE_FM_NICAM2;
786 state->mode = MSP_MODE_FM_NICAM1;
788 state->nicam_on = 1;
789 state->watch_stereo = 1;
792 state->mode = MSP_MODE_AM_NICAM;
793 state->nicam_on = 1;
794 state->watch_stereo = 1;
798 state->mode = MSP_MODE_BTSC;
801 state->mode = MSP_MODE_FM_RADIO;
802 state->rxsubchans = V4L2_TUNER_SUB_STEREO;
813 state->mode = MSP_MODE_FM_TERRA;
814 state->watch_stereo = 1;
821 if (state->has_nicam)
824 if (state->has_i2s_conf)
825 msp_write_dem(client, 0x40, state->i2s_mode);
829 state->scan_in_progress = 0;
830 msp_update_volume(state);
835 while (state->watch_stereo) {
836 if (msp_sleep(state, count ? 1000 : 5000))
857 struct msp_state *state = to_state(i2c_get_clientdata(client));
859 if (state->radio) {
863 if (state->v4l2_std == V4L2_STD_NTSC_M_JP) {
867 if (state->v4l2_std == V4L2_STD_NTSC_M_KR) {
871 if (state->v4l2_std == V4L2_STD_SECAM_L) {
875 if (state->v4l2_std & V4L2_STD_MN) {
884 struct msp_state *state = to_state(i2c_get_clientdata(client));
887 switch (state->audmode) {
915 else if (in >= MSP_DSP_IN_MAIN_AVC && state->has_dolby_pro_logic)
927 struct msp_state *state = to_state(i2c_get_clientdata(client));
928 u32 in = state->route_in;
935 if (state->has_scart2_out)
943 struct msp_state *state = to_state(i2c_get_clientdata(client));
944 int tuner = (state->route_in >> 3) & 1;
949 state->std = 1;
953 if (state->has_i2s_conf)
954 msp_write_dem(client, 0x40, state->i2s_mode);
967 if (state->has_nicam)
986 struct msp_state *state = to_state(i2c_get_clientdata(client));
990 state->detected_std = V4L2_STD_ALL;
994 msp_sleep(state, -1);
999 state->restart = 0;
1003 if (state->mode == MSP_MODE_EXTERN) {
1007 state->scan_in_progress = 0;
1008 msp_update_volume(state);
1014 state->std = state->radio ? 0x40 :
1015 (state->force_btsc && msp_standard == 1) ? 32 : msp_standard;
1016 msp_write_dem(client, 0x20, state->std);
1018 if (state->std != 1)
1025 if (msp_sleep(state, 100))
1031 state->std = val;
1037 if (state->std == 1) {
1046 msp_standard_std_name(state->std), state->std);
1047 state->detected_std = msp_standard_std(state->std);
1049 if (state->std == 9) {
1055 msp_update_volume(state);
1058 if (msp_write_dsp(client, 0x13, state->acb))
1063 if (state->std != 0x20)
1066 state->watch_stereo = 1;
1071 while (state->watch_stereo) {
1073 if (msp_sleep(state, 5000))
1083 struct msp_state *state = to_state(i2c_get_clientdata(client));
1087 int oldrx = state->rxsubchans;
1089 if (state->mode == MSP_MODE_EXTERN)
1092 state->rxsubchans = 0;
1094 state->rxsubchans = V4L2_TUNER_SUB_STEREO;
1096 state->rxsubchans = V4L2_TUNER_SUB_MONO;
1098 if (state->std == 0x20)
1099 state->rxsubchans |= V4L2_TUNER_SUB_SAP;
1101 state->rxsubchans =
1106 status, is_stereo, is_bilingual, state->rxsubchans);
1107 return (oldrx != state->rxsubchans);
1112 struct msp_state *state = to_state(i2c_get_clientdata(client));
1114 if (state->std == 0x20) {
1115 if ((state->rxsubchans & V4L2_TUNER_SUB_SAP) &&
1116 (state->audmode == V4L2_TUNER_MODE_LANG1_LANG2 ||
1117 state->audmode == V4L2_TUNER_MODE_LANG2)) {
1129 struct msp_state *state = to_state(i2c_get_clientdata(client));
1131 switch (state->opmode) {
1144 struct msp_state *state = to_state(i2c_get_clientdata(client));
1146 switch (state->opmode) {