diff options
author | Rafaël Carré <rafael.carre@gmail.com> | 2010-03-05 01:43:52 +0000 |
---|---|---|
committer | Rafaël Carré <rafael.carre@gmail.com> | 2010-03-05 01:43:52 +0000 |
commit | 3c878249705755d1dfb6c5320302f1670dd87a67 (patch) | |
tree | b65ebe2dd7a06226afd4dbf18f75d92eab51c0f9 | |
parent | 8653c0a5670529b32c0a4d72a704972eb413e14b (diff) | |
download | rockbox-3c878249705755d1dfb6c5320302f1670dd87a67.tar.gz rockbox-3c878249705755d1dfb6c5320302f1670dd87a67.zip |
si4700 tuner: put the tuner to sleep at init
gets 1h30 of runtime on Clipv1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25030 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | firmware/drivers/tuner/si4700.c | 49 |
1 files changed, 26 insertions, 23 deletions
diff --git a/firmware/drivers/tuner/si4700.c b/firmware/drivers/tuner/si4700.c index be9b6a4068..3a49d6ef41 100644 --- a/firmware/drivers/tuner/si4700.c +++ b/firmware/drivers/tuner/si4700.c | |||
@@ -282,29 +282,6 @@ static inline int si4700_st(void) | |||
282 | } | 282 | } |
283 | #endif | 283 | #endif |
284 | 284 | ||
285 | void si4700_init(void) | ||
286 | { | ||
287 | tuner_power(true); | ||
288 | |||
289 | /* read all registers */ | ||
290 | si4700_read(16); | ||
291 | |||
292 | /* check device id */ | ||
293 | if (cache[DEVICEID] == 0x1242) | ||
294 | { | ||
295 | tuner_present = true; | ||
296 | |||
297 | #ifdef USE_INTERNAL_OSCILLATOR | ||
298 | /* Enable the internal oscillator | ||
299 | (Si4702-16 needs this register to be initialised to 0x100) */ | ||
300 | si4700_write_set(TEST1, TEST1_XOSCEN | 0x100); | ||
301 | sleep(HZ/2); | ||
302 | #endif | ||
303 | } | ||
304 | |||
305 | tuner_power(false); | ||
306 | } | ||
307 | |||
308 | static void si4700_sleep(int snooze) | 285 | static void si4700_sleep(int snooze) |
309 | { | 286 | { |
310 | if (snooze) | 287 | if (snooze) |
@@ -339,6 +316,32 @@ static void si4700_sleep(int snooze) | |||
339 | } | 316 | } |
340 | } | 317 | } |
341 | 318 | ||
319 | void si4700_init(void) | ||
320 | { | ||
321 | tuner_power(true); | ||
322 | |||
323 | /* read all registers */ | ||
324 | si4700_read(16); | ||
325 | si4700_sleep(0); | ||
326 | |||
327 | /* check device id */ | ||
328 | if (cache[DEVICEID] == 0x1242) | ||
329 | { | ||
330 | tuner_present = true; | ||
331 | |||
332 | #ifdef USE_INTERNAL_OSCILLATOR | ||
333 | /* Enable the internal oscillator | ||
334 | (Si4702-16 needs this register to be initialised to 0x100) */ | ||
335 | si4700_write_set(TEST1, TEST1_XOSCEN | 0x100); | ||
336 | sleep(HZ/2); | ||
337 | #endif | ||
338 | } | ||
339 | |||
340 | si4700_sleep(1); | ||
341 | |||
342 | tuner_power(false); | ||
343 | } | ||
344 | |||
342 | static void si4700_set_frequency(int freq) | 345 | static void si4700_set_frequency(int freq) |
343 | { | 346 | { |
344 | static const unsigned int spacings[3] = | 347 | static const unsigned int spacings[3] = |