From 137247d9184bae4b7067c0e19745ac5406ac2c1d Mon Sep 17 00:00:00 2001 From: songyanguang <345810377@qq.com> Date: Fri, 30 Aug 2024 10:10:54 +0800 Subject: [PATCH] Obtain the interrupt number according to the usb id --- .../usb/components/port/xhci/usb_hc_xhci.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/xhci/usb_hc_xhci.c b/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/xhci/usb_hc_xhci.c index 999c290d9..537472983 100644 --- a/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/xhci/usb_hc_xhci.c +++ b/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/xhci/usb_hc_xhci.c @@ -1080,8 +1080,19 @@ IPC_SERVER_INTERFACE(Ipc_xhci_intr, 1); IPC_SERVER_REGISTER_INTERFACES(IpcXhciIntrHandler, 1, Ipc_xhci_intr); int bind_xhci_intr(void *para){ + int irq_no = USB3_0_INTERRUPT_NO; + struct xhci_host *xhci = (struct xhci_host *)para; - if (register_irq(USB3_0_INTERRUPT_NO, Ipc_xhci_intr) < 0) { + USB_LOG_DBG("bind_xhci_intr xhci pointer=%08x\n", xhci); + if (USB3_0_ID == xhci->bus->id) { + irq_no = USB3_0_INTERRUPT_NO; + } + if (USB3_1_ID == xhci->bus->id) { + irq_no = USB3_1_INTERRUPT_NO; + } + USB_LOG_DBG("bind_xhci_intr irq_no=%d\n", irq_no); + + if (register_irq(irq_no, Ipc_xhci_intr) < 0) { printf("bind failed!\n"); exit(1); } @@ -1108,7 +1119,7 @@ int create_xhci_intr_service(void *para){ return -1; } - + USB_LOG_DBG("create_xhci_intr_service xhci pointer=%08x\n", xhci); tid = thread(bind_xhci_intr, "xhci_intr_procedure", para); /* Create thread error! */