diff options
author | Rafaël Carré <rafael.carre@gmail.com> | 2010-04-03 04:42:04 +0000 |
---|---|---|
committer | Rafaël Carré <rafael.carre@gmail.com> | 2010-04-03 04:42:04 +0000 |
commit | d3bad5b1ca3e4dfce9f5586b7d2c8392d8c307fc (patch) | |
tree | 5d966c764bb6f7a7eda43b7f5dd8f88596e9ef01 /firmware/target | |
parent | cfd245e527acb03301376e191c88142b818dee40 (diff) | |
download | rockbox-d3bad5b1ca3e4dfce9f5586b7d2c8392d8c307fc.tar.gz rockbox-d3bad5b1ca3e4dfce9f5586b7d2c8392d8c307fc.zip |
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
Diffstat (limited to 'firmware/target')
-rw-r--r-- | firmware/target/arm/as3525/ascodec-target.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/firmware/target/arm/as3525/ascodec-target.h b/firmware/target/arm/as3525/ascodec-target.h index 2bc99ab7e7..37947541c2 100644 --- a/firmware/target/arm/as3525/ascodec-target.h +++ b/firmware/target/arm/as3525/ascodec-target.h | |||
@@ -30,6 +30,7 @@ | |||
30 | #include "as3514.h" | 30 | #include "as3514.h" |
31 | #include "kernel.h" /* for struct wakeup */ | 31 | #include "kernel.h" /* for struct wakeup */ |
32 | #include "clock-target.h" /* for AS3525_I2C_PRESCALER */ | 32 | #include "clock-target.h" /* for AS3525_I2C_PRESCALER */ |
33 | #include "system-arm.h" | ||
33 | 34 | ||
34 | /* Charge Pump and Power management Settings */ | 35 | /* Charge Pump and Power management Settings */ |
35 | #define AS314_CP_DCDC3_SETTING \ | 36 | #define AS314_CP_DCDC3_SETTING \ |
@@ -77,8 +78,12 @@ int ascodec_write(unsigned int index, unsigned int value); | |||
77 | static inline void ascodec_write_pmu(unsigned int index, unsigned int subreg, | 78 | static inline void ascodec_write_pmu(unsigned int index, unsigned int subreg, |
78 | unsigned int value) | 79 | unsigned int value) |
79 | { | 80 | { |
81 | /* we disable interrupts to make sure no operation happen on the i2c bus | ||
82 | * between selecting the sub register and writing to it */ | ||
83 | int oldstatus = disable_irq_save(); | ||
80 | ascodec_write(AS3543_PMU_ENABLE, 8|subreg); | 84 | ascodec_write(AS3543_PMU_ENABLE, 8|subreg); |
81 | ascodec_write(index, value); | 85 | ascodec_write(index, value); |
86 | restore_irq(oldstatus); | ||
82 | } | 87 | } |
83 | #endif | 88 | #endif |
84 | 89 | ||