summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBertrik Sikken <bertrik@sikken.nl>2010-11-14 09:25:08 +0000
committerBertrik Sikken <bertrik@sikken.nl>2010-11-14 09:25:08 +0000
commit0d5e470a451319e5c671b14cd5dfd350bc2d9285 (patch)
treeef5a66f1d7926d1d5babfdc88a25d36ceeec66e5
parentb491421c5ab036cb0a03240297dfdbd14fa44cd4 (diff)
downloadrockbox-0d5e470a451319e5c671b14cd5dfd350bc2d9285.zip
rockbox-0d5e470a451319e5c671b14cd5dfd350bc2d9285.tar.gz
rockbox-0d5e470a451319e5c671b14cd5dfd350bc2d9285.tar.bz2
rockbox-0d5e470a451319e5c671b14cd5dfd350bc2d9285.tar.xz
si4700/rda5802 tuners: prevent hang when changing radio region. Probably fixes bug FS#11754 .
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28582 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/drivers/tuner/rda5802.c10
-rw-r--r--firmware/drivers/tuner/si4700.c9
2 files changed, 0 insertions, 19 deletions
diff --git a/firmware/drivers/tuner/rda5802.c b/firmware/drivers/tuner/rda5802.c
index 82dc0bb..fe2b25f 100644
--- a/firmware/drivers/tuner/rda5802.c
+++ b/firmware/drivers/tuner/rda5802.c
@@ -100,7 +100,6 @@ static const uint16_t initvals[16] = {
};
static bool tuner_present = false;
-static int curr_frequency = 87500000; /* Current station frequency (HZ) */
static uint16_t cache[16];
/* reads <len> registers from radio at offset 0x0A into cache */
@@ -208,8 +207,6 @@ static void rda5802_set_frequency(int freq)
int start = CHANNEL_BANDr(cache[CHANNEL]) & 1 ? 76000000 : 87000000;
int chan = (freq - start) / 50000;
- curr_frequency = freq;
-
for (i = 0; i < 5; i++) {
/* tune and wait a bit */
rda5802_write_masked(CHANNEL, CHANNEL_CHANw(chan) | CHANNEL_TUNE,
@@ -250,16 +247,9 @@ static void rda5802_set_region(int region)
uint16_t bandspacing = CHANNEL_BANDw(band) |
CHANNEL_SPACEw(CHANNEL_SPACE_50KHZ);
- uint16_t oldbs = cache[CHANNEL] & (CHANNEL_BAND | CHANNEL_SPACE);
-
rda5802_write_masked(SYSCONFIG1, deemphasis, SYSCONFIG1_DE);
rda5802_write_masked(CHANNEL, bandspacing, CHANNEL_BAND | CHANNEL_SPACE);
rda5802_write_cache();
-
- /* Retune if this region change would change the channel number. */
- if (oldbs != bandspacing) {
- rda5802_set_frequency(curr_frequency);
- }
}
static bool rda5802_st(void)
diff --git a/firmware/drivers/tuner/si4700.c b/firmware/drivers/tuner/si4700.c
index 4747357..848d25e 100644
--- a/firmware/drivers/tuner/si4700.c
+++ b/firmware/drivers/tuner/si4700.c
@@ -213,7 +213,6 @@ extern int si4700_st(void);
/* 4702/03: RDS Block A-D data */
static bool tuner_present = false;
-static int curr_frequency = 87500000; /* Current station frequency (HZ) */
static uint16_t cache[16];
/* reads <len> registers from radio at offset 0x0A into cache */
@@ -380,8 +379,6 @@ static void si4700_set_frequency(int freq)
int chan = (freq - bands[band]) / spacings[space];
int readchan;
- curr_frequency = freq;
-
do
{
/* tuning should be done within 60 ms according to the datasheet */
@@ -416,15 +413,9 @@ static void si4700_set_region(int region)
uint16_t bandspacing = SYSCONFIG2_BANDw(band) |
SYSCONFIG2_SPACEw(spacing);
- uint16_t oldbs = cache[SYSCONFIG2] & (SYSCONFIG2_BAND | SYSCONFIG2_SPACE);
-
si4700_write_masked(SYSCONFIG1, deemphasis, SYSCONFIG1_DE);
si4700_write_masked(SYSCONFIG2, bandspacing,
SYSCONFIG2_BAND | SYSCONFIG2_SPACE);
-
- /* Retune if this region change would change the channel number. */
- if (oldbs != bandspacing)
- si4700_set_frequency(curr_frequency);
}
/* tuner abstraction layer: set something to the tuner */