From 422d708384c76b8bf3a860bdd084e3010e28afa0 Mon Sep 17 00:00:00 2001 From: Karl Palsson Date: Tue, 4 Oct 2016 20:42:33 +0000 Subject: [PATCH] usb: dwc_otg: enable clocks automatically. ST usbfs-v1, v2, EFM32 USB, lm4f usb all automatically enable the clock in their _init routine. Do the same for the dwc_otg drivers to be consistent. --- lib/usb/usb_f107.c | 1 + lib/usb/usb_f207.c | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/usb/usb_f107.c b/lib/usb/usb_f107.c index fb8ddf5b..924ac3a6 100644 --- a/lib/usb/usb_f107.c +++ b/lib/usb/usb_f107.c @@ -52,6 +52,7 @@ const struct _usbd_driver stm32f107_usb_driver = { /** Initialize the USB device controller hardware of the STM32. */ static usbd_device *stm32f107_usbd_init(void) { + rcc_periph_clock_enable(RCC_OTGFS); OTG_FS_GINTSTS = OTG_GINTSTS_MMIS; OTG_FS_GUSBCFG |= OTG_GUSBCFG_PHYSEL; diff --git a/lib/usb/usb_f207.c b/lib/usb/usb_f207.c index fb7dcb5b..7a940c72 100644 --- a/lib/usb/usb_f207.c +++ b/lib/usb/usb_f207.c @@ -52,6 +52,7 @@ const struct _usbd_driver stm32f207_usb_driver = { /** Initialize the USB device controller hardware of the STM32. */ static usbd_device *stm32f207_usbd_init(void) { + rcc_periph_clock_enable(RCC_OTGHS); OTG_HS_GINTSTS = OTG_GINTSTS_MMIS; OTG_HS_GUSBCFG |= OTG_GUSBCFG_PHYSEL;