From patchwork Sat Nov 3 12:30:27 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Gautam X-Patchwork-Id: 1692211 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 5CD01DFB7B for ; Sat, 3 Nov 2012 12:24:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932416Ab2KCMY4 (ORCPT ); Sat, 3 Nov 2012 08:24:56 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:23008 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932075Ab2KCMYy (ORCPT ); Sat, 3 Nov 2012 08:24:54 -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 <0MCW009YDVT826C0@mailout1.samsung.com>; Sat, 03 Nov 2012 21:24:53 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.125]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id A1.34.01231.51D05905; Sat, 03 Nov 2012 21:24:53 +0900 (KST) X-AuditID: cbfee61a-b7fa66d0000004cf-13-50950d150a54 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 21.34.01231.51D05905; Sat, 03 Nov 2012 21:24:53 +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 <0MCW00AJCVSYDX60@mmp1.samsung.com>; Sat, 03 Nov 2012 21:24:53 +0900 (KST) From: Vivek Gautam To: linux-usb@vger.kernel.org, devicetree-discuss@lists.ozlabs.org, linux-omap@vger.kernel.org Cc: gregkh@linuxfoundation.org, balbi@ti.com, rob.herring@calxeda.com, av.tikhomirov@samsung.com, kishon@ti.com Subject: [PATCH v3 1/2] USB: dwc3-exynos: Add support for device tree Date: Sat, 03 Nov 2012 18:00:27 +0530 Message-id: <1351945828-28559-2-git-send-email-gautam.vivek@samsung.com> X-Mailer: git-send-email 1.7.6.5 In-reply-to: <1351945828-28559-1-git-send-email-gautam.vivek@samsung.com> References: <1351945828-28559-1-git-send-email-gautam.vivek@samsung.com> DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrALMWRmVeSWpSXmKPExsWyRsSkVleUd2qAwfI5+hazl/SzWCxa1srs wOTxeZNcAGMUl01Kak5mWWqRvl0CV8aKJe2MBd/5Km4uO8XWwDiXp4uRk0NCwETi9dbfjBC2 mMSFe+vZuhi5OIQEljJKfPz0nBWmaNvm58wQiUWMEh0XtzBBOJOZJBr7prGAVLEJ6Eo0vd0F NkpEIEHi6q+/QB0cHMwChRLTz4mDhIUFXCWurn3JBmKzCKhKPG3pBGvlFfCQ+Ll6HwvEMgWJ N7efMYPYnAKeEidv3QMbKQRUc6rrKDtEr4DEt8mHWEDGSwjISmw6AHabhMBtNolH3y8yQ8yR lDi44gbLBEbhBYwMqxhFUwuSC4qT0nMN9YoTc4tL89L1kvNzNzECg/H0v2dSOxhXNlgcYhTg YFTi4b3ANyVAiDWxrLgy9xCjBAezkgjv4mNAId6UxMqq1KL8+KLSnNTiQ4w+QJdMZJYSTc4H RkpeSbyhsYm5qbGppZGRmakpDmElcd5mj5QAIYH0xJLU7NTUgtQimHFMHJxSDYw6/b2Xr28S mcQVXXluQ22p37eFR1M0g9f8s51twj+B01PIuSejXaFu+eeLa67WTli7tO80QxzrHunnmaq8 K2NSzx/gvPymPD3zaPaE8NOmc15tjYgo+a/+dfrlbHG1I7aV5jZvlHSs7q1ZnqO+78n9r2cr dOfcyZt3M/nK8eQ9sQtU9llk5C9UYinOSDTUYi4qTgQADjfJlXMCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupnkeLIzCtJLcpLzFFi42I5/e+xgK4o79QAg3t/5CxmL+lnsVi0rJXZ gcnj8ya5AMaoBkabjNTElNQihdS85PyUzLx0WyXv4HjneFMzA0NdQ0sLcyWFvMTcVFslF58A XbfMHKDRSgpliTmlQKGAxOJiJX07TBNCQ9x0LWAaI3R9Q4LgeowM0EDCGsaMFUvaGQu+81Xc XHaKrYFxLk8XIyeHhICJxLbNz5khbDGJC/fWs3UxcnEICSxilOi4uIUJwpnMJNHYN40FpIpN QFei6e0uRhBbRCBB4uqvv0DdHBzMAoUS08+Jg4SFBVwlrq59yQZiswioSjxt6QRr5RXwkPi5 eh8LxDIFiTe3n4Et5hTwlDh56x7YSCGgmlNdR9knMPIuYGRYxSiaWpBcUJyUnmuoV5yYW1ya l66XnJ+7iREc6s+kdjCubLA4xCjAwajEw3uBb0qAEGtiWXFl7iFGCQ5mJRHexceAQrwpiZVV qUX58UWlOanFhxh9gK6ayCwlmpwPjMO8knhDYxNzU2NTSxMLEzNLHMJK4rzNHikBQgLpiSWp 2ampBalFMOOYODilGhgdZnI97fC302wtWhq/aM3evxZKd8u8Atf/0arMuNK33zzyZ81dkc5/ jm/XXOxp5mb2kdq2JGletsGKnC8qWskzPq+tLC5gYWYr+mDIt/znj5PfaiN0Zp0JO3Lu8gM/ iZnMvxaZTgvaNt14w/Lt/9y/FFrH8vdNPaiwq0HQ8+ejlzufMXRx3NiixFKckWioxVxUnAgA Ze6Pi6ICAAA= 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 586f105..6471d78 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; @@ -102,6 +105,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); ret = dwc3_exynos_register_phys(exynos); @@ -191,11 +202,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), }, };