diff options
Diffstat (limited to 'firmware/drivers/tuner/si4700.c')
-rw-r--r-- | firmware/drivers/tuner/si4700.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/firmware/drivers/tuner/si4700.c b/firmware/drivers/tuner/si4700.c index f9b26be6f8..ea88dc9835 100644 --- a/firmware/drivers/tuner/si4700.c +++ b/firmware/drivers/tuner/si4700.c | |||
@@ -400,14 +400,17 @@ static int si4700_tuned(void) | |||
400 | 400 | ||
401 | static void si4700_set_region(int region) | 401 | static void si4700_set_region(int region) |
402 | { | 402 | { |
403 | const struct si4700_region_data *rd = &si4700_region_data[region]; | 403 | const struct fm_region_data *rd = &fm_region_data[region]; |
404 | uint16_t bandspacing = SYSCONFIG2_BANDw(rd->band) | | 404 | |
405 | SYSCONFIG2_SPACEw(rd->spacing); | 405 | int band = (rd->freq_min == 76000000) ? 2 : 0; |
406 | int spacing = (100000 / rd->freq_step); | ||
407 | int deemphasis = (rd->deemphasis == 50) ? SYSCONFIG1_DE : 0; | ||
408 | |||
409 | uint16_t bandspacing = SYSCONFIG2_BANDw(band) | | ||
410 | SYSCONFIG2_SPACEw(spacing); | ||
406 | uint16_t oldbs = cache[SYSCONFIG2] & (SYSCONFIG2_BAND | SYSCONFIG2_SPACE); | 411 | uint16_t oldbs = cache[SYSCONFIG2] & (SYSCONFIG2_BAND | SYSCONFIG2_SPACE); |
407 | 412 | ||
408 | si4700_write_masked(SYSCONFIG1, | 413 | si4700_write_masked(SYSCONFIG1, deemphasis, SYSCONFIG1_DE); |
409 | rd->deemphasis ? SYSCONFIG1_DE : 0, | ||
410 | SYSCONFIG1_DE); | ||
411 | si4700_write_masked(SYSCONFIG2, bandspacing, | 414 | si4700_write_masked(SYSCONFIG2, bandspacing, |
412 | SYSCONFIG2_BAND | SYSCONFIG2_SPACE); | 415 | SYSCONFIG2_BAND | SYSCONFIG2_SPACE); |
413 | 416 | ||