diff options
-rw-r--r-- | firmware/drivers/mas.c | 27 | ||||
-rw-r--r-- | firmware/drivers/mas.h | 1 |
2 files changed, 28 insertions, 0 deletions
diff --git a/firmware/drivers/mas.c b/firmware/drivers/mas.c index c4daed9abf..f13f8aec01 100644 --- a/firmware/drivers/mas.c +++ b/firmware/drivers/mas.c | |||
@@ -16,9 +16,14 @@ | |||
16 | * KIND, either express or implied. | 16 | * KIND, either express or implied. |
17 | * | 17 | * |
18 | ****************************************************************************/ | 18 | ****************************************************************************/ |
19 | #include "stdbool.h" | ||
20 | #include "sh7034.h" | ||
19 | #include "i2c.h" | 21 | #include "i2c.h" |
20 | #include "debug.h" | 22 | #include "debug.h" |
21 | #include "mas.h" | 23 | #include "mas.h" |
24 | #include "kernel.h" | ||
25 | |||
26 | extern bool old_recorder; | ||
22 | 27 | ||
23 | static int mas_devread(unsigned long *dest, int len); | 28 | static int mas_devread(unsigned long *dest, int len); |
24 | 29 | ||
@@ -260,6 +265,28 @@ static int mas_devread(unsigned long *dest, int len) | |||
260 | } | 265 | } |
261 | 266 | ||
262 | #ifdef ARCHOS_RECORDER | 267 | #ifdef ARCHOS_RECORDER |
268 | |||
269 | void mas_reset(void) | ||
270 | { | ||
271 | PAIOR |= 0x100; | ||
272 | |||
273 | if(old_recorder) | ||
274 | { | ||
275 | /* Older recorder models don't invert the POR signal */ | ||
276 | PADR |= 0x100; | ||
277 | sleep(HZ/100); | ||
278 | PADR &= ~0x100; | ||
279 | sleep(HZ/5); | ||
280 | } | ||
281 | else | ||
282 | { | ||
283 | PADR &= ~0x100; | ||
284 | sleep(HZ/100); | ||
285 | PADR |= 0x100; | ||
286 | sleep(HZ/5); | ||
287 | } | ||
288 | } | ||
289 | |||
263 | int mas_direct_config_read(unsigned char reg) | 290 | int mas_direct_config_read(unsigned char reg) |
264 | { | 291 | { |
265 | int ret = 0; | 292 | int ret = 0; |
diff --git a/firmware/drivers/mas.h b/firmware/drivers/mas.h index 116863f3c5..32314fc789 100644 --- a/firmware/drivers/mas.h +++ b/firmware/drivers/mas.h | |||
@@ -90,6 +90,7 @@ int mas_readmem(int bank, int addr, unsigned long* dest, int len); | |||
90 | int mas_writemem(int bank, int addr, unsigned long* src, int len); | 90 | int mas_writemem(int bank, int addr, unsigned long* src, int len); |
91 | int mas_readreg(int reg); | 91 | int mas_readreg(int reg); |
92 | int mas_writereg(int reg, unsigned int val); | 92 | int mas_writereg(int reg, unsigned int val); |
93 | void mas_reset(void); | ||
93 | int mas_direct_config_read(unsigned char reg); | 94 | int mas_direct_config_read(unsigned char reg); |
94 | int mas_direct_config_write(unsigned char reg, unsigned int val); | 95 | int mas_direct_config_write(unsigned char reg, unsigned int val); |
95 | int mas_codec_writereg(int reg, unsigned int val); | 96 | int mas_codec_writereg(int reg, unsigned int val); |