From patchwork Sat Oct 13 13:47:31 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Gautam X-Patchwork-Id: 1589131 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id B2DCB3FD9C for ; Sat, 13 Oct 2012 13:42:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752297Ab2JMNmP (ORCPT ); Sat, 13 Oct 2012 09:42:15 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:52566 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750925Ab2JMNmN (ORCPT ); Sat, 13 Oct 2012 09:42:13 -0400 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MBU00DU53E88ID0@mailout4.samsung.com>; Sat, 13 Oct 2012 22:42:12 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.125]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id B3.55.07865.4BF69705; Sat, 13 Oct 2012 22:42:12 +0900 (KST) X-AuditID: cbfee61a-b7f976d000001eb9-3e-50796fb4ef26 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 13.55.07865.3BF69705; Sat, 13 Oct 2012 22:42:12 +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 <0MBU00D993E1Z1A0@mmp1.samsung.com>; Sat, 13 Oct 2012 22:42:11 +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 1/2] USB: dwc3-exynos: Add support for device tree Date: Sat, 13 Oct 2012 19:17:31 +0530 Message-id: <1350136052-25583-2-git-send-email-gautam.vivek@samsung.com> X-Mailer: git-send-email 1.7.6.5 In-reply-to: <1350136052-25583-1-git-send-email-gautam.vivek@samsung.com> References: <1350136052-25583-1-git-send-email-gautam.vivek@samsung.com> DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrELMWRmVeSWpSXmKPExsWyRsSkVndLfmWAwayZ/Bazl/SzWCxa1srs wOTxeZNcAGMUl01Kak5mWWqRvl0CV8asOSuYCk7xV2z9uJexgfEJTxcjJ4eEgInEnEl72SBs MYkL99YD2VwcQgJLGSUeNu9ngSk6+nUqC0RiEaPE0bvNTBDOZCaJl4tmMYFUsQnoSjS93cUI YosIJEg8ePGdFaSIWaCHUWLFpwawUcICThL/P9wEK2IRUJVY39gD1swr4CHx5lgbK8Q6BYk3 t58xg9icAp4Szec/gN0nBFRzYNpOFoheAYlvkw8B2RxA9bISmw4wg+ySELjNJrF6216oOZIS B1fcYJnAKLyAkWEVo2hqQXJBcVJ6rqFecWJucWleul5yfu4mRmBAnv73TGoH48oGi0OMAhyM Sjy8N7srAoRYE8uKK3MPMUpwMCuJ8JpmVQYI8aYkVlalFuXHF5XmpBYfYvQBumQis5Rocj4w WvJK4g2NTcxNjU0tjYzMTE1xCCuJ8zZ7pAQICaQnlqRmp6YWpBbBjGPi4JRqYPS6fphr+doJ aoEsXZo3ntq+Om7HcWFi/jNtuXMVS96dVp79i9/Uwpf92MbfDW7TsmpEm1s3fjec9qa59E+d QmmLFd+5hjUe/ffUns2aUb/QZ6156pHK97qKr3/+aGSzfT/1ymQnqUXu/5+++u2WfHtv4ts9 z3SywyVPNYY8KLGti2HLWf0r4bcSS3FGoqEWc1FxIgAJ1viGdQIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprIIsWRmVeSWpSXmKPExsVy+t9jAd0t+ZUBBq8vsVjMXtLPYrFoWSuz A5PH501yAYxRDYw2GamJKalFCql5yfkpmXnptkrewfHO8aZmBoa6hpYW5koKeYm5qbZKLj4B um6ZOUCjlRTKEnNKgUIBicXFSvp2mCaEhrjpWsA0Ruj6hgTB9RgZoIGENYwZs+asYCo4xV+x 9eNexgbGJzxdjJwcEgImEke/TmWBsMUkLtxbz9bFyMUhJLCIUeLo3WYmCGcyk8TLRbOYQKrY BHQlmt7uYgSxRQQSJB68+M4KUsQs0MMoseJTA9goYQEnif8fboIVsQioSqxv7AFr5hXwkHhz rI0VYp2CxJvbz5hBbE4BT4nm8x/YQGwhoJoD03ayTGDkXcDIsIpRNLUguaA4KT3XUK84Mbe4 NC9dLzk/dxMjONyfSe1gXNlgcYhRgINRiYf3ZndFgBBrYllxZe4hRgkOZiURXtOsygAh3pTE yqrUovz4otKc1OJDjD5AV01klhJNzgfGYl5JvKGxibmpsamliYWJmSUOYSVx3maPlAAhgfTE ktTs1NSC1CKYcUwcnFINjI2ha6Z6mzJIFM5xOZZQ3WWjuI3Ts/BGUb0fh0Dbw4k9a7baMV9/ asVqLviUlYVL/huDrQnLxDUHd3/x1J3u+yP8Ud4F3m/qL/PvnlQxc93+q+Cs2avlilMki1pm 7madXtAhuZgh+u+VRfxRn99NPmu1ecalu5OviTYwtTy6Wfy0ocCh8/LC90osxRmJhlrMRcWJ AF3ATZ+kAgAA 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 driver for exynos using device tree Signed-off-by: Vivek Gautam --- drivers/usb/dwc3/dwc3-exynos.c | 22 ++++++++++++++++++++++ 1 files changed, 22 insertions(+), 0 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c index ca65978..78e6219 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,16 @@ 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; + if (!pdev->dev.coherent_dma_mask) + pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); + platform_set_drvdata(pdev, exynos); devid = dwc3_get_device_id(); @@ -200,11 +213,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), }, };