Lines Matching defs: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))
576 if (msp_amsound && (state->v4l2_std & V4L2_STD_SECAM)) {
584 if (msp_sleep(state, 100))
596 state->main = msp3400c_carrier_detect_main[max1].cdo;
599 state->detected_std = V4L2_STD_BG | V4L2_STD_PAL_H;
602 state->second = msp3400c_carrier_detect_55[max2].cdo;
604 state->watch_stereo = 1;
605 } else if (max2 == 1 && state->has_nicam) {
607 state->second = msp3400c_carrier_detect_55[max2].cdo;
609 state->nicam_on = 1;
610 state->watch_stereo = 1;
617 state->detected_std = V4L2_STD_PAL_I;
618 state->second = MSP_CARRIER(6.552);
620 state->nicam_on = 1;
621 state->watch_stereo = 1;
626 state->second = msp3400c_carrier_detect_65[max2].cdo;
628 state->watch_stereo = 1;
629 state->detected_std = V4L2_STD_DK;
630 } else if (max2 == 0 && (state->v4l2_std & V4L2_STD_SECAM)) {
632 state->second = msp3400c_carrier_detect_65[max2].cdo;
634 state->watch_stereo = 1;
635 state->detected_std = V4L2_STD_L;
636 } else if (max2 == 0 && state->has_nicam) {
638 state->second = msp3400c_carrier_detect_65[max2].cdo;
640 state->nicam_on = 1;
641 state->watch_stereo = 1;
642 state->detected_std = V4L2_STD_DK;
648 state->detected_std = V4L2_STD_MN;
652 state->second = msp3400c_carrier_detect_main[max1].cdo;
656 msp3400c_set_carrier(client, state->second, state->main);
659 state->scan_in_progress = 0;
661 msp_update_volume(state);
669 while (state->watch_stereo) {
670 if (msp_sleep(state, count ? 1000 : 5000))
685 struct msp_state *state = to_state(i2c_get_clientdata(client));
689 state->detected_std = V4L2_STD_ALL;
693 msp_sleep(state, -1);
698 state->restart = 0;
702 if (state->mode == MSP_MODE_EXTERN) {
706 state->scan_in_progress = 0;
707 msp_update_volume(state);
712 state->scan_in_progress = 1;
713 msp_update_volume(state);
718 if (state->radio)
721 std = (state->v4l2_std & V4L2_STD_NTSC) ? 0x20 : 1;
722 state->watch_stereo = 0;
723 state->nicam_on = 0;
726 if (msp_sleep(state, 200))
741 if (msp_sleep(state, 100))
757 state->main = msp_stdlist[i].main;
758 state->second = msp_stdlist[i].second;
759 state->std = val;
760 state->rxsubchans = V4L2_TUNER_SUB_MONO;
762 if (msp_amsound && !state->radio &&
763 (state->v4l2_std & V4L2_STD_SECAM) && (val != 0x0009)) {
768 state->std = val = 0x0009;
771 state->detected_std = msp_standard_std(state->std);
780 state->mode = MSP_MODE_FM_NICAM2;
782 state->mode = MSP_MODE_FM_NICAM1;
784 state->nicam_on = 1;
785 state->watch_stereo = 1;
788 state->mode = MSP_MODE_AM_NICAM;
789 state->nicam_on = 1;
790 state->watch_stereo = 1;
794 state->mode = MSP_MODE_BTSC;
797 state->mode = MSP_MODE_FM_RADIO;
798 state->rxsubchans = V4L2_TUNER_SUB_STEREO;
809 state->mode = MSP_MODE_FM_TERRA;
810 state->watch_stereo = 1;
817 if (state->has_nicam)
820 if (state->has_i2s_conf)
821 msp_write_dem(client, 0x40, state->i2s_mode);
825 state->scan_in_progress = 0;
826 msp_update_volume(state);
831 while (state->watch_stereo) {
832 if (msp_sleep(state, count ? 1000 : 5000))
853 struct msp_state *state = to_state(i2c_get_clientdata(client));
855 if (state->radio) {
859 if (state->v4l2_std == V4L2_STD_NTSC_M_JP) {
863 if (state->v4l2_std == V4L2_STD_NTSC_M_KR) {
867 if (state->v4l2_std == V4L2_STD_SECAM_L) {
871 if (state->v4l2_std & V4L2_STD_MN) {
880 struct msp_state *state = to_state(i2c_get_clientdata(client));
883 switch (state->audmode) {
911 else if (in >= MSP_DSP_IN_MAIN_AVC && state->has_dolby_pro_logic)
923 struct msp_state *state = to_state(i2c_get_clientdata(client));
924 u32 in = state->route_in;
931 if (state->has_scart2_out)
939 struct msp_state *state = to_state(i2c_get_clientdata(client));
940 int tuner = (state->route_in >> 3) & 1;
945 state->std = 1;
949 if (state->has_i2s_conf)
950 msp_write_dem(client, 0x40, state->i2s_mode);
963 if (state->has_nicam)
982 struct msp_state *state = to_state(i2c_get_clientdata(client));
986 state->detected_std = V4L2_STD_ALL;
990 msp_sleep(state, -1);
995 state->restart = 0;
999 if (state->mode == MSP_MODE_EXTERN) {
1003 state->scan_in_progress = 0;
1004 msp_update_volume(state);
1010 state->std = state->radio ? 0x40 :
1011 (state->force_btsc && msp_standard == 1) ? 32 : msp_standard;
1012 msp_write_dem(client, 0x20, state->std);
1014 if (state->std != 1)
1021 if (msp_sleep(state, 100))
1027 state->std = val;
1033 if (state->std == 1) {
1042 msp_standard_std_name(state->std), state->std);
1043 state->detected_std = msp_standard_std(state->std);
1045 if (state->std == 9) {
1051 msp_update_volume(state);
1054 if (msp_write_dsp(client, 0x13, state->acb))
1059 if (state->std != 0x20)
1062 state->watch_stereo = 1;
1067 while (state->watch_stereo) {
1069 if (msp_sleep(state, 5000))
1079 struct msp_state *state = to_state(i2c_get_clientdata(client));
1083 int oldrx = state->rxsubchans;
1085 if (state->mode == MSP_MODE_EXTERN)
1088 state->rxsubchans = 0;
1090 state->rxsubchans = V4L2_TUNER_SUB_STEREO;
1092 state->rxsubchans = V4L2_TUNER_SUB_MONO;
1094 if (state->std == 0x20)
1095 state->rxsubchans |= V4L2_TUNER_SUB_SAP;
1097 state->rxsubchans =
1102 status, is_stereo, is_bilingual, state->rxsubchans);
1103 return (oldrx != state->rxsubchans);
1108 struct msp_state *state = to_state(i2c_get_clientdata(client));
1110 if (state->std == 0x20) {
1111 if ((state->rxsubchans & V4L2_TUNER_SUB_SAP) &&
1112 (state->audmode == V4L2_TUNER_MODE_LANG1_LANG2 ||
1113 state->audmode == V4L2_TUNER_MODE_LANG2)) {
1125 struct msp_state *state = to_state(i2c_get_clientdata(client));
1127 switch (state->opmode) {
1140 struct msp_state *state = to_state(i2c_get_clientdata(client));
1142 switch (state->opmode) {