From patchwork Wed Dec 5 15:19:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 152922 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp9415896ljp; Wed, 5 Dec 2018 07:19:52 -0800 (PST) X-Google-Smtp-Source: AFSGD/X92hXuPqxMdUVMcP8pbyTD1JZ5yTqkCsQqnD69cU/ULGcChdRqJsQ1LNzzETSV8ObOK64F X-Received: by 2002:a63:801:: with SMTP id 1mr20555562pgi.275.1544023192201; Wed, 05 Dec 2018 07:19:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544023192; cv=none; d=google.com; s=arc-20160816; b=zc7cULGIXN3dn/wSSzeg94/zz8XK3PeJTvAcRbUhIs2eVomEH7zTrkqbrZy7e57YoW 1dNNWL18ul4iqKtfF6rVR1ESZA6U3l0+DQSfYNsn2ie5d0dln5M0g9nStKqkv93OreVt s23j97qfyVC3OPwT/8ydjlpYkz+2j5AMBn1EUrzBfIxOr9eQMFBNihgAwUuweD2wuYig pvmLy2/VnSeTWzA0vmeIEo0YDpO9IussLrTBijgSbzGN0MzEN2f/mlzgZTeWJQc/eDwJ lQIbeWz3dUVUnfpQF9L+8+ZGvT2Nucgb9R50+w0uyUwHqbm7ZJedbqsF+P/vmfpaYv8W WyKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=z1nWhNHQgfUtwFJxgzO+epxyHRSr7YEr+iRwu0V9p9I=; b=epiF/d9thnYqCwCzdRbi0LTxZNgMbn3OHNKa2Mva5Ax0g2Bq4cFFyzTG1enKONAQ3z Fm+InPECG7gy+qIqdTiyfKcKDNdu2nunKJTdsViKBt7+eJoEYaSZ4S/ABvGeMYZAznu7 OaLW9E3D3qPChUk/mjXnlkRtAaC13vGvSquihSk4f1Zd82eKlgzArNdTXOZ8pBRl+Pfo dI/9ePllmjJ5fuMEfF+x1SiKsZjJAVY92x7LZhxCrPR31CL2YSaXIHoBHvszoWRwxdox yivbDc4y+dStmNtMDpMFMMw7DsoJIYML+N2JO5klcQd5UAbSyyC06a7OOkhBD5hsNjWT KqNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=Rixo+vtx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 83si18578091pgf.572.2018.12.05.07.19.51; Wed, 05 Dec 2018 07:19:52 -0800 (PST) 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; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=Rixo+vtx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728139AbeLEPTt (ORCPT + 31 others); Wed, 5 Dec 2018 10:19:49 -0500 Received: from fllv0015.ext.ti.com ([198.47.19.141]:54308 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727094AbeLEPTs (ORCPT ); Wed, 5 Dec 2018 10:19:48 -0500 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id wB5FJj1R013242; Wed, 5 Dec 2018 09:19:45 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1544023185; bh=z1nWhNHQgfUtwFJxgzO+epxyHRSr7YEr+iRwu0V9p9I=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=Rixo+vtxBvU6EelT0P2GCNKE87V9vEQx5Fa/iogc7csv8KEr7MjCvnm5tgkDARygM hb8/j8htesfuJORGWcbeZmXupWNBGX6v1BopFv/9bxrysDVMWcdbwCizFOHmNvzdk6 Uw7LXiIrw4/PpBY/zDIQJoRC3e5KtrNe83xPsaj8= Received: from DFLE111.ent.ti.com (dfle111.ent.ti.com [10.64.6.32]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id wB5FJjFJ101314 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 5 Dec 2018 09:19:45 -0600 Received: from DFLE102.ent.ti.com (10.64.6.23) by DFLE111.ent.ti.com (10.64.6.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Wed, 5 Dec 2018 09:19:44 -0600 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE102.ent.ti.com (10.64.6.23) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Wed, 5 Dec 2018 09:19:44 -0600 Received: from dlelxv97.itg.ti.com (dlelxv97.itg.ti.com [172.17.2.193]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id wB5FJhSw020000; Wed, 5 Dec 2018 09:19:43 -0600 Received: from localhost.localdomain (vboxa0400828d.dhcp.ti.com [172.22.237.247]) by dlelxv97.itg.ti.com (8.14.3/8.13.8) with ESMTP id wB5FJWnc025493; Wed, 5 Dec 2018 09:19:41 -0600 From: Roger Quadros To: CC: , , , , , , , , , Subject: [PATCH 3/3] usb: dwc3: keystone: Add support for ti,am654-dwc3 Date: Wed, 5 Dec 2018 17:19:31 +0200 Message-ID: <1544023171-5796-4-git-send-email-rogerq@ti.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544023171-5796-1-git-send-email-rogerq@ti.com> References: <1544023171-5796-1-git-send-email-rogerq@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The AM654 SoC contains a DWC3 controller with TI specific wrapper. Add support for that. Unlike the Keystone 2 case, for AM654 We don't need to process any IRQs for basic USB operation. Signed-off-by: Roger Quadros --- drivers/usb/dwc3/Kconfig | 6 +++--- drivers/usb/dwc3/dwc3-keystone.c | 11 ++++++++++- 2 files changed, 13 insertions(+), 4 deletions(-) -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki diff --git a/drivers/usb/dwc3/Kconfig b/drivers/usb/dwc3/Kconfig index 1a0404f..a83a84f 100644 --- a/drivers/usb/dwc3/Kconfig +++ b/drivers/usb/dwc3/Kconfig @@ -86,11 +86,11 @@ config USB_DWC3_HAPS platform, please say 'Y' or 'M' here. config USB_DWC3_KEYSTONE - tristate "Texas Instruments Keystone2 Platforms" - depends on ARCH_KEYSTONE || COMPILE_TEST + tristate "Texas Instruments Keystone2/3 Platforms" + depends on ARCH_KEYSTONE || ARCH_K3 || COMPILE_TEST default USB_DWC3 help - Support of USB2/3 functionality in TI Keystone2 platforms. + Support of USB2/3 functionality in TI Keystone2/3 platforms. Say 'Y' or 'M' here if you have one such device config USB_DWC3_OF_SIMPLE diff --git a/drivers/usb/dwc3/dwc3-keystone.c b/drivers/usb/dwc3/dwc3-keystone.c index 193a9a8..cbee5fb 100644 --- a/drivers/usb/dwc3/dwc3-keystone.c +++ b/drivers/usb/dwc3/dwc3-keystone.c @@ -106,6 +106,10 @@ static int kdwc3_probe(struct platform_device *pdev) goto err_irq; } + /* IRQ processing not required currently for AM65 */ + if (of_device_is_compatible(node, "ti,am654-dwc3")) + goto skip_irq; + irq = platform_get_irq(pdev, 0); if (irq < 0) { dev_err(&pdev->dev, "missing irq\n"); @@ -123,6 +127,7 @@ static int kdwc3_probe(struct platform_device *pdev) kdwc3_enable_irqs(kdwc); +skip_irq: error = of_platform_populate(node, NULL, NULL, dev); if (error) { dev_err(&pdev->dev, "failed to create dwc3 core\n"); @@ -152,8 +157,11 @@ static int kdwc3_remove_core(struct device *dev, void *c) static int kdwc3_remove(struct platform_device *pdev) { struct dwc3_keystone *kdwc = platform_get_drvdata(pdev); + struct device_node *node = pdev->dev.of_node; + + if (!of_device_is_compatible(node, "ti,am654-dwc3")) + kdwc3_disable_irqs(kdwc); - kdwc3_disable_irqs(kdwc); device_for_each_child(&pdev->dev, NULL, kdwc3_remove_core); pm_runtime_put_sync(kdwc->dev); pm_runtime_disable(kdwc->dev); @@ -165,6 +173,7 @@ static int kdwc3_remove(struct platform_device *pdev) static const struct of_device_id kdwc3_of_match[] = { { .compatible = "ti,keystone-dwc3", }, + { .compatible = "ti,am654-dwc3" }, {}, }; MODULE_DEVICE_TABLE(of, kdwc3_of_match);