static int aml_fe_dvbc_read_status(struct dvb_frontend *fe, fe_status_t * status) { struct amlfe_state *state = fe->demodulator_priv; struct aml_demod_sts demod_sts; static int iii=-1; int ilock; dvbc_status(state->sta, state->i2c, &demod_sts); if(demod_sts.ch_sts&0x1) { ilock=1; *status = FE_HAS_LOCK|FE_HAS_SIGNAL|FE_HAS_CARRIER|FE_HAS_VITERBI|FE_HAS_SYNC; } else { ilock=0; *status = FE_TIMEDOUT; } if(iii != ilock){ printk("%s.\n", ilock? "!! >> LOCK << !!" : "!! >> UNLOCK << !!"); iii = ilock; } return 0; }
static int amdemod_islock(void) { struct aml_demod_sts demod_sts; if(demod_sta.dvb_mode == 0) { dvbc_status(&demod_sta, &demod_i2c, &demod_sts); return demod_sts.ch_sts&0x1; } else if(demod_sta.dvb_mode == 1) { dvbt_status(&demod_sta, &demod_i2c, &demod_sts); return demod_sts.ch_sts>>12&0x1; }