From patchwork Wed Sep 2 14:24:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 52973 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by patches.linaro.org (Postfix) with ESMTPS id BC0022300B for ; Wed, 2 Sep 2015 14:25:05 +0000 (UTC) Received: by lagj9 with SMTP id j9sf5094574lag.0 for ; Wed, 02 Sep 2015 07:25:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-type:sender:precedence :list-id:x-original-sender:x-original-authentication-results :mailing-list:list-post:list-help:list-archive:list-unsubscribe; bh=OI3qtGDeAKyAj/fUwJ4/bvHAvauXzA1jJkQTfsb1tIg=; b=KolCncPKIIcBUYh4Lwwjx+stXsEMJyJvy0SBuNneuXZbAzeCmpRxu/cS6/wqJNd1e8 WBn2cX/s7GISUY/lm1lp0mM+gT6Xv60+jLOCE4R3tsvSl4SQ9kiXAqSxAa/6M6Ki/K7z /nRLMnptZS7Cto0NUfcbLcKZte4+/JF9+CIR+O1+YVk9mUWQ4AK82vpcuafrIL4MCMSa LzAdqcbZmsm4vhdE78B4k+fagdbdIWE3RZHzlvOywPkuB2V7TyGJO2hJ3uRTUX+1oz+E aKdX255g6n0oBtxNbeO7EzDKmxlEwD9QXFbp70ZfbGGpEJxbWrwzE2pCyfRMybHM518G PshQ== X-Gm-Message-State: ALoCoQk9RX8S8qYWKr2sHZ8zjD+tn2NKeVjxsT7n9+sVZRBjhmaD4iIcTd6FZT+knjQ6s5WGp2cE X-Received: by 10.194.76.6 with SMTP id g6mr3235486wjw.1.1441203904690; Wed, 02 Sep 2015 07:25:04 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.204.40 with SMTP id kv8ls83346lac.94.gmail; Wed, 02 Sep 2015 07:25:04 -0700 (PDT) X-Received: by 10.112.154.106 with SMTP id vn10mr16192490lbb.38.1441203904450; Wed, 02 Sep 2015 07:25:04 -0700 (PDT) Received: from mail-la0-f42.google.com (mail-la0-f42.google.com. [209.85.215.42]) by mx.google.com with ESMTPS id z1si19776431lbw.159.2015.09.02.07.25.04 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Sep 2015 07:25:04 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) client-ip=209.85.215.42; Received: by lanb10 with SMTP id b10so8212695lan.3 for ; Wed, 02 Sep 2015 07:25:04 -0700 (PDT) X-Received: by 10.152.28.193 with SMTP id d1mr15980018lah.72.1441203904337; Wed, 02 Sep 2015 07:25:04 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.164.42 with SMTP id yn10csp614752lbb; Wed, 2 Sep 2015 07:25:03 -0700 (PDT) X-Received: by 10.68.133.167 with SMTP id pd7mr55086085pbb.23.1441203902843; Wed, 02 Sep 2015 07:25:02 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id vr1si32358668pab.21.2015.09.02.07.25.01; Wed, 02 Sep 2015 07:25:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754885AbbIBOYu (ORCPT + 28 others); Wed, 2 Sep 2015 10:24:50 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:34626 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753929AbbIBOYr (ORCPT ); Wed, 2 Sep 2015 10:24:47 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id t82EOfTw004422; Wed, 2 Sep 2015 09:24:41 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id t82EOePX005215; Wed, 2 Sep 2015 09:24:40 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.224.2; Wed, 2 Sep 2015 09:24:40 -0500 Received: from rockdesk.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id t82EOPFR024150; Wed, 2 Sep 2015 09:24:38 -0500 From: Roger Quadros To: CC: , , , , , , , , Roger Quadros Subject: [PATCH v4 4/9] usb: dwc3: core: Adapt to named interrupts Date: Wed, 2 Sep 2015 17:24:19 +0300 Message-ID: <1441203864-15786-5-git-send-email-rogerq@ti.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1441203864-15786-1-git-send-email-rogerq@ti.com> References: <1441203864-15786-1-git-send-email-rogerq@ti.com> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: rogerq@ti.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Felipe Balbi Add support to use interrupt names, Following are the interrupt names Peripheral Interrupt - peripheral HOST Interrupt - host OTG Interrupt - otg [Roger Q] - If any of these are missing we use the first available IRQ resource so that we don't break with older DTBs. - Use gadget_irq in gadget driver. Signed-off-by: Felipe Balbi Signed-off-by: Roger Quadros --- drivers/usb/dwc3/core.c | 12 ++++++++++++ drivers/usb/dwc3/core.h | 7 +++++++ drivers/usb/dwc3/gadget.c | 2 +- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 2e36a9b..38b31df 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -958,6 +958,18 @@ static int dwc3_probe(struct platform_device *pdev) dwc->xhci_resources[1].flags = res->flags; dwc->xhci_resources[1].name = res->name; + dwc->otg_irq = platform_get_irq_byname(pdev, "otg"); + if (dwc->otg_irq < 0) + dwc->otg_irq = res->start; + + dwc->gadget_irq = platform_get_irq_byname(pdev, "peripheral"); + if (dwc->gadget_irq < 0) + dwc->gadget_irq = res->start; + + dwc->xhci_irq = platform_get_irq_byname(pdev, "host"); + if (dwc->xhci_irq < 0) + dwc->xhci_irq = res->start; + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) { dev_err(dev, "missing memory resource\n"); diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index 4b85330..bd32cb2 100644 --- a/drivers/usb/dwc3/core.h +++ b/drivers/usb/dwc3/core.h @@ -742,6 +742,9 @@ struct dwc3_scratchpad_array { * @maximum_speed: maximum speed requested (mainly for testing purposes) * @revision: revision register contents * @dr_mode: requested mode of operation + * @xhci_irq: IRQ number for XHCI IRQs + * @gadget_irq: IRQ number for Peripheral IRQs + * @otg_irq: IRQ number for OTG IRQs * @usb2_phy: pointer to USB2 PHY * @usb3_phy: pointer to USB3 PHY * @usb2_generic_phy: pointer to USB2 PHY @@ -847,6 +850,10 @@ struct dwc3 { enum usb_dr_mode dr_mode; + int gadget_irq; + int xhci_irq; + int otg_irq; + /* used for suspend/resume */ u32 dcfg; u32 gctl; diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 0c25704..1148ec8 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -1533,7 +1533,7 @@ static int dwc3_gadget_start(struct usb_gadget *g, int irq; u32 reg; - irq = platform_get_irq(to_platform_device(dwc->dev), 0); + irq = dwc->gadget_irq; ret = request_threaded_irq(irq, dwc3_interrupt, dwc3_thread_interrupt, IRQF_SHARED, "dwc3", dwc); if (ret) {