as3525v2: disable interrupts when writing to the PMU registers
Brightness changes on the Fuzev2 now work flawlessly This might also explain why my Clip+ would sometimes "not boot", that could have been because the backlight was not enabled at all. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25445 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
cfd245e527
commit
d3bad5b1ca
1 changed files with 5 additions and 0 deletions
|
@ -30,6 +30,7 @@
|
|||
#include "as3514.h"
|
||||
#include "kernel.h" /* for struct wakeup */
|
||||
#include "clock-target.h" /* for AS3525_I2C_PRESCALER */
|
||||
#include "system-arm.h"
|
||||
|
||||
/* Charge Pump and Power management Settings */
|
||||
#define AS314_CP_DCDC3_SETTING \
|
||||
|
@ -77,8 +78,12 @@ int ascodec_write(unsigned int index, unsigned int value);
|
|||
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);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in a new issue