drivers: usb_dc_nrfx: move to new DT API

Close out the existing partial conversion to the new DT API.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
This commit is contained in:
Martí Bolívar 2020-04-17 17:06:59 -07:00 committed by Kumar Gala
commit 18c9c8cf27

View file

@ -29,6 +29,9 @@
#include <logging/log.h>
LOG_MODULE_REGISTER(usb_nrfx);
/* USB device controller access from devicetree */
#define DT_DRV_COMPAT nordic_nrf_usbd
/**
* @brief nRF USBD peripheral states
*/
@ -184,18 +187,18 @@ K_MEM_POOL_DEFINE(fifo_elem_pool, FIFO_ELEM_MIN_SZ, FIFO_ELEM_MAX_SZ,
*/
/** Number of IN Endpoints configured (including control) */
#define CFG_EPIN_CNT (DT_NORDIC_NRF_USBD_USBD_0_NUM_IN_ENDPOINTS + \
DT_NORDIC_NRF_USBD_USBD_0_NUM_BIDIR_ENDPOINTS)
#define CFG_EPIN_CNT (DT_INST_PROP(0, num_in_endpoints) + \
DT_INST_PROP(0, num_bidir_endpoints))
/** Number of OUT Endpoints configured (including control) */
#define CFG_EPOUT_CNT (DT_NORDIC_NRF_USBD_USBD_0_NUM_OUT_ENDPOINTS + \
DT_NORDIC_NRF_USBD_USBD_0_NUM_BIDIR_ENDPOINTS)
#define CFG_EPOUT_CNT (DT_INST_PROP(0, num_out_endpoints) + \
DT_INST_PROP(0, num_bidir_endpoints))
/** Number of ISO IN Endpoints */
#define CFG_EP_ISOIN_CNT DT_NORDIC_NRF_USBD_USBD_0_NUM_ISOIN_ENDPOINTS
#define CFG_EP_ISOIN_CNT DT_INST_PROP(0, num_isoin_endpoints)
/** Number of ISO OUT Endpoints */
#define CFG_EP_ISOOUT_CNT DT_NORDIC_NRF_USBD_USBD_0_NUM_ISOOUT_ENDPOINTS
#define CFG_EP_ISOOUT_CNT DT_INST_PROP(0, num_isoout_endpoints)
/** ISO endpoint index */
#define EP_ISOIN_INDEX CFG_EPIN_CNT
@ -1309,8 +1312,7 @@ int usb_dc_attach(void)
k_work_init(&ctx->usb_work, usbd_work_handler);
k_mutex_init(&ctx->drv_lock);
IRQ_CONNECT(DT_NORDIC_NRF_USBD_USBD_0_IRQ_0,
DT_NORDIC_NRF_USBD_USBD_0_IRQ_0_PRIORITY,
IRQ_CONNECT(DT_INST_IRQN(0), DT_INST_IRQ(0, priority),
nrfx_isr, nrfx_usbd_irq_handler, 0);
err = nrfx_usbd_init(usbd_event_handler);