drivers: usb: device: kinetis: Convert driver to DT_INST macro
Convert from using dts_fixup.h based macros to DT_INST macro. This lets us remove the dependancy on dts_fixup.h for this driver. Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
parent
033cb11db2
commit
af5515e2e0
6 changed files with 5 additions and 33 deletions
|
@ -6,6 +6,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define DT_DRV_COMPAT nxp_kinetis_usbd
|
||||
|
||||
#include <soc.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
@ -18,7 +20,7 @@
|
|||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(usb_dc_kinetis);
|
||||
|
||||
#define NUM_OF_EP_MAX DT_USBD_KINETIS_NUM_BIDIR_EP
|
||||
#define NUM_OF_EP_MAX DT_INST_PROP(0, num_bidir_endpoints)
|
||||
|
||||
#define BD_OWN_MASK (1 << 5)
|
||||
#define BD_DATA01_MASK (1 << 4)
|
||||
|
@ -177,10 +179,10 @@ static int kinetis_usb_init(void)
|
|||
K_PRIO_COOP(2), 0, K_NO_WAIT);
|
||||
|
||||
/* Connect and enable USB interrupt */
|
||||
IRQ_CONNECT(DT_USBD_KINETIS_IRQ, DT_USBD_KINETIS_IRQ_PRI,
|
||||
IRQ_CONNECT(DT_INST_IRQN(0), DT_INST_IRQ(0, priority),
|
||||
usb_kinetis_isr_handler, 0, 0);
|
||||
|
||||
irq_enable(DT_USBD_KINETIS_IRQ);
|
||||
irq_enable(DT_INST_IRQN(0));
|
||||
|
||||
LOG_DBG("");
|
||||
|
||||
|
|
|
@ -13,10 +13,4 @@
|
|||
#define DT_FLASH_DEV_BASE_ADDRESS DT_NXP_KINETIS_FTFE_40020000_BASE_ADDRESS
|
||||
#define DT_FLASH_DEV_NAME DT_NXP_KINETIS_FTFE_40020000_LABEL
|
||||
|
||||
#define DT_USBD_KINETIS_NAME DT_NXP_KINETIS_USBD_40072000_LABEL
|
||||
#define DT_USBD_KINETIS_IRQ DT_NXP_KINETIS_USBD_40072000_IRQ_USB_OTG
|
||||
#define DT_USBD_KINETIS_IRQ_PRI DT_NXP_KINETIS_USBD_40072000_IRQ_USB_OTG_PRIORITY
|
||||
#define DT_USBD_KINETIS_BASE_ADDRESS DT_NXP_KINETIS_USBD_40072000_BASE_ADDRESS
|
||||
#define DT_USBD_KINETIS_NUM_BIDIR_EP DT_NXP_KINETIS_USBD_40072000_NUM_BIDIR_ENDPOINTS
|
||||
|
||||
/* End of SoC Level DTS fixup file */
|
||||
|
|
|
@ -16,12 +16,6 @@
|
|||
#define DT_FLASH_DEV_BASE_ADDRESS DT_NXP_KINETIS_FTFE_40020000_BASE_ADDRESS
|
||||
#define DT_FLASH_DEV_NAME DT_NXP_KINETIS_FTFE_40020000_LABEL
|
||||
|
||||
#define DT_USBD_KINETIS_NAME DT_NXP_KINETIS_USBD_40072000_LABEL
|
||||
#define DT_USBD_KINETIS_IRQ DT_NXP_KINETIS_USBD_40072000_IRQ_USB_OTG
|
||||
#define DT_USBD_KINETIS_IRQ_PRI DT_NXP_KINETIS_USBD_40072000_IRQ_USB_OTG_PRIORITY
|
||||
#define DT_USBD_KINETIS_BASE_ADDRESS DT_NXP_KINETIS_USBD_40072000_BASE_ADDRESS
|
||||
#define DT_USBD_KINETIS_NUM_BIDIR_EP DT_NXP_KINETIS_USBD_40072000_NUM_BIDIR_ENDPOINTS
|
||||
|
||||
#define DT_ETH_MCUX_0_NAME DT_NXP_KINETIS_ETHERNET_400C0004_LABEL
|
||||
|
||||
#define DT_ETH_MCUX_0_MAC DT_NXP_KINETIS_ETHERNET_400C0004_LOCAL_MAC_ADDRESS
|
||||
|
|
|
@ -14,9 +14,3 @@
|
|||
#define DT_ADC_0_NAME DT_NXP_KINETIS_ADC16_4003B000_LABEL
|
||||
|
||||
#define DT_RTC_0_NAME DT_LABEL(DT_INST(0, nxp_kinetis_rtc))
|
||||
|
||||
#define DT_USBD_KINETIS_NAME DT_NXP_KINETIS_USBD_40072000_LABEL
|
||||
#define DT_USBD_KINETIS_IRQ DT_NXP_KINETIS_USBD_40072000_IRQ_USB_OTG
|
||||
#define DT_USBD_KINETIS_IRQ_PRI DT_NXP_KINETIS_USBD_40072000_IRQ_USB_OTG_PRIORITY
|
||||
#define DT_USBD_KINETIS_BASE_ADDRESS DT_NXP_KINETIS_USBD_40072000_BASE_ADDRESS
|
||||
#define DT_USBD_KINETIS_NUM_BIDIR_EP DT_NXP_KINETIS_USBD_40072000_NUM_BIDIR_ENDPOINTS
|
||||
|
|
|
@ -9,10 +9,4 @@
|
|||
#define DT_FLASH_DEV_BASE_ADDRESS DT_NXP_KINETIS_FTFA_40020000_BASE_ADDRESS
|
||||
#define DT_FLASH_DEV_NAME DT_NXP_KINETIS_FTFA_40020000_LABEL
|
||||
|
||||
#define DT_USBD_KINETIS_NAME DT_NXP_KINETIS_USBD_40072000_LABEL
|
||||
#define DT_USBD_KINETIS_IRQ DT_NXP_KINETIS_USBD_40072000_IRQ_USB_OTG
|
||||
#define DT_USBD_KINETIS_IRQ_PRI DT_NXP_KINETIS_USBD_40072000_IRQ_USB_OTG_PRIORITY
|
||||
#define DT_USBD_KINETIS_BASE_ADDRESS DT_NXP_KINETIS_USBD_40072000_BASE_ADDRESS
|
||||
#define DT_USBD_KINETIS_NUM_BIDIR_EP DT_NXP_KINETIS_USBD_40072000_NUM_BIDIR_ENDPOINTS
|
||||
|
||||
/* End of SoC Level DTS fixup file */
|
||||
|
|
|
@ -13,12 +13,6 @@
|
|||
#define DT_FLASH_DEV_BASE_ADDRESS DT_NXP_KINETIS_FTFL_40020000_BASE_ADDRESS
|
||||
#define DT_FLASH_DEV_NAME DT_NXP_KINETIS_FTFL_40020000_LABEL
|
||||
|
||||
#define DT_USBD_KINETIS_NAME DT_NXP_KINETIS_USBD_40072000_LABEL
|
||||
#define DT_USBD_KINETIS_IRQ DT_NXP_KINETIS_USBD_40072000_IRQ_USB_OTG
|
||||
#define DT_USBD_KINETIS_IRQ_PRI DT_NXP_KINETIS_USBD_40072000_IRQ_USB_OTG_PRIORITY
|
||||
#define DT_USBD_KINETIS_BASE_ADDRESS DT_NXP_KINETIS_USBD_40072000_BASE_ADDRESS
|
||||
#define DT_USBD_KINETIS_NUM_BIDIR_EP DT_NXP_KINETIS_USBD_40072000_NUM_BIDIR_ENDPOINTS
|
||||
|
||||
#endif /* CONFIG_SOC_MKW22D5 || CONFIG_SOC_MKW24D5 */
|
||||
|
||||
#if defined(CONFIG_SOC_MKW40Z4) || defined(CONFIG_SOC_MKW41Z4)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue