summaryrefslogtreecommitdiff
path: root/firmware/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/drivers')
-rw-r--r--firmware/drivers/mas.c27
-rw-r--r--firmware/drivers/mas.h1
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
26extern bool old_recorder;
22 27
23static int mas_devread(unsigned long *dest, int len); 28static 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
269void 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
263int mas_direct_config_read(unsigned char reg) 290int 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);
90int mas_writemem(int bank, int addr, unsigned long* src, int len); 90int mas_writemem(int bank, int addr, unsigned long* src, int len);
91int mas_readreg(int reg); 91int mas_readreg(int reg);
92int mas_writereg(int reg, unsigned int val); 92int mas_writereg(int reg, unsigned int val);
93void mas_reset(void);
93int mas_direct_config_read(unsigned char reg); 94int mas_direct_config_read(unsigned char reg);
94int mas_direct_config_write(unsigned char reg, unsigned int val); 95int mas_direct_config_write(unsigned char reg, unsigned int val);
95int mas_codec_writereg(int reg, unsigned int val); 96int mas_codec_writereg(int reg, unsigned int val);