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
This commit is contained in:
Rafaël Carré 2010-03-05 01:43:52 +00:00
parent 8653c0a567
commit 3c87824970

View file

@ -282,29 +282,6 @@ static inline int si4700_st(void)
} }
#endif #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) static void si4700_sleep(int snooze)
{ {
if (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 void si4700_set_frequency(int freq)
{ {
static const unsigned int spacings[3] = static const unsigned int spacings[3] =