Lines Matching refs:state

191 	struct msp_state *state = to_state(i2c_get_clientdata(client));  in msp_set_source()  local
203 if (state->has_scart2_out) in msp_set_source()
218 struct msp_state *state = to_state(i2c_get_clientdata(client)); in msp3400c_set_mode() local
220 int tuner = (state->route_in >> 3) & 1; in msp3400c_set_mode()
224 state->mode = mode; in msp3400c_set_mode()
225 state->rxsubchans = V4L2_TUNER_SUB_MONO; in msp3400c_set_mode()
248 if (state->has_nicam) /* nicam prescale */ in msp3400c_set_mode()
259 struct msp_state *state = to_state(i2c_get_clientdata(client)); in msp3400c_set_audmode() local
260 char *modestr = (state->audmode >= 0 && state->audmode < 5) ? in msp3400c_set_audmode()
261 strmode[state->audmode] : "unknown"; in msp3400c_set_audmode()
263 int audmode = state->audmode; in msp3400c_set_audmode()
265 if (state->opmode == OPMODE_AUTOSELECT) { in msp3400c_set_audmode()
271 state->audmode); in msp3400c_set_audmode()
279 if (state->mode != MSP_MODE_EXTERN) { in msp3400c_set_audmode()
281 if (state->rxsubchans == V4L2_TUNER_SUB_MONO) in msp3400c_set_audmode()
284 else if (state->rxsubchans & V4L2_TUNER_SUB_LANG2) { in msp3400c_set_audmode()
296 switch (state->mode) { in msp3400c_set_audmode()
334 if (state->nicam_on) in msp3400c_set_audmode()
363 if (state->mode == MSP_MODE_AM_NICAM) { in msp3400c_set_audmode()
371 if (state->rxsubchans & V4L2_TUNER_SUB_STEREO) in msp3400c_set_audmode()
388 struct msp_state *state = to_state(i2c_get_clientdata(client)); in msp3400c_print_mode() local
390 if (state->main == state->second) in msp3400c_print_mode()
393 state->main / 910000, (state->main / 910) % 1000); in msp3400c_print_mode()
397 state->main / 910000, (state->main / 910) % 1000); in msp3400c_print_mode()
398 if (state->mode == MSP_MODE_FM_NICAM1 || state->mode == MSP_MODE_FM_NICAM2) in msp3400c_print_mode()
401 state->second / 910000, (state->second/910) % 1000); in msp3400c_print_mode()
402 if (state->mode == MSP_MODE_AM_NICAM) in msp3400c_print_mode()
405 state->second / 910000, (state->second / 910) % 1000); in msp3400c_print_mode()
406 if (state->mode == MSP_MODE_FM_TERRA && state->main != state->second) { in msp3400c_print_mode()
409 state->second / 910000, (state->second / 910) % 1000); in msp3400c_print_mode()
417 struct msp_state *state = to_state(i2c_get_clientdata(client)); in msp3400c_detect_stereo() local
419 int rxsubchans = state->rxsubchans; in msp3400c_detect_stereo()
420 int newnicam = state->nicam_on; in msp3400c_detect_stereo()
423 switch (state->mode) { in msp3400c_detect_stereo()
472 if (rxsubchans != state->rxsubchans) { in msp3400c_detect_stereo()
476 state->rxsubchans, rxsubchans); in msp3400c_detect_stereo()
477 state->rxsubchans = rxsubchans; in msp3400c_detect_stereo()
479 if (newnicam != state->nicam_on) { in msp3400c_detect_stereo()
482 state->nicam_on, newnicam); in msp3400c_detect_stereo()
483 state->nicam_on = newnicam; in msp3400c_detect_stereo()
495 struct msp_state *state = to_state(i2c_get_clientdata(client)); in watch_stereo() local
501 state->watch_stereo = 0; in watch_stereo()
507 struct msp_state *state = to_state(i2c_get_clientdata(client)); in msp3400c_thread() local
512 state->detected_std = V4L2_STD_ALL; in msp3400c_thread()
516 msp_sleep(state, -1); in msp3400c_thread()
521 state->restart = 0; in msp3400c_thread()
525 if (state->radio || MSP_MODE_EXTERN == state->mode) { in msp3400c_thread()
529 state->scan_in_progress = 0; in msp3400c_thread()
530 msp_update_volume(state); in msp3400c_thread()
535 state->scan_in_progress = 1; in msp3400c_thread()
536 msp_update_volume(state); in msp3400c_thread()
541 state->watch_stereo = 0; in msp3400c_thread()
542 state->nicam_on = 0; in msp3400c_thread()
545 if (msp_sleep(state, 200)) in msp3400c_thread()
552 if (msp_amsound && (state->v4l2_std & V4L2_STD_SECAM)) { in msp3400c_thread()
561 if (msp_sleep(state, 100)) in msp3400c_thread()
590 if (msp_amsound && (state->v4l2_std & V4L2_STD_SECAM)) { in msp3400c_thread()
598 if (msp_sleep(state, 100)) in msp3400c_thread()
610 state->main = msp3400c_carrier_detect_main[max1].cdo; in msp3400c_thread()
613 state->detected_std = V4L2_STD_BG | V4L2_STD_PAL_H; in msp3400c_thread()
616 state->second = msp3400c_carrier_detect_55[max2].cdo; in msp3400c_thread()
618 state->watch_stereo = 1; in msp3400c_thread()
619 } else if (max2 == 1 && state->has_nicam) { in msp3400c_thread()
621 state->second = msp3400c_carrier_detect_55[max2].cdo; in msp3400c_thread()
623 state->nicam_on = 1; in msp3400c_thread()
624 state->watch_stereo = 1; in msp3400c_thread()
631 state->detected_std = V4L2_STD_PAL_I; in msp3400c_thread()
632 state->second = MSP_CARRIER(6.552); in msp3400c_thread()
634 state->nicam_on = 1; in msp3400c_thread()
635 state->watch_stereo = 1; in msp3400c_thread()
640 state->second = msp3400c_carrier_detect_65[max2].cdo; in msp3400c_thread()
642 state->watch_stereo = 1; in msp3400c_thread()
643 state->detected_std = V4L2_STD_DK; in msp3400c_thread()
644 } else if (max2 == 0 && (state->v4l2_std & V4L2_STD_SECAM)) { in msp3400c_thread()
646 state->second = msp3400c_carrier_detect_65[max2].cdo; in msp3400c_thread()
648 state->watch_stereo = 1; in msp3400c_thread()
649 state->detected_std = V4L2_STD_L; in msp3400c_thread()
650 } else if (max2 == 0 && state->has_nicam) { in msp3400c_thread()
652 state->second = msp3400c_carrier_detect_65[max2].cdo; in msp3400c_thread()
654 state->nicam_on = 1; in msp3400c_thread()
655 state->watch_stereo = 1; in msp3400c_thread()
656 state->detected_std = V4L2_STD_DK; in msp3400c_thread()
662 state->detected_std = V4L2_STD_MN; in msp3400c_thread()
665 state->second = msp3400c_carrier_detect_main[max1].cdo; in msp3400c_thread()
669 msp3400c_set_carrier(client, state->second, state->main); in msp3400c_thread()
672 state->scan_in_progress = 0; in msp3400c_thread()
674 msp_update_volume(state); in msp3400c_thread()
682 while (state->watch_stereo) { in msp3400c_thread()
683 if (msp_sleep(state, count ? 1000 : 5000)) in msp3400c_thread()
698 struct msp_state *state = to_state(i2c_get_clientdata(client)); in msp3410d_thread() local
702 state->detected_std = V4L2_STD_ALL; in msp3410d_thread()
706 msp_sleep(state, -1); in msp3410d_thread()
711 state->restart = 0; in msp3410d_thread()
715 if (state->mode == MSP_MODE_EXTERN) { in msp3410d_thread()
719 state->scan_in_progress = 0; in msp3410d_thread()
720 msp_update_volume(state); in msp3410d_thread()
725 state->scan_in_progress = 1; in msp3410d_thread()
726 msp_update_volume(state); in msp3410d_thread()
731 if (state->radio) in msp3410d_thread()
734 std = (state->v4l2_std & V4L2_STD_NTSC) ? 0x20 : 1; in msp3410d_thread()
735 state->watch_stereo = 0; in msp3410d_thread()
736 state->nicam_on = 0; in msp3410d_thread()
739 if (msp_sleep(state, 200)) in msp3410d_thread()
754 if (msp_sleep(state, 100)) in msp3410d_thread()
770 state->main = msp_stdlist[i].main; in msp3410d_thread()
771 state->second = msp_stdlist[i].second; in msp3410d_thread()
772 state->std = val; in msp3410d_thread()
773 state->rxsubchans = V4L2_TUNER_SUB_MONO; in msp3410d_thread()
775 if (msp_amsound && !state->radio && in msp3410d_thread()
776 (state->v4l2_std & V4L2_STD_SECAM) && (val != 0x0009)) { in msp3410d_thread()
782 state->std = val = 0x0009; in msp3410d_thread()
785 state->detected_std = msp_standard_std(state->std); in msp3410d_thread()
794 state->mode = MSP_MODE_FM_NICAM2; in msp3410d_thread()
796 state->mode = MSP_MODE_FM_NICAM1; in msp3410d_thread()
798 state->nicam_on = 1; in msp3410d_thread()
799 state->watch_stereo = 1; in msp3410d_thread()
802 state->mode = MSP_MODE_AM_NICAM; in msp3410d_thread()
803 state->nicam_on = 1; in msp3410d_thread()
804 state->watch_stereo = 1; in msp3410d_thread()
808 state->mode = MSP_MODE_BTSC; in msp3410d_thread()
811 state->mode = MSP_MODE_FM_RADIO; in msp3410d_thread()
812 state->rxsubchans = V4L2_TUNER_SUB_STEREO; in msp3410d_thread()
823 state->mode = MSP_MODE_FM_TERRA; in msp3410d_thread()
824 state->watch_stereo = 1; in msp3410d_thread()
831 if (state->has_nicam) in msp3410d_thread()
834 if (state->has_i2s_conf) in msp3410d_thread()
835 msp_write_dem(client, 0x40, state->i2s_mode); in msp3410d_thread()
839 state->scan_in_progress = 0; in msp3410d_thread()
840 msp_update_volume(state); in msp3410d_thread()
845 while (state->watch_stereo) { in msp3410d_thread()
846 if (msp_sleep(state, count ? 1000 : 5000)) in msp3410d_thread()
867 struct msp_state *state = to_state(i2c_get_clientdata(client)); in msp34xxg_modus() local
869 if (state->radio) { in msp34xxg_modus()
873 if (state->v4l2_std == V4L2_STD_NTSC_M_JP) { in msp34xxg_modus()
877 if (state->v4l2_std == V4L2_STD_NTSC_M_KR) { in msp34xxg_modus()
881 if (state->v4l2_std == V4L2_STD_SECAM_L) { in msp34xxg_modus()
885 if (state->v4l2_std & V4L2_STD_MN) { in msp34xxg_modus()
894 struct msp_state *state = to_state(i2c_get_clientdata(client)); in msp34xxg_set_source() local
897 switch (state->audmode) { in msp34xxg_set_source()
925 else if (in >= MSP_DSP_IN_MAIN_AVC && state->has_dolby_pro_logic) in msp34xxg_set_source()
937 struct msp_state *state = to_state(i2c_get_clientdata(client)); in msp34xxg_set_sources() local
938 u32 in = state->route_in; in msp34xxg_set_sources()
945 if (state->has_scart2_out) in msp34xxg_set_sources()
953 struct msp_state *state = to_state(i2c_get_clientdata(client)); in msp34xxg_reset() local
954 int tuner = (state->route_in >> 3) & 1; in msp34xxg_reset()
959 state->std = 1; in msp34xxg_reset()
963 if (state->has_i2s_conf) in msp34xxg_reset()
964 msp_write_dem(client, 0x40, state->i2s_mode); in msp34xxg_reset()
977 if (state->has_nicam) in msp34xxg_reset()
996 struct msp_state *state = to_state(i2c_get_clientdata(client)); in msp34xxg_thread() local
1000 state->detected_std = V4L2_STD_ALL; in msp34xxg_thread()
1004 msp_sleep(state, -1); in msp34xxg_thread()
1009 state->restart = 0; in msp34xxg_thread()
1013 if (state->mode == MSP_MODE_EXTERN) { in msp34xxg_thread()
1017 state->scan_in_progress = 0; in msp34xxg_thread()
1018 msp_update_volume(state); in msp34xxg_thread()
1024 state->std = state->radio ? 0x40 : in msp34xxg_thread()
1025 (state->force_btsc && msp_standard == 1) ? 32 : msp_standard; in msp34xxg_thread()
1026 msp_write_dem(client, 0x20, state->std); in msp34xxg_thread()
1028 if (state->std != 1) in msp34xxg_thread()
1035 if (msp_sleep(state, 100)) in msp34xxg_thread()
1041 state->std = val; in msp34xxg_thread()
1047 if (state->std == 1) { in msp34xxg_thread()
1056 msp_standard_std_name(state->std), state->std); in msp34xxg_thread()
1057 state->detected_std = msp_standard_std(state->std); in msp34xxg_thread()
1059 if (state->std == 9) { in msp34xxg_thread()
1065 msp_update_volume(state); in msp34xxg_thread()
1068 if (msp_write_dsp(client, 0x13, state->acb)) in msp34xxg_thread()
1073 if (state->std != 0x20) in msp34xxg_thread()
1076 state->watch_stereo = 1; in msp34xxg_thread()
1081 while (state->watch_stereo) { in msp34xxg_thread()
1083 if (msp_sleep(state, 5000)) in msp34xxg_thread()
1093 struct msp_state *state = to_state(i2c_get_clientdata(client)); in msp34xxg_detect_stereo() local
1097 int oldrx = state->rxsubchans; in msp34xxg_detect_stereo()
1099 if (state->mode == MSP_MODE_EXTERN) in msp34xxg_detect_stereo()
1102 state->rxsubchans = 0; in msp34xxg_detect_stereo()
1104 state->rxsubchans = V4L2_TUNER_SUB_STEREO; in msp34xxg_detect_stereo()
1106 state->rxsubchans = V4L2_TUNER_SUB_MONO; in msp34xxg_detect_stereo()
1108 if (state->std == 0x20) in msp34xxg_detect_stereo()
1109 state->rxsubchans |= V4L2_TUNER_SUB_SAP; in msp34xxg_detect_stereo()
1111 state->rxsubchans = in msp34xxg_detect_stereo()
1116 status, is_stereo, is_bilingual, state->rxsubchans); in msp34xxg_detect_stereo()
1117 return (oldrx != state->rxsubchans); in msp34xxg_detect_stereo()
1122 struct msp_state *state = to_state(i2c_get_clientdata(client)); in msp34xxg_set_audmode() local
1124 if (state->std == 0x20) { in msp34xxg_set_audmode()
1125 if ((state->rxsubchans & V4L2_TUNER_SUB_SAP) && in msp34xxg_set_audmode()
1126 (state->audmode == V4L2_TUNER_MODE_LANG1_LANG2 || in msp34xxg_set_audmode()
1127 state->audmode == V4L2_TUNER_MODE_LANG2)) { in msp34xxg_set_audmode()
1139 struct msp_state *state = to_state(i2c_get_clientdata(client)); in msp_set_audmode() local
1141 switch (state->opmode) { in msp_set_audmode()
1154 struct msp_state *state = to_state(i2c_get_clientdata(client)); in msp_detect_stereo() local
1156 switch (state->opmode) { in msp_detect_stereo()