mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 15:11:48 -04:00
RTC6226: keep tuned to valid lower band channel for dwell time
While scan operation at rtc6226 driver when band limit is reached and then we seek with WRAP_ENABLE one more time to know if lower freq is valid, we update the valid lower band frequency to user space without keeping tuned to lower band frequency for specified dwell time and this leads to tuned freq mismatch between user space and kernel driver.keep tuned to valid lower band channel for dwell time. Also scan the lower band frequency channel once all the frequencies are scan in the band range. CRs-Fixed: 2725895 Change-Id: I8efb580c495baa314ef1a162e19c52eafbc085a9 Signed-off-by: himta ram <hram@codeaurora.org>
This commit is contained in:
parent
4027c201fd
commit
ba5a0ba83d
1 changed files with 34 additions and 27 deletions
|
|
@ -384,33 +384,6 @@ void rtc6226_scan(struct work_struct *work)
|
|||
FMDBG("%s valid channel %d, rssi %d\n", __func__,
|
||||
next_freq_khz, radio->registers[RSSI] & RSSI_RSSI);
|
||||
|
||||
if (radio->registers[STATUS] & STATUS_SF) {
|
||||
FMDERR("%s Seek one more time if lower freq is valid\n",
|
||||
__func__);
|
||||
retval = rtc6226_set_seek(radio, SRCH_UP, WRAP_ENABLE);
|
||||
if (retval < 0) {
|
||||
FMDERR("%s seek fail %d\n", __func__, retval);
|
||||
goto seek_tune_fail;
|
||||
}
|
||||
if (!wait_for_completion_timeout(&radio->completion,
|
||||
msecs_to_jiffies(WAIT_TIMEOUT_MSEC))) {
|
||||
FMDERR("timeout didn't receive STC for seek\n");
|
||||
} else {
|
||||
FMDERR("%s: received STC for seek\n", __func__);
|
||||
retval = rtc6226_get_freq(radio,
|
||||
&next_freq_khz);
|
||||
if (retval < 0) {
|
||||
FMDERR("%s getFreq failed\n", __func__);
|
||||
goto seek_tune_fail;
|
||||
}
|
||||
if ((radio->recv_conf.band_low_limit *
|
||||
TUNE_STEP_SIZE) ==
|
||||
next_freq_khz)
|
||||
rtc6226_q_event(radio,
|
||||
RTC6226_EVT_TUNE_SUCC);
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (radio->g_search_mode == SCAN)
|
||||
rtc6226_q_event(radio, RTC6226_EVT_TUNE_SUCC);
|
||||
/*
|
||||
|
|
@ -440,6 +413,40 @@ void rtc6226_scan(struct work_struct *work)
|
|||
rtc6226_update_search_list(radio, next_freq_khz);
|
||||
}
|
||||
|
||||
if (radio->registers[STATUS] & STATUS_SF) {
|
||||
FMDERR("%s Seek one more time if lower freq is valid\n",
|
||||
__func__);
|
||||
retval = rtc6226_set_seek(radio, SRCH_UP, WRAP_ENABLE);
|
||||
if (retval < 0) {
|
||||
FMDERR("%s seek fail %d\n", __func__, retval);
|
||||
goto seek_tune_fail;
|
||||
}
|
||||
if (!wait_for_completion_timeout(&radio->completion,
|
||||
msecs_to_jiffies(WAIT_TIMEOUT_MSEC))) {
|
||||
FMDERR("timeout didn't receive STC for seek\n");
|
||||
} else {
|
||||
FMDERR("%s: received STC for seek\n", __func__);
|
||||
retval = rtc6226_get_freq(radio,
|
||||
&next_freq_khz);
|
||||
if (retval < 0) {
|
||||
FMDERR("%s getFreq failed\n", __func__);
|
||||
goto seek_tune_fail;
|
||||
}
|
||||
if ((radio->recv_conf.band_low_limit *
|
||||
TUNE_STEP_SIZE) ==
|
||||
next_freq_khz) {
|
||||
FMDERR("lower band freq is valid\n");
|
||||
rtc6226_q_event(radio,
|
||||
RTC6226_EVT_TUNE_SUCC);
|
||||
/* sleep for dwell period */
|
||||
msleep(radio->dwell_time_sec * 1000);
|
||||
rtc6226_q_event(radio,
|
||||
RTC6226_EVT_SCAN_NEXT);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
seek_tune_fail:
|
||||
|
|
|
|||
Loading…
Reference in a new issue