added uda1380_reset()

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7112 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Linus Nielsen Feltzing 2005-07-12 05:25:03 +00:00
parent 56fb177111
commit 3382abaf58
2 changed files with 12 additions and 9 deletions

View file

@ -164,17 +164,20 @@ void uda1380_enable_output(bool enable)
}
}
void uda1380_reset(void)
{
/* RESET signal */
or_l(1<<29, &GPIO_OUT);
or_l(1<<29, &GPIO_ENABLE);
or_l(1<<29, &GPIO_FUNCTION);
sleep(HZ/100);
and_l(~(1<<29), &GPIO_OUT);
}
/* Initialize UDA1380 codec with default register values (uda1380_defaults) */
int uda1380_init(void)
{
/* RESET signal */
GPIO_OUT |= (1<<29);
GPIO_ENABLE |= (1<<29);
GPIO_FUNCTION |= (1<<29);
sleep(HZ/100);
GPIO_OUT &= ~(1<<29);
uda1380_reset();
if (uda1380_set_regs() == -1)
return -1;

View file

@ -19,7 +19,7 @@
#ifndef _UDA1380_H
#define _UDA1380_H
extern void uda1380_reset(void);
extern int uda1380_init(void);
extern void uda1380_enable_output(bool enable);
extern int uda1380_set_master_vol(int vol_l, int vol_r);