summaryrefslogtreecommitdiff
path: root/firmware/drivers/tuner/rda5802.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/drivers/tuner/rda5802.c')
-rw-r--r--firmware/drivers/tuner/rda5802.c10
1 files changed, 0 insertions, 10 deletions
diff --git a/firmware/drivers/tuner/rda5802.c b/firmware/drivers/tuner/rda5802.c
index 82dc0bbcb9..fe2b25f213 100644
--- a/firmware/drivers/tuner/rda5802.c
+++ b/firmware/drivers/tuner/rda5802.c
@@ -100,7 +100,6 @@ static const uint16_t initvals[16] = {
100}; 100};
101 101
102static bool tuner_present = false; 102static bool tuner_present = false;
103static int curr_frequency = 87500000; /* Current station frequency (HZ) */
104static uint16_t cache[16]; 103static uint16_t cache[16];
105 104
106/* reads <len> registers from radio at offset 0x0A into cache */ 105/* reads <len> registers from radio at offset 0x0A into cache */
@@ -208,8 +207,6 @@ static void rda5802_set_frequency(int freq)
208 int start = CHANNEL_BANDr(cache[CHANNEL]) & 1 ? 76000000 : 87000000; 207 int start = CHANNEL_BANDr(cache[CHANNEL]) & 1 ? 76000000 : 87000000;
209 int chan = (freq - start) / 50000; 208 int chan = (freq - start) / 50000;
210 209
211 curr_frequency = freq;
212
213 for (i = 0; i < 5; i++) { 210 for (i = 0; i < 5; i++) {
214 /* tune and wait a bit */ 211 /* tune and wait a bit */
215 rda5802_write_masked(CHANNEL, CHANNEL_CHANw(chan) | CHANNEL_TUNE, 212 rda5802_write_masked(CHANNEL, CHANNEL_CHANw(chan) | CHANNEL_TUNE,
@@ -250,16 +247,9 @@ static void rda5802_set_region(int region)
250 247
251 uint16_t bandspacing = CHANNEL_BANDw(band) | 248 uint16_t bandspacing = CHANNEL_BANDw(band) |
252 CHANNEL_SPACEw(CHANNEL_SPACE_50KHZ); 249 CHANNEL_SPACEw(CHANNEL_SPACE_50KHZ);
253 uint16_t oldbs = cache[CHANNEL] & (CHANNEL_BAND | CHANNEL_SPACE);
254
255 rda5802_write_masked(SYSCONFIG1, deemphasis, SYSCONFIG1_DE); 250 rda5802_write_masked(SYSCONFIG1, deemphasis, SYSCONFIG1_DE);
256 rda5802_write_masked(CHANNEL, bandspacing, CHANNEL_BAND | CHANNEL_SPACE); 251 rda5802_write_masked(CHANNEL, bandspacing, CHANNEL_BAND | CHANNEL_SPACE);
257 rda5802_write_cache(); 252 rda5802_write_cache();
258
259 /* Retune if this region change would change the channel number. */
260 if (oldbs != bandspacing) {
261 rda5802_set_frequency(curr_frequency);
262 }
263} 253}
264 254
265static bool rda5802_st(void) 255static bool rda5802_st(void)