Karl Kurbjun | 7b97fe2 | 2007-09-20 04:46:41 +0000 | [diff] [blame] | 1 | /*************************************************************************** |
| 2 | * __________ __ ___. |
| 3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ |
| 4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / |
| 5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
| 6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
| 7 | * \/ \/ \/ \/ \/ |
Karl Kurbjun | bebbac8 | 2007-09-22 15:43:38 +0000 | [diff] [blame] | 8 | * $Id$ |
Karl Kurbjun | 7b97fe2 | 2007-09-20 04:46:41 +0000 | [diff] [blame] | 9 | * |
| 10 | * Copyright (C) 2007 by Karl Kurbjun |
| 11 | * |
Daniel Stenberg | 2acc0ac | 2008-06-28 18:10:04 +0000 | [diff] [blame^] | 12 | * This program is free software; you can redistribute it and/or |
| 13 | * modify it under the terms of the GNU General Public License |
| 14 | * as published by the Free Software Foundation; either version 2 |
| 15 | * of the License, or (at your option) any later version. |
Karl Kurbjun | 7b97fe2 | 2007-09-20 04:46:41 +0000 | [diff] [blame] | 16 | * |
| 17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
| 18 | * KIND, either express or implied. |
| 19 | * |
| 20 | ****************************************************************************/ |
| 21 | |
| 22 | #include "config.h" |
| 23 | #include "cpu.h" |
| 24 | #include "system.h" |
| 25 | #include "kernel.h" |
| 26 | #include "ata.h" |
Jonathan Gordon | c67a7b1 | 2008-05-18 14:01:36 +0000 | [diff] [blame] | 27 | #include "usb.h" |
Karl Kurbjun | 7b97fe2 | 2007-09-20 04:46:41 +0000 | [diff] [blame] | 28 | |
| 29 | #define USB_RST_ASSERT |
| 30 | #define USB_RST_DEASSERT |
| 31 | |
| 32 | #define USB_VPLUS_PWR_ASSERT |
| 33 | #define USB_VPLUS_PWR_DEASSERT |
| 34 | |
Jonathan Gordon | c67a7b1 | 2008-05-18 14:01:36 +0000 | [diff] [blame] | 35 | #define USB_UNIT_IS_PRESENT USB_EXTRACTED |
Karl Kurbjun | 7b97fe2 | 2007-09-20 04:46:41 +0000 | [diff] [blame] | 36 | |
| 37 | /* The usb detect is one pin to the cpu active low */ |
Jonathan Gordon | c67a7b1 | 2008-05-18 14:01:36 +0000 | [diff] [blame] | 38 | inline int usb_detect(void) |
Karl Kurbjun | 7b97fe2 | 2007-09-20 04:46:41 +0000 | [diff] [blame] | 39 | { |
| 40 | return USB_UNIT_IS_PRESENT; |
| 41 | } |
| 42 | |
| 43 | void usb_init_device(void) |
| 44 | { |
| 45 | // ata_enable(true); |
| 46 | } |
| 47 | |
| 48 | void usb_enable(bool on) |
| 49 | { |
| 50 | if (on) |
| 51 | { |
| 52 | USB_VPLUS_PWR_ASSERT; |
| 53 | } |
| 54 | else |
| 55 | { |
| 56 | USB_VPLUS_PWR_DEASSERT; |
| 57 | } |
| 58 | } |