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:
Kumar Gala 2020-03-27 05:46:53 -05:00 committed by Kumar Gala
commit e6e5d868e1
2 changed files with 9 additions and 7 deletions

View file

@ -1,5 +1,7 @@
/* usb_dc_dw.c - USB DesignWare device controller driver */ /* usb_dc_dw.c - USB DesignWare device controller driver */
#define DT_DRV_COMPAT snps_designware_usb
/* /*
* Copyright (c) 2016 Intel Corporation. * Copyright (c) 2016 Intel Corporation.
* *
@ -723,11 +725,11 @@ int usb_dc_attach(void)
} }
/* Connect and enable USB interrupt */ /* Connect and enable USB interrupt */
IRQ_CONNECT(DT_INST_0_SNPS_DESIGNWARE_USB_IRQ_0, IRQ_CONNECT(DT_INST_IRQN(0),
DT_INST_0_SNPS_DESIGNWARE_USB_IRQ_0_PRIORITY, DT_INST_IRQ(0, priority),
usb_dw_isr_handler, 0, usb_dw_isr_handler, 0,
DT_INST_0_SNPS_DESIGNWARE_USB_IRQ_0_SENSE); DT_INST_IRQ(0, sense));
irq_enable(DT_INST_0_SNPS_DESIGNWARE_USB_IRQ_0); irq_enable(DT_INST_IRQN(0));
usb_dw_ctrl.attached = 1U; usb_dw_ctrl.attached = 1U;
@ -740,7 +742,7 @@ int usb_dc_detach(void)
return 0; return 0;
} }
irq_disable(DT_INST_0_SNPS_DESIGNWARE_USB_IRQ_0); irq_disable(DT_INST_IRQN(0));
/* Enable soft disconnect */ /* Enable soft disconnect */
USB_DW->dctl |= USB_DW_DCTL_SFT_DISCON; USB_DW->dctl |= USB_DW_DCTL_SFT_DISCON;

View file

@ -198,9 +198,9 @@ struct usb_dw_reg {
#define USB_DW_PLL_TIMEOUT_US 100 #define USB_DW_PLL_TIMEOUT_US 100
#define USB_DW_EP_FIFO(ep) \ #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 */ /* 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_IN_EP_NUM (6)
#define DW_USB_OUT_EP_NUM (4) #define DW_USB_OUT_EP_NUM (4)