mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 12:58:12 -04:00
FM: Reduce high scan time
Changed logic to find Lower Band Limit from Search Up from current channel with Wrap enable to tuning to Lower Band Limit + chan space and Search Down with Wrap disable. Change-Id: I79a686238d96db5dd5df9436b346b465435ae4f5 Signed-off-by: Prateek Raj Singh <pratsing@codeaurora.org>
This commit is contained in:
parent
91a7f066e1
commit
398c89ff03
2 changed files with 28 additions and 6 deletions
|
|
@ -312,6 +312,7 @@ void rtc6226_scan(struct work_struct *work)
|
|||
struct kfifo *data_b;
|
||||
int len = 0;
|
||||
u32 next_freq_khz;
|
||||
u8 factor;
|
||||
int retval = 0;
|
||||
int i, rssi;
|
||||
|
||||
|
|
@ -427,7 +428,26 @@ void rtc6226_scan(struct work_struct *work)
|
|||
TUNE_STEP_SIZE) == next_freq_khz) {
|
||||
FMDERR("%s Seek one more time if lower freq is valid\n",
|
||||
__func__);
|
||||
retval = rtc6226_set_seek(radio, SRCH_UP, WRAP_ENABLE);
|
||||
// Tuned to band low limit + chan spacing then seek down with
|
||||
// bandlimit config
|
||||
if (radio->space == 0)
|
||||
factor = 20;
|
||||
else if (radio->space == 1)
|
||||
factor = 10;
|
||||
else
|
||||
factor = 5;
|
||||
retval = rtc6226_set_freq(radio,
|
||||
(radio->recv_conf.band_low_limit + factor) * TUNE_STEP_SIZE);
|
||||
if (retval < 0)
|
||||
goto seek_tune_fail;
|
||||
/* wait for tune to complete. */
|
||||
if (!wait_for_completion_timeout(&radio->completion,
|
||||
msecs_to_jiffies(TUNE_TIMEOUT_MSEC))) {
|
||||
FMDERR("In %s, didn't receive STC for tune\n", __func__);
|
||||
rtc6226_q_event(radio, RTC6226_EVT_ERROR);
|
||||
return;
|
||||
}
|
||||
retval = rtc6226_set_seek(radio, SRCH_DOWN, WRAP_DISABLE);
|
||||
if (retval < 0) {
|
||||
FMDERR("%s seek fail %d\n", __func__, retval);
|
||||
goto seek_tune_fail;
|
||||
|
|
@ -454,10 +474,12 @@ void rtc6226_scan(struct work_struct *work)
|
|||
rssi = radio->registers[RSSI] & RSSI_RSSI;
|
||||
FMDBG("%s freq %d, rssi %d rssi threshold %d\n",
|
||||
__func__, next_freq_khz, rssi, radio->rssi_th);
|
||||
if ((radio->recv_conf.band_low_limit *
|
||||
TUNE_STEP_SIZE) ==
|
||||
next_freq_khz &&
|
||||
rssi >= radio->rssi_th) {
|
||||
// Reach to band low limit,
|
||||
// if SF is 0, means frequency at low limit is a commercial
|
||||
// station Or a invalid channel
|
||||
if (((radio->registers[STATUS] & STATUS_SF) == 0) ||
|
||||
(radio->recv_conf.band_high_limit *
|
||||
TUNE_STEP_SIZE) == next_freq_khz) {
|
||||
FMDERR("lower band freq is valid\n");
|
||||
rtc6226_q_event(radio,
|
||||
RTC6226_EVT_TUNE_SUCC);
|
||||
|
|
|
|||
|
|
@ -200,7 +200,7 @@
|
|||
#define SCAN_PENDING 3
|
||||
#define START_SCAN 1
|
||||
#define TUNE_TIMEOUT_MSEC 3000
|
||||
#define SEEK_TIMEOUT_MSEC 15000
|
||||
#define SEEK_TIMEOUT_MSEC 30000
|
||||
|
||||
#define RTC6226_MIN_SRCH_MODE 0x00
|
||||
#define RTC6226_MAX_SRCH_MODE 0x02
|
||||
|
|
|
|||
Loading…
Reference in a new issue