Commit the ascodec-as3525.c/ascodec-target.h changes from FS#12452 that keep ascodec_read/write_pmu from keeping interrupts disabled for the full duration of two I2C transfers, which can contribute to I2S PUSH/POP FIFO under/over-flows. 'Tis peppered with a couple interrupt safety mods as well.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31264 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Michael Sevakis 2011-12-15 03:30:03 +00:00
parent 47bade1437
commit 2026c9506c
2 changed files with 42 additions and 25 deletions

View file

@ -67,27 +67,9 @@ bool ascodec_endofch(void);
bool ascodec_chg_status(void);
#if CONFIG_CPU == AS3525v2
static inline void ascodec_write_pmu(unsigned int index, unsigned int subreg,
unsigned int value)
{
/* we disable interrupts to make sure no operation happen on the i2c bus
* between selecting the sub register and writing to it */
int oldstatus = disable_irq_save();
ascodec_write(AS3543_PMU_ENABLE, 8|subreg);
ascodec_write(index, value);
restore_irq(oldstatus);
}
static inline int ascodec_read_pmu(unsigned int index, unsigned int subreg)
{
/* we disable interrupts to make sure no operation happen on the i2c bus
* between selecting the sub register and reading it */
int oldstatus = disable_irq_save();
ascodec_write(AS3543_PMU_ENABLE, subreg);
int ret = ascodec_read(index);
restore_irq(oldstatus);
return ret;
}
void ascodec_write_pmu(unsigned int index, unsigned int subreg,
unsigned int value);
int ascodec_read_pmu(unsigned int index, unsigned int subreg);
#endif /* CONFIG_CPU == AS3525v2 */
static inline void ascodec_write_charger(int value)