summaryrefslogtreecommitdiffstats
path: root/firmware/target/coldfire/mpio/hd200/usb-hd200.c
diff options
context:
space:
mode:
authorMarcin Bukat <marcin.bukat@gmail.com>2010-11-12 21:52:29 +0000
committerMarcin Bukat <marcin.bukat@gmail.com>2010-11-12 21:52:29 +0000
commit123bebeada5dce220d8ce96d31ed711cb13d8d05 (patch)
treee1d45698eb457c142916271529ca28834708937c /firmware/target/coldfire/mpio/hd200/usb-hd200.c
parent6c8267a42cffd711dcd4230415f7e0ab15b855b3 (diff)
downloadrockbox-123bebeada5dce220d8ce96d31ed711cb13d8d05.tar.gz
rockbox-123bebeada5dce220d8ce96d31ed711cb13d8d05.zip
MPIO: move files a bit in preparation for HD300 port
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28567 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/coldfire/mpio/hd200/usb-hd200.c')
-rw-r--r--firmware/target/coldfire/mpio/hd200/usb-hd200.c75
1 files changed, 0 insertions, 75 deletions
diff --git a/firmware/target/coldfire/mpio/hd200/usb-hd200.c b/firmware/target/coldfire/mpio/hd200/usb-hd200.c
deleted file mode 100644
index a8c3db85bd..0000000000
--- a/firmware/target/coldfire/mpio/hd200/usb-hd200.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/***************************************************************************
- * __________ __ ___.
- * Open \______ \ ____ ____ | | _\_ |__ _______ ___
- * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
- * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
- * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
- * \/ \/ \/ \/ \/
- * $Id$
- *
- * Copyright (C) 2010 Marcin Bukat
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
- * KIND, either express or implied.
- *
- ****************************************************************************/
-#include "config.h"
-#include <stdbool.h>
-#include "cpu.h"
-#include "system.h"
-#include "kernel.h"
-#include "usb.h"
-
-void usb_init_device(void)
-{
- /* GPIO42 is USB detect input
- * but it also serves as MCLK2 for DAC
- */
- and_l(~(1<<4), &GPIO1_OUT); /* GPIO36 low */
- or_l((1<<4), &GPIO1_ENABLE); /* GPIO36 */
- or_l((1<<4)|(1<<5), &GPIO1_FUNCTION); /* GPIO36 GPIO37 */
-
- /* GPIO22 GPIO30 high */
- or_l((1<<22)|(1<<30), &GPIO_OUT);
- or_l((1<<22)|(1<<30), &GPIO_ENABLE);
- or_l((1<<22)|(1<<30), &GPIO_FUNCTION);
-}
-
-int usb_detect(void)
-{
- /* GPIO42 active low*/
- return (GPIO1_READ & (1<<10)) ? USB_EXTRACTED : USB_INSERTED;
-}
-
-void usb_enable(bool on)
-{
- /* one second timeout */
- unsigned char timeout = 10;
-
- if(on)
- {
- and_l(~(1<<30),&GPIO_OUT); /* GPIO30 low */
- and_l(~(1<<22),&GPIO_OUT); /* GPIO22 low */
-
- or_l((1<<4),&GPIO1_OUT); /* GPIO36 high */
-
- }
- else
- {
- or_l((1<<22),&GPIO_OUT); /* GPIO22 high */
- or_l((1<<30),&GPIO_OUT); /* GPIO30 high */
-
- and_l(~(1<<4),&GPIO1_OUT); /* GPIO36 low */
-
- while ( !(GPIO1_READ & (1<<5)) && timeout--)
- {
- sleep(HZ/10);
- }
- sleep(HZ);
- }
-}