summaryrefslogtreecommitdiff
path: root/firmware/drivers/tuner/si4700.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/drivers/tuner/si4700.c')
-rw-r--r--firmware/drivers/tuner/si4700.c9
1 files changed, 0 insertions, 9 deletions
diff --git a/firmware/drivers/tuner/si4700.c b/firmware/drivers/tuner/si4700.c
index 4747357037..848d25eeb0 100644
--- a/firmware/drivers/tuner/si4700.c
+++ b/firmware/drivers/tuner/si4700.c
@@ -213,7 +213,6 @@ extern int si4700_st(void);
213/* 4702/03: RDS Block A-D data */ 213/* 4702/03: RDS Block A-D data */
214 214
215static bool tuner_present = false; 215static bool tuner_present = false;
216static int curr_frequency = 87500000; /* Current station frequency (HZ) */
217static uint16_t cache[16]; 216static uint16_t cache[16];
218 217
219/* reads <len> registers from radio at offset 0x0A into cache */ 218/* reads <len> registers from radio at offset 0x0A into cache */
@@ -380,8 +379,6 @@ static void si4700_set_frequency(int freq)
380 int chan = (freq - bands[band]) / spacings[space]; 379 int chan = (freq - bands[band]) / spacings[space];
381 int readchan; 380 int readchan;
382 381
383 curr_frequency = freq;
384
385 do 382 do
386 { 383 {
387 /* tuning should be done within 60 ms according to the datasheet */ 384 /* tuning should be done within 60 ms according to the datasheet */
@@ -416,15 +413,9 @@ static void si4700_set_region(int region)
416 413
417 uint16_t bandspacing = SYSCONFIG2_BANDw(band) | 414 uint16_t bandspacing = SYSCONFIG2_BANDw(band) |
418 SYSCONFIG2_SPACEw(spacing); 415 SYSCONFIG2_SPACEw(spacing);
419 uint16_t oldbs = cache[SYSCONFIG2] & (SYSCONFIG2_BAND | SYSCONFIG2_SPACE);
420
421 si4700_write_masked(SYSCONFIG1, deemphasis, SYSCONFIG1_DE); 416 si4700_write_masked(SYSCONFIG1, deemphasis, SYSCONFIG1_DE);
422 si4700_write_masked(SYSCONFIG2, bandspacing, 417 si4700_write_masked(SYSCONFIG2, bandspacing,
423 SYSCONFIG2_BAND | SYSCONFIG2_SPACE); 418 SYSCONFIG2_BAND | SYSCONFIG2_SPACE);
424
425 /* Retune if this region change would change the channel number. */
426 if (oldbs != bandspacing)
427 si4700_set_frequency(curr_frequency);
428} 419}
429 420
430/* tuner abstraction layer: set something to the tuner */ 421/* tuner abstraction layer: set something to the tuner */