Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 933840f6 authored by himta ram's avatar himta ram Committed by Gerrit - the friendly Code Review server
Browse files

radio: RTC6226: add support to scan valid lower freq channel



Existing scan logic will start repetitive seek
from lower freq and stops when band limit reached,
with this logic valid lower band is always ignored.
Seek one more time one band limit reached to check
if lower freq channel is valid.

CRs-Fixed: 2683848
Change-Id: I0b2608b544e0402298d1dfdc1bef96ff8ca64123
Signed-off-by: default avatarhimta ram <hram@codeaurora.org>
parent e117350b
Loading
Loading
Loading
Loading
+23 −1
Original line number Diff line number Diff line
@@ -385,8 +385,30 @@ void rtc6226_scan(struct work_struct *work)
			next_freq_khz, radio->registers[RSSI] & RSSI_RSSI);

		if (radio->registers[STATUS] & STATUS_SF) {
			FMDERR("%s band limit reached. Seek one more.\n",
			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)