From d1d63960b9b79fcac318ddd0571f12594ee697b1 Mon Sep 17 00:00:00 2001 From: Linus Nielsen Feltzing Date: Wed, 26 Jun 2002 12:39:49 +0000 Subject: Added mas_reset() git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1196 a1c6a512-1295-4272-9138-f99709370657 --- firmware/drivers/mas.c | 27 +++++++++++++++++++++++++++ firmware/drivers/mas.h | 1 + 2 files changed, 28 insertions(+) (limited to 'firmware') 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 @@ * KIND, either express or implied. * ****************************************************************************/ +#include "stdbool.h" +#include "sh7034.h" #include "i2c.h" #include "debug.h" #include "mas.h" +#include "kernel.h" + +extern bool old_recorder; static int mas_devread(unsigned long *dest, int len); @@ -260,6 +265,28 @@ static int mas_devread(unsigned long *dest, int len) } #ifdef ARCHOS_RECORDER + +void mas_reset(void) +{ + PAIOR |= 0x100; + + if(old_recorder) + { + /* Older recorder models don't invert the POR signal */ + PADR |= 0x100; + sleep(HZ/100); + PADR &= ~0x100; + sleep(HZ/5); + } + else + { + PADR &= ~0x100; + sleep(HZ/100); + PADR |= 0x100; + sleep(HZ/5); + } +} + int mas_direct_config_read(unsigned char reg) { 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); int mas_writemem(int bank, int addr, unsigned long* src, int len); int mas_readreg(int reg); int mas_writereg(int reg, unsigned int val); +void mas_reset(void); int mas_direct_config_read(unsigned char reg); int mas_direct_config_write(unsigned char reg, unsigned int val); int mas_codec_writereg(int reg, unsigned int val); -- cgit v1.2.3