drivers: usb: usb_dw: convert to DT_INST defines

Convert driver to use DT_INST_ defines.  The preferred defines for
drivers are DT_INST_.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
Kumar Gala 2020-02-13 13:04:37 -06:00 committed by Kumar Gala
commit 0c7a5fdf1c
3 changed files with 8 additions and 18 deletions

View file

@ -723,9 +723,11 @@ int usb_dc_attach(void)
} }
/* Connect and enable USB interrupt */ /* Connect and enable USB interrupt */
IRQ_CONNECT(DT_USB_DW_0_IRQ, DT_USB_DW_0_IRQ_PRI, IRQ_CONNECT(DT_INST_0_SNPS_DESIGNWARE_USB_IRQ_0,
usb_dw_isr_handler, 0, DT_USB_DW_0_IRQ_FLAGS); DT_INST_0_SNPS_DESIGNWARE_USB_IRQ_0_PRIORITY,
irq_enable(DT_USB_DW_0_IRQ); usb_dw_isr_handler, 0,
DT_INST_0_SNPS_DESIGNWARE_USB_IRQ_0_SENSE);
irq_enable(DT_INST_0_SNPS_DESIGNWARE_USB_IRQ_0);
usb_dw_ctrl.attached = 1U; usb_dw_ctrl.attached = 1U;
@ -738,7 +740,7 @@ int usb_dc_detach(void)
return 0; return 0;
} }
irq_disable(DT_USB_DW_0_IRQ); irq_disable(DT_INST_0_SNPS_DESIGNWARE_USB_IRQ_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_USB_DW_0_BASE_ADDRESS + 0x1000 * (ep + 1))) (*(u32_t *)(DT_INST_0_SNPS_DESIGNWARE_USB_BASE_ADDRESS + 0x1000 * (ep + 1)))
/* USB register block base address */ /* USB register block base address */
#define USB_DW ((struct usb_dw_reg *)DT_USB_DW_0_BASE_ADDRESS) #define USB_DW ((struct usb_dw_reg *)DT_INST_0_SNPS_DESIGNWARE_USB_BASE_ADDRESS)
#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)

View file

@ -75,16 +75,4 @@
#define DT_PINMUX_CTRL_REG_COUNT \ #define DT_PINMUX_CTRL_REG_COUNT \
(DT_INTEL_S1000_PINMUX_81C30_SIZE / 4) (DT_INTEL_S1000_PINMUX_81C30_SIZE / 4)
/*
* USB configuration
*/
#define DT_USB_DW_0_BASE_ADDRESS \
DT_SNPS_DESIGNWARE_USB_A0000_BASE_ADDRESS
#define DT_USB_DW_0_NAME DT_SNPS_DESIGNWARE_USB_A0000_LABEL
#define DT_USB_DW_0_IRQ DT_SNPS_DESIGNWARE_USB_A0000_IRQ_0
#define DT_USB_DW_0_IRQ_PRI \
DT_SNPS_DESIGNWARE_USB_A0000_IRQ_0_PRIORITY
#define DT_USB_DW_0_IRQ_FLAGS \
DT_SNPS_DESIGNWARE_USB_A0000_IRQ_0_SENSE
/* End of SoC Level DTS fixup file */ /* End of SoC Level DTS fixup file */