diff --git a/drivers/clock_control/nrf_power_clock.c b/drivers/clock_control/nrf_power_clock.c index 7531bc70a0a..14f89d89b6e 100644 --- a/drivers/clock_control/nrf_power_clock.c +++ b/drivers/clock_control/nrf_power_clock.c @@ -215,7 +215,7 @@ static int hfclk_init(struct device *dev) nrf_clock_int_enable(NRF_CLOCK, (NRF_CLOCK_INT_HF_STARTED_MASK | NRF_CLOCK_INT_LF_STARTED_MASK | - COND_CODE_1(CONFIG_USB_NRF52840, + COND_CODE_1(CONFIG_USB_NRFX, (NRF_POWER_INT_USBDETECTED_MASK | NRF_POWER_INT_USBREMOVED_MASK | NRF_POWER_INT_USBPWRRDY_MASK), @@ -289,7 +289,7 @@ static void clkstarted_handle(struct device *dev) } } -#if defined(CONFIG_USB_NRF52840) +#if defined(CONFIG_USB_NRFX) static bool power_event_check_and_clean(nrf_power_event_t evt, u32_t intmask) { bool ret = nrf_power_event_check(NRF_POWER, evt) && @@ -305,7 +305,7 @@ static bool power_event_check_and_clean(nrf_power_event_t evt, u32_t intmask) static void usb_power_isr(void) { -#if defined(CONFIG_USB_NRF52840) +#if defined(CONFIG_USB_NRFX) extern void usb_dc_nrfx_power_event_callback(nrf_power_event_t event); if (power_event_check_and_clean(NRF_POWER_EVENT_USBDETECTED, @@ -360,9 +360,9 @@ void nrf_power_clock_isr(void *arg) } } +#ifdef CONFIG_USB_NRFX void nrf5_power_usb_power_int_enable(bool enable) { -#ifdef CONFIG_USB_NRF52840 u32_t mask; mask = NRF_POWER_INT_USBDETECTED_MASK | @@ -375,5 +375,5 @@ void nrf5_power_usb_power_int_enable(bool enable) } else { nrf_power_int_disable(NRF_POWER, mask); } -#endif } +#endif diff --git a/drivers/spi/Kconfig.nrfx b/drivers/spi/Kconfig.nrfx index 9353f6823bb..f886e2fb2da 100644 --- a/drivers/spi/Kconfig.nrfx +++ b/drivers/spi/Kconfig.nrfx @@ -222,7 +222,7 @@ endif # SPI_3_NRF_SPIM || SPI_3_NRF_SPIS config SPI_3_NRF_RX_DELAY int "SPIM3 MISO sampling delay" - depends on SPI_3_NRF_SPIM && SOC_NRF52840 + depends on SPI_3_NRF_SPIM && (SOC_NRF52833 || SOC_NRF52840) range 0 7 default 2 help diff --git a/drivers/spi/spi_nrfx_spim.c b/drivers/spi/spi_nrfx_spim.c index 9812d1d04e9..e9254ecf753 100644 --- a/drivers/spi/spi_nrfx_spim.c +++ b/drivers/spi/spi_nrfx_spim.c @@ -59,7 +59,7 @@ static inline nrf_spim_frequency_t get_nrf_spim_frequency(u32_t frequency) return NRF_SPIM_FREQ_2M; } else if (frequency < 8000000) { return NRF_SPIM_FREQ_4M; -#ifdef CONFIG_SOC_NRF52840 +#if defined(CONFIG_SOC_NRF52833) || defined(CONFIG_SOC_NRF52840) } else if (frequency < 16000000) { return NRF_SPIM_FREQ_8M; } else if (frequency < 32000000) { diff --git a/drivers/usb/device/CMakeLists.txt b/drivers/usb/device/CMakeLists.txt index adf7e728a97..89eae3a0d97 100644 --- a/drivers/usb/device/CMakeLists.txt +++ b/drivers/usb/device/CMakeLists.txt @@ -4,7 +4,7 @@ zephyr_sources_ifdef(CONFIG_USB_DW usb_dc_dw.c) zephyr_sources_ifdef(CONFIG_USB_DC_STM32 usb_dc_stm32.c) zephyr_sources_ifdef(CONFIG_USB_DC_SAM0 usb_dc_sam0.c) zephyr_sources_ifdef(CONFIG_USB_DC_SAM usb_dc_sam.c) -zephyr_sources_ifdef(CONFIG_USB_NRF52840 usb_dc_nrfx.c) +zephyr_sources_ifdef(CONFIG_USB_NRFX usb_dc_nrfx.c) zephyr_sources_ifdef(CONFIG_USB_KINETIS usb_dc_kinetis.c) zephyr_sources_ifdef(CONFIG_USB_NATIVE_POSIX usb_dc_native_posix.c diff --git a/drivers/usb/device/Kconfig b/drivers/usb/device/Kconfig index 301b7333a18..7bca8ccc224 100644 --- a/drivers/usb/device/Kconfig +++ b/drivers/usb/device/Kconfig @@ -52,21 +52,21 @@ config USB_DC_SAM help SAM family USB HS device controller Driver. -menuconfig USB_NRF52840 - bool "Nordic Semiconductor nRF52840 USB Device Controller Driver" +menuconfig USB_NRFX + bool "Nordic Semiconductor USB Device Controller Driver" default y - depends on SOC_NRF52840 + depends on HAS_HW_NRF_USBD select USB_DEVICE_DRIVER select NRFX_USBD select USB_DEVICE_DISABLE_ZLP_EPIN_HANDLING help - nRF52840 USB Device Controller Driver + nRF USB Device Controller Driver config USB_NRFX_EVT_QUEUE_SIZE int "USBD event queue size" range 4 64 default 32 - depends on USB_NRF52840 + depends on USB_NRFX help Size of the driver's internal event queue. Required size will depend on number of endpoints (class instances) in use. @@ -74,7 +74,7 @@ config USB_NRFX_EVT_QUEUE_SIZE config USB_NRFX_WORK_QUEUE_STACK_SIZE int "USBD work queue stack size" default 1024 - depends on USB_NRF52840 + depends on USB_NRFX help Size of the stack for the work queue thread that is used in the driver for handling the events from the USBD ISR, i.e. executing endpoint diff --git a/include/drivers/clock_control/nrf_clock_control.h b/include/drivers/clock_control/nrf_clock_control.h index da5e466de58..68a53e52959 100644 --- a/include/drivers/clock_control/nrf_clock_control.h +++ b/include/drivers/clock_control/nrf_clock_control.h @@ -55,7 +55,9 @@ #define CLOCK_CONTROL_NRF_K32SRC_ACCURACY 7 #endif +#if defined(CONFIG_USB_NRFX) void nrf5_power_usb_power_int_enable(bool enable); +#endif /** @brief Force LF clock calibration. */ void z_nrf_clock_calibration_force_start(void); diff --git a/samples/subsys/usb/hid-mouse/Kconfig b/samples/subsys/usb/hid-mouse/Kconfig index 70b23a0cb4a..298512f9d6b 100644 --- a/samples/subsys/usb/hid-mouse/Kconfig +++ b/samples/subsys/usb/hid-mouse/Kconfig @@ -5,6 +5,6 @@ config USB_DEVICE_PID default USB_PID_HID_MOUSE_SAMPLE config USB_DEVICE_REMOTE_WAKEUP - default SOC_NRF52840 + default y if (SOC_NRF52833 || SOC_NRF52840) source "Kconfig.zephyr"