Changes to allow board-specific DRP/OTG support

Update sam_udphs.c
This commit is contained in:
TimJTi 2023-02-08 17:23:04 +00:00 committed by Xiang Xiao
parent 1fb6dcec3b
commit 4aada75249
4 changed files with 17 additions and 20 deletions

View File

@ -3827,7 +3827,7 @@ if SAMA5_OHCI || SAMA5_EHCI
config SAMA5_UHPHS_RHPORT1
bool "Use Port A"
default y
depends on !SAMA5_UDPHS
depends on !SAMA5_UDPHS || SAMA5_USB_DRP
config SAMA5_UHPHS_RHPORT2
bool "Use Port B"

View File

@ -110,17 +110,15 @@
#undef CONFIG_USBHOST_ISOC_DISABLE
#define CONFIG_USBHOST_ISOC_DISABLE 1
/* If UDPHS is enabled, then don't use port A */
#ifdef CONFIG_SAMA5_UDPHS
# undef CONFIG_SAMA5_UHPHS_RHPORT1
#endif
/* For now, suppress use of PORTA in any event. I use that for SAM-BA and
* would prefer that the board not try to drive VBUS on that port!
/* Suppress use of PORTA unless board-specific dual-role-port support
* has been included. Generally port A is used as a device-only port,
* typically for SAM-BA and the possibility of enabling host VBUS power
* for this port would be a BAD idea
*/
#undef CONFIG_SAMA5_UHPHS_RHPORT1
#if defined(CONFIG_SAMA5_UDPHS) && !defined(CONFIG_SAMA5_USBA_DRP)
# undef CONFIG_SAMA5_UHPHS_RHPORT1
#endif
/* Driver-private Definitions ***********************************************/

View File

@ -124,17 +124,15 @@
#define SAM_BUFALLOC (CONFIG_SAMA5_OHCI_TDBUFFERS * CONFIG_SAMA5_OHCI_TDBUFSIZE)
/* If UDPHS is enabled, then don't use port A */
#ifdef CONFIG_SAMA5_UDPHS
# undef CONFIG_SAMA5_UHPHS_RHPORT1
#endif
/* For now, suppress use of PORTA in any event. I use that for SAM-BA and
* would prefer that the board not try to drive VBUS on that port!
/* Suppress use of PORTA unless board-specific dual-role-port support
* has been included. Generally port A is used as a device-only port,
* typically for SAM-BA and the possibility of enabling host VBUS power
* for this port would be a BAD idea
*/
#undef CONFIG_SAMA5_UHPHS_RHPORT1
#if defined(CONFIG_SAMA5_UDPHS) && !defined(CONFIG_SAMA5_USBA_DRP)
# undef CONFIG_SAMA5_UHPHS_RHPORT1
#endif
/* Debug */

View File

@ -4055,6 +4055,7 @@ static int sam_selfpowered(struct usbdev_s *dev, bool selfpowered)
static int sam_pullup(struct usbdev_s *dev, bool enable)
{
#ifndef CONFIG_SAMA5_USB_DRP
struct sam_usbdev_s *priv = (struct sam_usbdev_s *)dev;
uint32_t regval;
@ -4102,7 +4103,7 @@ static int sam_pullup(struct usbdev_s *dev, bool enable)
priv->devstate = UDPHS_DEVSTATE_POWERED;
}
}
#endif /* CONFIG_SAMA5_USB_DRP */
return OK;
}