return btsc_sap_mode;
}
+static bool atvdemod_check_exited(struct atv_demod_priv *priv)
+{
+ return (priv->state != ATVDEMOD_STATE_WORK);
+}
+
int atv_demod_enter_mode(struct dvb_frontend *fe)
{
int err_code = 0;
unsigned int broad_std = 0;
unsigned int audio = 0;
+ *video_fmt = 0;
+ *audio_fmt = 0;
+ *soundsys = 0;
+
if (auto_search_std & AUTO_DETECT_COLOR) {
for (i = 0; i < try_vfmt_cnt; i++) {
+ if (atvdemod_check_exited(priv))
+ return;
+
/* SECAM-L/L' */
if ((p->std & (V4L2_STD_SECAM_L | V4L2_STD_SECAM_LC))
&& (p->std & V4L2_COLOR_STD_SECAM)) {
*lock = false;
do {
+ if (atvdemod_check_exited(priv))
+ break;
+
if (tuner_id == AM_TUNER_MXL661) {
usleep_range(30 * 1000, 30 * 1000 + 100);
} else if (tuner_id == AM_TUNER_R840 ||
set_freq = p->frequency;
while (abs(afc) > AFC_BEST_LOCK) {
+ if (atvdemod_check_exited(priv))
+ return -1;
+
if (tuner_id == AM_TUNER_MXL661)
usleep_range(30 * 1000, 30 * 1000 + 100);
else
int ret = -1;
unsigned int tuner_id = 0;
int priv_cfg = 0;
+ int exit_status = 0;
+ char *exit_str = "";
if (unlikely(!fe || !p ||
!fe->ops.tuner_ops.get_status ||
}
priv = fe->analog_demod_priv;
- if (priv->state != ATVDEMOD_STATE_WORK) {
+ if (atvdemod_check_exited(priv)) {
pr_err("[%s] ATV state is not work.\n", __func__);
return V4L2_SEARCH_INVALID;
}
while (minafcfreq <= p->frequency &&
p->frequency <= maxafcfreq) {
+ if (atvdemod_check_exited(priv)) {
+ exit_status = 1;
+ break;
+ }
+
pr_dbg("[%s] [%d] is processing, [min=%d, max=%d].\n",
__func__, p->frequency, minafcfreq, maxafcfreq);
p->soundsys = soundsys;
std_bk = 0;
audio = 0;
+ } else {
+ exit_status = 1;
+ break;
}
/* sync param */
(uint32_t) p->std, p->frequency);
/* when manual search, just search current freq */
- if (p->flag == ANALOG_FLAG_MANUL_SCAN)
+ if (p->flag == ANALOG_FLAG_MANUL_SCAN) {
+ exit_status = 2;
break;
+ }
+
#ifdef DOUBLE_CHECK_44_25MHZ
if (p->frequency >= 44200000 &&
p->frequency <= 44300000 &&
#endif
}
- pr_dbg("[%s] [%d] over of range [min=%d, max=%d], search failed.\n",
- __func__, p->frequency, minafcfreq, maxafcfreq);
+ if (!exit_status)
+ exit_str = "over of range, search failed";
+ else if (exit_status == 1)
+ exit_str = "search exited";
+ else
+ exit_str = "search failed";
+
+ pr_dbg("[%s] [%d] %s.\n", __func__, p->frequency, exit_str);
+
p->frequency = set_freq;
priv_cfg = AML_ATVDEMOD_UNSCAN_MODE;