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.zip rockbox-3c878249705755d1dfb6c5320302f1670dd87a67.tar.gz rockbox-3c878249705755d1dfb6c5320302f1670dd87a67.tar.bz2 rockbox-3c878249705755d1dfb6c5320302f1670dd87a67.tar.xz | |
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 be9b6a4..3a49d6e 100644 --- a/firmware/drivers/tuner/si4700.c +++ b/firmware/drivers/tuner/si4700.c @@ -282,29 +282,6 @@ static inline int si4700_st(void) } #endif -void si4700_init(void) -{ - tuner_power(true); - - /* read all registers */ - si4700_read(16); - - /* check device id */ - if (cache[DEVICEID] == 0x1242) - { - tuner_present = true; - -#ifdef USE_INTERNAL_OSCILLATOR - /* Enable the internal oscillator - (Si4702-16 needs this register to be initialised to 0x100) */ - si4700_write_set(TEST1, TEST1_XOSCEN | 0x100); - sleep(HZ/2); -#endif - } - - tuner_power(false); -} - static void si4700_sleep(int snooze) { if (snooze) @@ -339,6 +316,32 @@ static void si4700_sleep(int snooze) } } +void si4700_init(void) +{ + tuner_power(true); + + /* read all registers */ + si4700_read(16); + si4700_sleep(0); + + /* check device id */ + if (cache[DEVICEID] == 0x1242) + { + tuner_present = true; + +#ifdef USE_INTERNAL_OSCILLATOR + /* Enable the internal oscillator + (Si4702-16 needs this register to be initialised to 0x100) */ + si4700_write_set(TEST1, TEST1_XOSCEN | 0x100); + sleep(HZ/2); +#endif + } + + si4700_sleep(1); + + tuner_power(false); +} + static void si4700_set_frequency(int freq) { static const unsigned int spacings[3] = |