Changes to allow board-specific DRP/OTG support
Update sam_udphs.c
This commit is contained in:
parent
1fb6dcec3b
commit
4aada75249
@ -3827,7 +3827,7 @@ if SAMA5_OHCI || SAMA5_EHCI
|
|||||||
config SAMA5_UHPHS_RHPORT1
|
config SAMA5_UHPHS_RHPORT1
|
||||||
bool "Use Port A"
|
bool "Use Port A"
|
||||||
default y
|
default y
|
||||||
depends on !SAMA5_UDPHS
|
depends on !SAMA5_UDPHS || SAMA5_USB_DRP
|
||||||
|
|
||||||
config SAMA5_UHPHS_RHPORT2
|
config SAMA5_UHPHS_RHPORT2
|
||||||
bool "Use Port B"
|
bool "Use Port B"
|
||||||
|
@ -110,17 +110,15 @@
|
|||||||
#undef CONFIG_USBHOST_ISOC_DISABLE
|
#undef CONFIG_USBHOST_ISOC_DISABLE
|
||||||
#define CONFIG_USBHOST_ISOC_DISABLE 1
|
#define CONFIG_USBHOST_ISOC_DISABLE 1
|
||||||
|
|
||||||
/* If UDPHS is enabled, then don't use port A */
|
/* Suppress use of PORTA unless board-specific dual-role-port support
|
||||||
|
* has been included. Generally port A is used as a device-only port,
|
||||||
#ifdef CONFIG_SAMA5_UDPHS
|
* typically for SAM-BA and the possibility of enabling host VBUS power
|
||||||
# undef CONFIG_SAMA5_UHPHS_RHPORT1
|
* for this port would be a BAD idea
|
||||||
#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!
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#undef CONFIG_SAMA5_UHPHS_RHPORT1
|
#if defined(CONFIG_SAMA5_UDPHS) && !defined(CONFIG_SAMA5_USBA_DRP)
|
||||||
|
# undef CONFIG_SAMA5_UHPHS_RHPORT1
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Driver-private Definitions ***********************************************/
|
/* Driver-private Definitions ***********************************************/
|
||||||
|
|
||||||
|
@ -124,17 +124,15 @@
|
|||||||
|
|
||||||
#define SAM_BUFALLOC (CONFIG_SAMA5_OHCI_TDBUFFERS * CONFIG_SAMA5_OHCI_TDBUFSIZE)
|
#define SAM_BUFALLOC (CONFIG_SAMA5_OHCI_TDBUFFERS * CONFIG_SAMA5_OHCI_TDBUFSIZE)
|
||||||
|
|
||||||
/* If UDPHS is enabled, then don't use port A */
|
/* Suppress use of PORTA unless board-specific dual-role-port support
|
||||||
|
* has been included. Generally port A is used as a device-only port,
|
||||||
#ifdef CONFIG_SAMA5_UDPHS
|
* typically for SAM-BA and the possibility of enabling host VBUS power
|
||||||
# undef CONFIG_SAMA5_UHPHS_RHPORT1
|
* for this port would be a BAD idea
|
||||||
#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!
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#undef CONFIG_SAMA5_UHPHS_RHPORT1
|
#if defined(CONFIG_SAMA5_UDPHS) && !defined(CONFIG_SAMA5_USBA_DRP)
|
||||||
|
# undef CONFIG_SAMA5_UHPHS_RHPORT1
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Debug */
|
/* Debug */
|
||||||
|
|
||||||
|
@ -4055,6 +4055,7 @@ static int sam_selfpowered(struct usbdev_s *dev, bool selfpowered)
|
|||||||
|
|
||||||
static int sam_pullup(struct usbdev_s *dev, bool enable)
|
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;
|
struct sam_usbdev_s *priv = (struct sam_usbdev_s *)dev;
|
||||||
uint32_t regval;
|
uint32_t regval;
|
||||||
|
|
||||||
@ -4102,7 +4103,7 @@ static int sam_pullup(struct usbdev_s *dev, bool enable)
|
|||||||
priv->devstate = UDPHS_DEVSTATE_POWERED;
|
priv->devstate = UDPHS_DEVSTATE_POWERED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif /* CONFIG_SAMA5_USB_DRP */
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user