Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5cb12017 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: dwc3: Request dwc3 irq in driver probe"

parents 95873bf7 a7ada7c7
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -777,6 +777,7 @@ static int dwc3_probe(struct platform_device *pdev)
	u8			lpm_nyet_threshold;
	u8			hird_threshold;
	u32			num_evt_buffs;
	int			irq;

	int			ret;

@@ -802,6 +803,17 @@ static int dwc3_probe(struct platform_device *pdev)
	dwc->xhci_resources[1].flags = res->flags;
	dwc->xhci_resources[1].name = res->name;

	irq = platform_get_irq(to_platform_device(dwc->dev), 0);
	ret = devm_request_irq(dev, irq, dwc3_interrupt, IRQF_SHARED, "dwc3",
			dwc);
	if (ret) {
		dev_err(dwc->dev, "failed to request irq #%d --> %d\n",
				irq, ret);
		return -ENODEV;
	}

	dwc->irq = irq;

	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	if (!res) {
		dev_err(dev, "missing memory resource\n");
+3 −18
Original line number Diff line number Diff line
@@ -2031,7 +2031,6 @@ void dwc3_gadget_disable_irq(struct dwc3 *dwc)
	dwc3_writel(dwc->regs, DWC3_DEVTEN, 0x00);
}

static irqreturn_t dwc3_interrupt(int irq, void *_dwc);
static irqreturn_t dwc3_thread_interrupt(int irq, void *_dwc);
static void dwc3_gadget_disconnect_interrupt(struct dwc3 *dwc);

@@ -2181,18 +2180,7 @@ static int dwc3_gadget_start(struct usb_gadget *g,
	struct dwc3		*dwc = gadget_to_dwc(g);
	unsigned long		flags;
	int			ret = 0;
	int			irq;

	irq = platform_get_irq(to_platform_device(dwc->dev), 0);
	dwc->irq = irq;
	ret = request_irq(irq, dwc3_interrupt, IRQF_SHARED, "dwc3", dwc);
	if (ret) {
		dev_err(dwc->dev, "failed to request irq #%d --> %d\n",
				irq, ret);
		goto err0;
	}

	dwc->irq = irq;
	g->interrupt_num = dwc->irq;
	spin_lock_irqsave(&dwc->lock, flags);

@@ -2201,7 +2189,7 @@ static int dwc3_gadget_start(struct usb_gadget *g,
				dwc->gadget.name,
				dwc->gadget_driver->driver.name);
		ret = -EBUSY;
		goto err1;
		goto err0;
	}

	dwc->gadget_driver	= driver;
@@ -2215,11 +2203,8 @@ static int dwc3_gadget_start(struct usb_gadget *g,
	spin_unlock_irqrestore(&dwc->lock, flags);
	return 0;

err1:
	spin_unlock_irqrestore(&dwc->lock, flags);
	free_irq(irq, dwc);

err0:
	spin_unlock_irqrestore(&dwc->lock, flags);
	return ret;
}

@@ -3583,7 +3568,7 @@ static irqreturn_t dwc3_check_event_buf(struct dwc3 *dwc, u32 buf)
	return IRQ_WAKE_THREAD;
}

static irqreturn_t dwc3_interrupt(int irq, void *_dwc)
irqreturn_t dwc3_interrupt(int irq, void *_dwc)
{
	struct dwc3			*dwc = _dwc;
	int				i;
+1 −0
Original line number Diff line number Diff line
@@ -96,6 +96,7 @@ int dwc3_gadget_ep0_queue(struct usb_ep *ep, struct usb_request *request,
		gfp_t gfp_flags);
int __dwc3_gadget_ep_set_halt(struct dwc3_ep *dep, int value, int protocol);
void dwc3_stop_active_transfer(struct dwc3 *dwc, u32 epnum, bool force);
irqreturn_t dwc3_interrupt(int irq, void *_dwc);

static inline dma_addr_t dwc3_trb_dma_offset(struct dwc3_ep *dep,
		struct dwc3_trb *trb)