mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 11:50:43 +09:00
atv_demod: Optimize atv demod when search. [1/2]
PD#167151: atv_demod: Optimize atv demod when search. Change-Id: Iae643c898cc8b19314c6cc5e5d02a20b71ba392f Signed-off-by: nengwen.chen <nengwen.chen@amlogic.com>
This commit is contained in:
@@ -333,7 +333,7 @@ void aml_fe_get_atvaudio_state(int *state)
|
||||
if ((vpll_lock == 0) && (line_lock == 0))
|
||||
retrieve_vpll_carrier_audio_power(&power);
|
||||
} else
|
||||
pr_err("%s, atv is not work, atv_state: %d.\n",
|
||||
pr_audio("%s, atv is not work, atv_state: %d.\n",
|
||||
__func__, atv_state);
|
||||
|
||||
if (power >= 150)
|
||||
@@ -554,11 +554,11 @@ static void atv_demod_set_params(struct dvb_frontend *fe,
|
||||
last_frq = atvdemod_param->param.frequency;
|
||||
last_std = atvdemod_param->param.std;
|
||||
#endif
|
||||
if (1) {
|
||||
/*
|
||||
* atvdemod_param->param.std != amlatvdemod_devp->std ||
|
||||
* atvdemod_param->param.audmode != amlatvdemod_devp->audmode
|
||||
*/
|
||||
if (amlatvdemod_devp->std != atvdemod_param->param.std ||
|
||||
amlatvdemod_devp->audmode != atvdemod_param->param.audmode ||
|
||||
amlatvdemod_devp->if_freq != atvdemod_param->if_freq ||
|
||||
amlatvdemod_devp->if_inv != atvdemod_param->if_inv ||
|
||||
amlatvdemod_devp->tuner_id != atvdemod_param->tuner_id) {
|
||||
amlatvdemod_devp->std = atvdemod_param->param.std;
|
||||
amlatvdemod_devp->audmode =
|
||||
atvdemod_param->param.audmode;
|
||||
@@ -584,6 +584,7 @@ static void atv_demod_set_params(struct dvb_frontend *fe,
|
||||
}
|
||||
|
||||
/* afc tune enable */
|
||||
/* analog_search_flag == 0 or afc_range != 0 means searching */
|
||||
if ((fe->ops.info.type == FE_ANALOG)
|
||||
&& (atv_demod_get_scan_mode() == 0)
|
||||
&& (atvdemod_param->param.mode == 0))
|
||||
@@ -702,6 +703,8 @@ static int atv_demod_set_config(struct dvb_frontend *fe, void *priv_cfg)
|
||||
|
||||
mutex_unlock(&atv_demod_list_mutex);
|
||||
|
||||
pr_info("%s: OK.\n", __func__);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -647,8 +647,8 @@ static enum v4l2_search v4l2_frontend_search(struct v4l2_frontend *v4l2_fe)
|
||||
pr_dbg("[%s] time_delta:%d ms\n",
|
||||
__func__, time_delta);
|
||||
#endif
|
||||
/*sync param */
|
||||
//aml_fe_analog_sync_frontend(fe);
|
||||
/* sync param */
|
||||
/* aml_fe_analog_sync_frontend(fe); */
|
||||
priv_cfg = AML_ATVDEMOD_UNSCAN_MODE;
|
||||
fe->ops.analog_ops.set_config(fe, &priv_cfg);
|
||||
return V4L2_SEARCH_SUCCESS;
|
||||
@@ -674,16 +674,17 @@ static enum v4l2_search v4l2_frontend_search(struct v4l2_frontend *v4l2_fe)
|
||||
__func__,
|
||||
(uint32_t) p->std, p->frequency);
|
||||
|
||||
++search_count;
|
||||
if (p->frequency >= 44200000 &&
|
||||
p->frequency <= 44300000 &&
|
||||
double_check_cnt) {
|
||||
double_check_cnt--;
|
||||
p->frequency -= afc_step;
|
||||
pr_err("%s 44.25Mhz double check\n", __func__);
|
||||
} else
|
||||
} else {
|
||||
++search_count;
|
||||
p->frequency += afc_step * ((search_count % 2) ?
|
||||
-search_count : search_count);
|
||||
}
|
||||
|
||||
#ifdef DEBUG_TIME_CUS
|
||||
time_end = jiffies_to_msecs(jiffies);
|
||||
|
||||
Reference in New Issue
Block a user