diff options
author | Bertrik Sikken <bertrik@sikken.nl> | 2010-07-26 20:15:16 +0000 |
---|---|---|
committer | Bertrik Sikken <bertrik@sikken.nl> | 2010-07-26 20:15:16 +0000 |
commit | adc472bec522e5b8bd34302cb3267cfb9a12d12c (patch) | |
tree | 394ca78314cb2ece1fd5412f8870868e608be813 /firmware/drivers/tuner/ipod_remote_tuner.c | |
parent | 6087d8960328b427f495d46d74664a4b0e32af17 (diff) | |
download | rockbox-adc472bec522e5b8bd34302cb3267cfb9a12d12c.tar.gz rockbox-adc472bec522e5b8bd34302cb3267cfb9a12d12c.zip |
FM tuner region code cleanup - FS #11492 by me.
This removes the tuner-specific region structs and makes each driver use the common one (which is now extended with a deemphasis field)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27579 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/tuner/ipod_remote_tuner.c')
-rw-r--r-- | firmware/drivers/tuner/ipod_remote_tuner.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/firmware/drivers/tuner/ipod_remote_tuner.c b/firmware/drivers/tuner/ipod_remote_tuner.c index 25ad2d9845..52d93b8b34 100644 --- a/firmware/drivers/tuner/ipod_remote_tuner.c +++ b/firmware/drivers/tuner/ipod_remote_tuner.c | |||
@@ -177,8 +177,9 @@ void rmt_tuner_region(int region) | |||
177 | { | 177 | { |
178 | if (region != old_region) | 178 | if (region != old_region) |
179 | { | 179 | { |
180 | const struct fm_region_data *rd = &fm_region_data[region]; | ||
180 | unsigned char data[] = {0x07, 0x08, 0x00}; | 181 | unsigned char data[] = {0x07, 0x08, 0x00}; |
181 | if (region == 2) | 182 | if (rd->freq_min == 76000000) |
182 | { | 183 | { |
183 | data[2] = 0x02; /* japan band */ | 184 | data[2] = 0x02; /* japan band */ |
184 | } | 185 | } |
@@ -378,12 +379,14 @@ int ipod_rmt_tuner_set(int setting, int value) | |||
378 | 379 | ||
379 | case RADIO_REGION: | 380 | case RADIO_REGION: |
380 | { | 381 | { |
381 | const struct rmt_tuner_region_data *rd = | 382 | const struct fm_region_data *rd = &fm_region_data[value]; |
382 | &rmt_tuner_region_data[value]; | 383 | int band = (rd->freq_min == 76000000) ? 2 : 0; |
383 | 384 | int spacing = (100000 / rd->freq_step); | |
384 | rmt_tuner_region(rd->band); | 385 | int deemphasis = (rd->deemphasis == 50) ? 1 : 0; |
385 | set_deltafreq(rd->spacing); | 386 | |
386 | set_deemphasis(rd->deemphasis); | 387 | rmt_tuner_region(band); |
388 | set_deltafreq(spacing); | ||
389 | set_deemphasis(deemphasis); | ||
387 | rmt_tuner_set_param(tuner_param); | 390 | rmt_tuner_set_param(tuner_param); |
388 | break; | 391 | break; |
389 | } | 392 | } |