From patchwork Tue Oct 16 08:45:56 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Gautam X-Patchwork-Id: 1599551 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 91410DFFED for ; Tue, 16 Oct 2012 08:48:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752706Ab2JPIr7 (ORCPT ); Tue, 16 Oct 2012 04:47:59 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:62725 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750950Ab2JPIr6 (ORCPT ); Tue, 16 Oct 2012 04:47:58 -0400 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MBZ00HW49IJP4R0@mailout1.samsung.com>; Tue, 16 Oct 2012 17:42:32 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.125]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 70.5F.07865.8FD1D705; Tue, 16 Oct 2012 17:42:32 +0900 (KST) X-AuditID: cbfee61a-b7f976d000001eb9-fc-507d1df856f0 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id BF.4F.07865.8FD1D705; Tue, 16 Oct 2012 17:42:32 +0900 (KST) Received: from vivekkumarg-linuxpc.sisodomain.com ([107.108.73.134]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MBZ001XV9FCS0D0@mmp1.samsung.com>; Tue, 16 Oct 2012 17:42:32 +0900 (KST) From: Vivek Gautam To: linux-usb@vger.kernel.org, linux-omap@vger.kernel.org, devicetree-discuss@lists.ozlabs.org Cc: gregkh@linuxfoundation.org, balbi@ti.com, rob.herring@calxeda.com, thomas.abraham@linaro.org, kishon@ti.com, av.tikhomirov@samsung.com Subject: [PATCH v2 1/2] USB: dwc3-exynos: Add support for device tree Date: Tue, 16 Oct 2012 14:15:56 +0530 Message-id: <1350377157-28465-2-git-send-email-gautam.vivek@samsung.com> X-Mailer: git-send-email 1.7.6.5 In-reply-to: <1350377157-28465-1-git-send-email-gautam.vivek@samsung.com> References: <1350377157-28465-1-git-send-email-gautam.vivek@samsung.com> DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrHLMWRmVeSWpSXmKPExsWyRsSkVveHbG2AwYpNEhazl/SzWCxa1srs wOTxeZNcAGMUl01Kak5mWWqRvl0CV8aPX6wFb/gq7m6La2CcxNPFyMkhIWAi8fx/KxOELSZx 4d56ti5GLg4hgaWMElc/3mHuYuQAK7r/LA4ivohRYvKEJmYIZzKTxJeP/5lButkEdCWa3u5i BLFFBBIkHrz4zgpSxCzQwyix4lMDC0hCWMBV4uTJXrAGFgFVib5Ff1hANvAKeEgcakqCuEJB 4s3tZ2AlnAKeEguufWADsYWASm7/PAXVKiDxbfIhFojjZCU2HQC7R0LgNpvEnRvrWCDmSEoc XHGDZQKj8AJGhlWMoqkFyQXFSem5hnrFibnFpXnpesn5uZsYgYF4+t8zqR2MKxssDjEKcDAq 8fBmONcECLEmlhVX5h5ilOBgVhLh9ZgIFOJNSaysSi3Kjy8qzUktPsToA3TJRGYp0eR8YJTk lcQbGpuYmxqbWhoZmZma4hBWEudt9kgJEBJITyxJzU5NLUgtghnHxMEp1cCoW+x46kSSfELx HPlkjXM/ZRuTI7J2ONZP2dWxSl+EYRVLJG9w8J3VDCISCcnzPay99qaXrvpRmPBrt2b364yY lQVpD+yutpemFfoq7Xv2KSm9oKDA6L9oh+93zYvnvs1YoXR9y9HTmzUkpt5R+W13SF7l7j81 r//PzNPr387c+882R6fibqwSS3FGoqEWc1FxIgCqdhP1cQIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuplkeLIzCtJLcpLzFFi42I5/e+xgO4P2doAg1n93Bazl/SzWCxa1srs wOTxeZNcAGNUA6NNRmpiSmqRQmpecn5KZl66rZJ3cLxzvKmZgaGuoaWFuZJCXmJuqq2Si0+A rltmDtBoJYWyxJxSoFBAYnGxkr4dpgmhIW66FjCNEbq+IUFwPUYGaCBhDWPGj1+sBW/4Ku5u i2tgnMTTxcjBISFgInH/WVwXIyeQKSZx4d56ti5GLg4hgUWMEpMnNDFDOJOZJL58/M8MUsUm oCvR9HYXI4gtIpAg8eDFd1aQImaBHkaJFZ8aWEASwgKuEidP9oI1sAioSvQt+sMCso1XwEPi UFMSxDYFiTe3n4GVcAp4Siy49oENxBYCKrn98xTzBEbeBYwMqxhFUwuSC4qT0nMN9YoTc4tL 89L1kvNzNzGCw/yZ1A7GlQ0WhxgFOBiVeHgznGsChFgTy4orcw8xSnAwK4nwekwECvGmJFZW pRblxxeV5qQWH2L0ATpqIrOUaHI+MAbzSuINjU3MTY1NLU0sTMwscQgrifM2e6QECAmkJ5ak ZqemFqQWwYxj4uCUamCMPHZ5Ql3lufadhgVmKyaYpEXO71xRtCkjhPEl57ckuU0BR87/TKwz P3Jta+pZHbcQpfRdL0MdnDSzTR8EaW3yNXp04GD6MeN70kvmZVr7lTeVGMdO9XPKSDZ46b5i s4DR9GLfymv9TzKCG0P6uD4Yv15dIiwu9HZJy/SgWVeV7tqe3LL3doUSS3FGoqEWc1FxIgA2 fC3coAIAAA== X-CFilter-Loop: Reflected Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org This patch adds support to parse probe data for dwc3-exynos driver using device tree. Signed-off-by: Vivek Gautam --- drivers/usb/dwc3/dwc3-exynos.c | 20 ++++++++++++++++++++ 1 files changed, 20 insertions(+), 0 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c index ca65978..d11ef49 100644 --- a/drivers/usb/dwc3/dwc3-exynos.c +++ b/drivers/usb/dwc3/dwc3-exynos.c @@ -21,6 +21,7 @@ #include #include #include +#include #include "core.h" @@ -87,6 +88,8 @@ err1: return ret; } +static u64 dwc3_exynos_dma_mask = DMA_BIT_MASK(32); + static int __devinit dwc3_exynos_probe(struct platform_device *pdev) { struct dwc3_exynos_data *pdata = pdev->dev.platform_data; @@ -103,6 +106,14 @@ static int __devinit dwc3_exynos_probe(struct platform_device *pdev) goto err0; } + /* + * Right now device-tree probed devices don't get dma_mask set. + * Since shared usb code relies on it, set it here for now. + * Once we move to full device tree support this will vanish off. + */ + if (!pdev->dev.dma_mask) + pdev->dev.dma_mask = &dwc3_exynos_dma_mask; + platform_set_drvdata(pdev, exynos); devid = dwc3_get_device_id(); @@ -200,11 +211,20 @@ static int __devexit dwc3_exynos_remove(struct platform_device *pdev) return 0; } +#ifdef CONFIG_OF +static const struct of_device_id exynos_dwc3_match[] = { + { .compatible = "samsung,exynos-dwc3" }, + {}, +}; +MODULE_DEVICE_TABLE(of, exynos_dwc3_match); +#endif + static struct platform_driver dwc3_exynos_driver = { .probe = dwc3_exynos_probe, .remove = __devexit_p(dwc3_exynos_remove), .driver = { .name = "exynos-dwc3", + .of_match_table = of_match_ptr(exynos_dwc3_match), }, };