drivers: usb: usb_dw: Convert to new DT_INST macros
Convert older DT_INST_ macro use the new include/devicetree.h DT_INST macro APIs. Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
parent
f74ddd3f6d
commit
e6e5d868e1
2 changed files with 9 additions and 7 deletions
|
@ -1,5 +1,7 @@
|
|||
/* usb_dc_dw.c - USB DesignWare device controller driver */
|
||||
|
||||
#define DT_DRV_COMPAT snps_designware_usb
|
||||
|
||||
/*
|
||||
* Copyright (c) 2016 Intel Corporation.
|
||||
*
|
||||
|
@ -723,11 +725,11 @@ int usb_dc_attach(void)
|
|||
}
|
||||
|
||||
/* Connect and enable USB interrupt */
|
||||
IRQ_CONNECT(DT_INST_0_SNPS_DESIGNWARE_USB_IRQ_0,
|
||||
DT_INST_0_SNPS_DESIGNWARE_USB_IRQ_0_PRIORITY,
|
||||
IRQ_CONNECT(DT_INST_IRQN(0),
|
||||
DT_INST_IRQ(0, priority),
|
||||
usb_dw_isr_handler, 0,
|
||||
DT_INST_0_SNPS_DESIGNWARE_USB_IRQ_0_SENSE);
|
||||
irq_enable(DT_INST_0_SNPS_DESIGNWARE_USB_IRQ_0);
|
||||
DT_INST_IRQ(0, sense));
|
||||
irq_enable(DT_INST_IRQN(0));
|
||||
|
||||
usb_dw_ctrl.attached = 1U;
|
||||
|
||||
|
@ -740,7 +742,7 @@ int usb_dc_detach(void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
irq_disable(DT_INST_0_SNPS_DESIGNWARE_USB_IRQ_0);
|
||||
irq_disable(DT_INST_IRQN(0));
|
||||
|
||||
/* Enable soft disconnect */
|
||||
USB_DW->dctl |= USB_DW_DCTL_SFT_DISCON;
|
||||
|
|
|
@ -198,9 +198,9 @@ struct usb_dw_reg {
|
|||
#define USB_DW_PLL_TIMEOUT_US 100
|
||||
|
||||
#define USB_DW_EP_FIFO(ep) \
|
||||
(*(u32_t *)(DT_INST_0_SNPS_DESIGNWARE_USB_BASE_ADDRESS + 0x1000 * (ep + 1)))
|
||||
(*(u32_t *)(DT_INST_REG_ADDR(0) + 0x1000 * (ep + 1)))
|
||||
/* USB register block base address */
|
||||
#define USB_DW ((struct usb_dw_reg *)DT_INST_0_SNPS_DESIGNWARE_USB_BASE_ADDRESS)
|
||||
#define USB_DW ((struct usb_dw_reg *)DT_INST_REG_ADDR(0))
|
||||
|
||||
#define DW_USB_IN_EP_NUM (6)
|
||||
#define DW_USB_OUT_EP_NUM (4)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue