From 0582148cfd557639efb76df31eb7a28473619fb0 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 24 Aug 2013 14:06:47 -0600 Subject: [PATCH] SAMA5D3x-EK: Fix some backward conditional compilation --- arch/arm/src/sama5/sam_ehci.c | 4 +++- arch/arm/src/sama5/sam_ohci.c | 4 +++- configs/sama5d3x-ek/src/sam_usb.c | 6 +++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/arch/arm/src/sama5/sam_ehci.c b/arch/arm/src/sama5/sam_ehci.c index e42d2c7c6a1..6f25e3cf6fa 100755 --- a/arch/arm/src/sama5/sam_ehci.c +++ b/arch/arm/src/sama5/sam_ehci.c @@ -3872,7 +3872,9 @@ FAR struct usbhost_connection_s *sam_ehci_initialize(int controller) * * REVISIT: * - Should be done elsewhere in OTG mode. - * - Can we postpone enabling VBUS to save power? + * - Can we postpone enabling VBUS to save power? I think it can be + * done in sam_enumerate() and can probably be disabled when the + * port is disconnected. * - Some EHCI implementations require setting the power bit in the * PORTSC register to enable power. */ diff --git a/arch/arm/src/sama5/sam_ohci.c b/arch/arm/src/sama5/sam_ohci.c index a02d7a474bc..b8926277d1e 100644 --- a/arch/arm/src/sama5/sam_ohci.c +++ b/arch/arm/src/sama5/sam_ohci.c @@ -3207,7 +3207,9 @@ FAR struct usbhost_connection_s *sam_ohci_initialize(int controller) * * REVISIT: * - Should be done elsewhere in OTG mode. - * - Can we postpone enabling VBUS to save power? + * - Can we postpone enabling VBUS to save power? I think it can be + * done in sam_enumerate() and can probably be disabled when the + * port is disconnected. */ #ifdef CONFIG_SAMA5_UHPHS_RHPORT1 diff --git a/configs/sama5d3x-ek/src/sam_usb.c b/configs/sama5d3x-ek/src/sam_usb.c index b8cc73d21e6..22083b15973 100644 --- a/configs/sama5d3x-ek/src/sam_usb.c +++ b/configs/sama5d3x-ek/src/sam_usb.c @@ -393,7 +393,7 @@ void sam_usbhost_vbusdrive(int rhport, bool enable) switch (rhport) { case SAM_RHPORT1: -#ifdef CONFIG_SAMA5_UHPHS_RHPORT1 +#ifndef CONFIG_SAMA5_UHPHS_RHPORT1 udbg("ERROR: RHPort1 is not available in this configuration\n"); return; #else @@ -402,7 +402,7 @@ void sam_usbhost_vbusdrive(int rhport, bool enable) #endif case SAM_RHPORT2: -#ifdef CONFIG_SAMA5_UHPHS_RHPORT2 +#ifndef CONFIG_SAMA5_UHPHS_RHPORT2 udbg("ERROR: RHPort2 is not available in this configuration\n"); return; #else @@ -411,7 +411,7 @@ void sam_usbhost_vbusdrive(int rhport, bool enable) #endif case SAM_RHPORT3: -#ifdef CONFIG_SAMA5_UHPHS_RHPORT3 +#ifndef CONFIG_SAMA5_UHPHS_RHPORT3 udbg("ERROR: RHPort3 is not available in this configuration\n"); return; #else