From patchwork Tue Sep 18 08:16:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 10603835 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4C92A17E1 for ; Tue, 18 Sep 2018 08:17:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4140E2A4FF for ; Tue, 18 Sep 2018 08:17:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 356552A51E; Tue, 18 Sep 2018 08:17:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CDD6E2A539 for ; Tue, 18 Sep 2018 08:17:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729192AbeIRNs6 (ORCPT ); Tue, 18 Sep 2018 09:48:58 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:36643 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727846AbeIRNsk (ORCPT ); Tue, 18 Sep 2018 09:48:40 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20180918081708euoutp0291a261658ce6101d3e6b805d170bc38d~VcJPubH0v2970329703euoutp02z; Tue, 18 Sep 2018 08:17:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20180918081708euoutp0291a261658ce6101d3e6b805d170bc38d~VcJPubH0v2970329703euoutp02z DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1537258628; bh=5nMv7VSQCMHKkca3mIzGPSPq7/SYPfQI4vPGqtpZxu4=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=viDhE7tVCwl9vd6X1oBr2QYQTFTFtMoyFq2GqRZ2iXfY6hYLiP06q24ibjlIxxkEV 4MWt08Jn/uOktwmddM1IY2yGU5jSeAu7KffScEkbw7hVaG2JeVhVe14be+1sqFGFPs Hz8VN6YqpHddg6XD7vmIgoedSWNFAA4W3iYmR5fk= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180918081707eucas1p26bc810842f9a959f5e8d4b9a7f673c8e~VcJPKytPG1987119871eucas1p20; Tue, 18 Sep 2018 08:17:07 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 63.4D.04294.384B0AB5; Tue, 18 Sep 2018 09:17:07 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180918081706eucas1p10c03f027b993178ede5cff6d81bedfed~VcJOVuXzD1590615906eucas1p1_; Tue, 18 Sep 2018 08:17:06 +0000 (GMT) X-AuditID: cbfec7f4-84fff700000010c6-62-5ba0b483a83f Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id F7.6B.04128.284B0AB5; Tue, 18 Sep 2018 09:17:06 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PF800C5KSCD4H70@eusync4.samsung.com>; Tue, 18 Sep 2018 09:17:06 +0100 (BST) From: Marek Szyprowski To: linux-usb@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Greg Kroah-Hartman , Felipe Balbi , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz Subject: [PATCH 1/4] usb: dwc3: exynos: Remove dead code Date: Tue, 18 Sep 2018 10:16:50 +0200 Message-id: <20180918081653.314-2-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 In-reply-to: <20180918081653.314-1-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrCIsWRmVeSWpSXmKPExsWy7djP87rNWxZEGxz4I2exccZ6VotjbU/Y LZoXr2ezOH9+A7vFjPP7mCwWLWtltlh75C67A7vHplWdbB77565h9+jbsorR4/MmuQCWKC6b lNSczLLUIn27BK6MU/NfMBVcl63oP+rXwPhKoouRk0NCwERi8oWFrF2MXBxCAisYJQ7sP80I 4XxmlDj49iEzTNWJGTdYIBLLGCV+LNgO5TQwSVw88IkJpIpNwFCi620XG4gtIuAgsWTpHTaQ ImaBJ4wSuzd/YQRJCAtYSLxp6AFKcHCwCKhKXPkdDRLmFbCWONq4lBVim7zE6g0HwDZzCthI 7Nz4CGyZhMBfVomXV1ayQxS5SBxvPMcEYQtLvDq+BSouI3F5cjdUQzOjRPuMWewQTg+jxNY5 O9ggqqwlDh+/CLaOWYBPYtK26cwgF0kI8Ep0tAlBmB4Ss34XQHzZzyjRuGYV6wRGyQWMDKsY xVNLi3PTU4uN8lLL9YoTc4tL89L1kvNzNzEC4+70v+NfdjDu+pN0iFGAg1GJh3fBgvnRQqyJ ZcWVuYcYJTiYlUR4OXMWRAvxpiRWVqUW5ccXleakFh9ilOZgURLn5dNKixYSSE8sSc1OTS1I LYLJMnFwSjUwGp12XHgurrDWbG2sRvOqAvf1TN9vL2PXil1yR/H2DS3exFkru8I9TjTp5/0u eCXxh09wbZznXrGA+5/W7d29xvzMas8KhcD1b+12rs9W8H/cdHTJlqURwYYpLe9cndpVOQ46 xFVEuikbcSUE6c6+WrNAzOWX2Wljjrehm5LiZ3MtWnFhOu9VJZbijERDLeai4kQAAnHByrcC AAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpkluLIzCtJLcpLzFFi42I5/e/4Nd2mLQuiDTassrbYOGM9q8Wxtifs Fs2L17NZnD+/gd1ixvl9TBaLlrUyW6w9cpfdgd1j06pONo/9c9ewe/RtWcXo8XmTXABLFJdN SmpOZllqkb5dAlfGqfkvmAquy1b0H/VrYHwl0cXIySEhYCJxYsYNli5GLg4hgSWMEu1b2pkg nCYmif1PZjGCVLEJGEp0ve1iA7FFBBwkliy9wwZSxCzwhFHixpX5YAlhAQuJNw09QDYHB4uA qsSV39EgYV4Ba4mjjUtZIbbJS6zecIAZxOYUsJHYufERC4gtBFSzrO0y6wRGngWMDKsYRVJL i3PTc4uN9IoTc4tL89L1kvNzNzECA2bbsZ9bdjB2vQs+xCjAwajEw/tj0fxoIdbEsuLK3EOM EhzMSiK8nDkLooV4UxIrq1KL8uOLSnNSiw8xSnOwKInznjeojBISSE8sSc1OTS1ILYLJMnFw SjUwWiisUbFu9a5ep3zU9rag/1Ne4wXsb+Ne2Igk62g1zpnOJiw/oXf+sQZl4ePHZBzzCs+f 2+K7f6nlNh7fOz2Sah7zTazezWs66e/Iaxvw7/BTzuAJkYe+2HMWSnlJSvN6B73g61m/ZcZV s6TllRe7/dgmRrVa3tzAsVq865T19fez1WQvT9qnxFKckWioxVxUnAgArsB1CBQCAAA= X-CMS-MailID: 20180918081706eucas1p10c03f027b993178ede5cff6d81bedfed X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180918081706eucas1p10c03f027b993178ede5cff6d81bedfed References: <20180918081653.314-1-m.szyprowski@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP All supported Exynos variants provide respective generic PHY framework based drivers for controlling USB PHYs, so there is no point creating fake USB PHYs based on platform devices. While removing useless code, remove calls to runtime PM, which have no effect. Signed-off-by: Marek Szyprowski --- drivers/usb/dwc3/dwc3-exynos.c | 75 ---------------------------------- 1 file changed, 75 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c index a94fb1ba8f2c..0a946c66c3bb 100644 --- a/drivers/usb/dwc3/dwc3-exynos.c +++ b/drivers/usb/dwc3/dwc3-exynos.c @@ -13,15 +13,11 @@ #include #include #include -#include -#include #include #include #include struct dwc3_exynos { - struct platform_device *usb2_phy; - struct platform_device *usb3_phy; struct device *dev; struct clk *clk; @@ -32,61 +28,6 @@ struct dwc3_exynos { struct regulator *vdd10; }; -static int dwc3_exynos_register_phys(struct dwc3_exynos *exynos) -{ - struct usb_phy_generic_platform_data pdata; - struct platform_device *pdev; - int ret; - - memset(&pdata, 0x00, sizeof(pdata)); - - pdev = platform_device_alloc("usb_phy_generic", PLATFORM_DEVID_AUTO); - if (!pdev) - return -ENOMEM; - - exynos->usb2_phy = pdev; - pdata.type = USB_PHY_TYPE_USB2; - pdata.gpio_reset = -1; - - ret = platform_device_add_data(exynos->usb2_phy, &pdata, sizeof(pdata)); - if (ret) - goto err1; - - pdev = platform_device_alloc("usb_phy_generic", PLATFORM_DEVID_AUTO); - if (!pdev) { - ret = -ENOMEM; - goto err1; - } - - exynos->usb3_phy = pdev; - pdata.type = USB_PHY_TYPE_USB3; - - ret = platform_device_add_data(exynos->usb3_phy, &pdata, sizeof(pdata)); - if (ret) - goto err2; - - ret = platform_device_add(exynos->usb2_phy); - if (ret) - goto err2; - - ret = platform_device_add(exynos->usb3_phy); - if (ret) - goto err3; - - return 0; - -err3: - platform_device_del(exynos->usb2_phy); - -err2: - platform_device_put(exynos->usb3_phy); - -err1: - platform_device_put(exynos->usb2_phy); - - return ret; -} - static int dwc3_exynos_remove_child(struct device *dev, void *unused) { struct platform_device *pdev = to_platform_device(dev); @@ -164,12 +105,6 @@ static int dwc3_exynos_probe(struct platform_device *pdev) goto vdd10_err; } - ret = dwc3_exynos_register_phys(exynos); - if (ret) { - dev_err(dev, "couldn't register PHYs\n"); - goto phys_err; - } - if (node) { ret = of_platform_populate(node, NULL, NULL, dev); if (ret) { @@ -185,9 +120,6 @@ static int dwc3_exynos_probe(struct platform_device *pdev) return 0; populate_err: - platform_device_unregister(exynos->usb2_phy); - platform_device_unregister(exynos->usb3_phy); -phys_err: regulator_disable(exynos->vdd10); vdd10_err: regulator_disable(exynos->vdd33); @@ -205,8 +137,6 @@ static int dwc3_exynos_remove(struct platform_device *pdev) struct dwc3_exynos *exynos = platform_get_drvdata(pdev); device_for_each_child(&pdev->dev, NULL, dwc3_exynos_remove_child); - platform_device_unregister(exynos->usb2_phy); - platform_device_unregister(exynos->usb3_phy); clk_disable_unprepare(exynos->axius_clk); clk_disable_unprepare(exynos->susp_clk); @@ -258,11 +188,6 @@ static int dwc3_exynos_resume(struct device *dev) clk_enable(exynos->clk); clk_enable(exynos->axius_clk); - /* runtime set active to reflect active state. */ - pm_runtime_disable(dev); - pm_runtime_set_active(dev); - pm_runtime_enable(dev); - return 0; } From patchwork Tue Sep 18 08:16:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 10603841 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AB415188F for ; Tue, 18 Sep 2018 08:17:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9CFC82A4ED for ; Tue, 18 Sep 2018 08:17:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 90FB92A500; Tue, 18 Sep 2018 08:17:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 150082A4ED for ; Tue, 18 Sep 2018 08:17:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729156AbeIRNs6 (ORCPT ); Tue, 18 Sep 2018 09:48:58 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:36647 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729009AbeIRNsk (ORCPT ); Tue, 18 Sep 2018 09:48:40 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20180918081708euoutp029aeb895dbe99408a755896947c1466ef~VcJQELsVM2950829508euoutp02Q; Tue, 18 Sep 2018 08:17:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20180918081708euoutp029aeb895dbe99408a755896947c1466ef~VcJQELsVM2950829508euoutp02Q DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1537258628; bh=eoR6xCYPgnXFsAtjPHy54Ga2H2OkuXw5dnyP9JlKCFg=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=c+MuobOpcp9M4wnkLDQrJsRXaS2k0G9I2DY/84N4RoLAx/LlOgnwEoaoWTAZdIsuH aYBhHrJu587968KdRgJW6+FsyTMcT6nWAiEt8u2vWd0lzGITqtf6WHqeJozFTfOos/ XAEhbOQJhSEkDwjnRubIzuDjzN5OjqTTWC9Q+nMo= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180918081708eucas1p2ed1c0e53e42823746289f55cf9e073c0~VcJPgqYUM1987119871eucas1p22; Tue, 18 Sep 2018 08:17:08 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 34.4D.04294.384B0AB5; Tue, 18 Sep 2018 09:17:07 +0100 (BST) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180918081707eucas1p11cf21da4c14282d927c0c93652af4ce0~VcJOvmN8H2688326883eucas1p1P; Tue, 18 Sep 2018 08:17:07 +0000 (GMT) X-AuditID: cbfec7f4-c77a99c0000010c6-65-5ba0b483ba54 Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 0B.6E.04284.384B0AB5; Tue, 18 Sep 2018 09:17:07 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PF800C5KSCD4H70@eusync4.samsung.com>; Tue, 18 Sep 2018 09:17:07 +0100 (BST) From: Marek Szyprowski To: linux-usb@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Greg Kroah-Hartman , Felipe Balbi , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz Subject: [PATCH 2/4] usb: dwc3: exynos: Rework clock handling and prepare for new variants Date: Tue, 18 Sep 2018 10:16:51 +0200 Message-id: <20180918081653.314-3-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 In-reply-to: <20180918081653.314-1-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrOIsWRmVeSWpSXmKPExsWy7djP87rNWxZEG5xrt7TYOGM9q8Wxtifs Fs2L17NZnD+/gd1ixvl9TBaLlrUyW6w9cpfdgd1j06pONo/9c9ewe/RtWcXo8XmTXABLFJdN SmpOZllqkb5dAlfGqS2/GAv2GlUsbLrJ2MB4RbOLkZNDQsBEorF9I3MXIxeHkMAKRomZbe/Y IJzPjBI7f85ihamafmIvC0RiGaPEh9kLoaoamCR2tj1mBKliEzCU6HrbxQZiiwg4SCxZeges iFngCaPE7s1fwIqEBWIkOk5NZwGxWQRUJRqnvAOzeQWsJS5dvAG1Tl5i9YYDzCA2p4CNxM6N j8BWSwg0skms2PyECaLIReJl5zqoBmGJV8e3sEPYMhKdHQeZIBqaGSXaZ8xih3B6GCW2ztnB BlFlLXH4+EWwbmYBPolJ26YDreMAivNKdLQJQZR4SFy9tA/q6X5GiWNXjzNPYJRcwMiwilE8 tbQ4Nz212CgvtVyvODG3uDQvXS85P3cTIzD6Tv87/mUH464/SYcYBTgYlXh4FyyYHy3EmlhW XJl7iFGCg1lJhJczZ0G0EG9KYmVValF+fFFpTmrxIUZpDhYlcV4+rbRoIYH0xJLU7NTUgtQi mCwTB6dUA2PhbcN5a/NK1+r4PJjKq5QS9+UMy6QJ2+b+/zCpSfVfjvuvgP13xLbbrtzwWsVl URHP9lgbhxiT9wUXBXeK2zzcHx28aOWMx4ca6nViTzVGej8p6zup/ezKgc38Rz9eW5M5Z2aS hcYUI7Hn4cuCPty5W1Eac51nmWdAwMLLx95NVJrZrr7Pe2m4EktxRqKhFnNRcSIAX/2tdLoC AAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpkluLIzCtJLcpLzFFi42I5/e/4Nd3mLQuiDaZuELHYOGM9q8Wxtifs Fs2L17NZnD+/gd1ixvl9TBaLlrUyW6w9cpfdgd1j06pONo/9c9ewe/RtWcXo8XmTXABLFJdN SmpOZllqkb5dAlfGqS2/GAv2GlUsbLrJ2MB4RbOLkZNDQsBEYvqJvSxdjFwcQgJLGCW+z3/C BpIQEmhiknhyLxTEZhMwlOh62wUWFxFwkFiy9A4bSAOzwBNGiRtX5gM5HBzCAjESv74Ug9Sw CKhKNE55xwJi8wpYS1y6eIMVYpm8xOoNB5hBbE4BG4mdGx+xQOyylljWdpl1AiPPAkaGVYwi qaXFuem5xYZ6xYm5xaV56XrJ+bmbGIEBs+3Yz807GC9tDD7EKMDBqMTDu2DB/Ggh1sSy4src Q4wSHMxKIrycOQuihXhTEiurUovy44tKc1KLDzFKc7AoifOeN6iMEhJITyxJzU5NLUgtgsky cXBKNTBK1Heaznof3lvWqBS28IjD8vLd90VPsu78vP/3L1dBu8fzL/ectel9mt9wrt9XejXH 0WfzPordu/T8obqjXN9f7fKZxSVBVto3psq/XhlUE+DUl75btdhFQJLjsUN9psDM6UdUxA42 PDi8ueXx4doG76aPlf6/hb0cSvzSXj/81Kr/ROZI1SolluKMREMt5qLiRAA43NM7FAIAAA== X-CMS-MailID: 20180918081707eucas1p11cf21da4c14282d927c0c93652af4ce0 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180918081707eucas1p11cf21da4c14282d927c0c93652af4ce0 References: <20180918081653.314-1-m.szyprowski@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add per-variant list of clocks and manage them all together in the single array. This is a preparation for adding new variants of Exynos SoCs. No functional changes for existing Exynos SoCs. Signed-off-by: Marek Szyprowski --- drivers/usb/dwc3/dwc3-exynos.c | 128 ++++++++++++++++++++------------- 1 file changed, 80 insertions(+), 48 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c index 0a946c66c3bb..3f434a53be8e 100644 --- a/drivers/usb/dwc3/dwc3-exynos.c +++ b/drivers/usb/dwc3/dwc3-exynos.c @@ -17,12 +17,21 @@ #include #include +#define DWC3_EXYNOS_MAX_CLOCKS 4 + +struct dwc3_exynos_driverdata { + const char *clk_names[DWC3_EXYNOS_MAX_CLOCKS]; + int num_clks; + int suspend_clk_idx; +}; + struct dwc3_exynos { struct device *dev; - struct clk *clk; - struct clk *susp_clk; - struct clk *axius_clk; + const char **clk_names; + struct clk *clks[DWC3_EXYNOS_MAX_CLOCKS]; + int num_clks; + int suspend_clk_idx; struct regulator *vdd33; struct regulator *vdd10; @@ -42,47 +51,42 @@ static int dwc3_exynos_probe(struct platform_device *pdev) struct dwc3_exynos *exynos; struct device *dev = &pdev->dev; struct device_node *node = dev->of_node; - - int ret; + const struct dwc3_exynos_driverdata *driver_data; + int i, ret; exynos = devm_kzalloc(dev, sizeof(*exynos), GFP_KERNEL); if (!exynos) return -ENOMEM; - platform_set_drvdata(pdev, exynos); + driver_data = of_device_get_match_data(dev); + exynos->dev = dev; + exynos->num_clks = driver_data->num_clks; + exynos->clk_names = (const char **)driver_data->clk_names; + exynos->suspend_clk_idx = driver_data->suspend_clk_idx; - exynos->dev = dev; + platform_set_drvdata(pdev, exynos); - exynos->clk = devm_clk_get(dev, "usbdrd30"); - if (IS_ERR(exynos->clk)) { - dev_err(dev, "couldn't get clock\n"); - return -EINVAL; + for (i = 0; i < exynos->num_clks; i++) { + exynos->clks[i] = devm_clk_get(dev, exynos->clk_names[i]); + if (IS_ERR(exynos->clks[i])) { + dev_err(dev, "failed to get clock: %s\n", + exynos->clk_names[i]); + return PTR_ERR(exynos->clks[i]); + } } - ret = clk_prepare_enable(exynos->clk); - if (ret) - return ret; - exynos->susp_clk = devm_clk_get(dev, "usbdrd30_susp_clk"); - if (IS_ERR(exynos->susp_clk)) - exynos->susp_clk = NULL; - ret = clk_prepare_enable(exynos->susp_clk); - if (ret) - goto susp_clk_err; - - if (of_device_is_compatible(node, "samsung,exynos7-dwusb3")) { - exynos->axius_clk = devm_clk_get(dev, "usbdrd30_axius_clk"); - if (IS_ERR(exynos->axius_clk)) { - dev_err(dev, "no AXI UpScaler clk specified\n"); - ret = -ENODEV; - goto axius_clk_err; + for (i = 0; i < exynos->num_clks; i++) { + ret = clk_prepare_enable(exynos->clks[i]); + if (ret) { + while (--i > 0) + clk_disable_unprepare(exynos->clks[i]); + return ret; } - ret = clk_prepare_enable(exynos->axius_clk); - if (ret) - goto axius_clk_err; - } else { - exynos->axius_clk = NULL; } + if (exynos->suspend_clk_idx >= 0) + clk_prepare_enable(exynos->clks[exynos->suspend_clk_idx]); + exynos->vdd33 = devm_regulator_get(dev, "vdd33"); if (IS_ERR(exynos->vdd33)) { ret = PTR_ERR(exynos->vdd33); @@ -124,23 +128,27 @@ static int dwc3_exynos_probe(struct platform_device *pdev) vdd10_err: regulator_disable(exynos->vdd33); vdd33_err: - clk_disable_unprepare(exynos->axius_clk); -axius_clk_err: - clk_disable_unprepare(exynos->susp_clk); -susp_clk_err: - clk_disable_unprepare(exynos->clk); + for (i = exynos->num_clks - 1; i >= 0; i--) + clk_disable_unprepare(exynos->clks[i]); + + if (exynos->suspend_clk_idx >= 0) + clk_disable_unprepare(exynos->clks[exynos->suspend_clk_idx]); + return ret; } static int dwc3_exynos_remove(struct platform_device *pdev) { struct dwc3_exynos *exynos = platform_get_drvdata(pdev); + int i; device_for_each_child(&pdev->dev, NULL, dwc3_exynos_remove_child); - clk_disable_unprepare(exynos->axius_clk); - clk_disable_unprepare(exynos->susp_clk); - clk_disable_unprepare(exynos->clk); + for (i = exynos->num_clks - 1; i >= 0; i--) + clk_disable_unprepare(exynos->clks[i]); + + if (exynos->suspend_clk_idx >= 0) + clk_disable_unprepare(exynos->clks[exynos->suspend_clk_idx]); regulator_disable(exynos->vdd33); regulator_disable(exynos->vdd10); @@ -148,10 +156,27 @@ static int dwc3_exynos_remove(struct platform_device *pdev) return 0; } +static const struct dwc3_exynos_driverdata exynos5250_drvdata = { + .clk_names = { "usbdrd30" }, + .num_clks = 1, + .suspend_clk_idx = -1, +}; + +static const struct dwc3_exynos_driverdata exynos7_drvdata = { + .clk_names = { "usbdrd30", "usbdrd30_susp_clk", "usbdrd30_axius_clk" }, + .num_clks = 3, + .suspend_clk_idx = 1, +}; + static const struct of_device_id exynos_dwc3_match[] = { - { .compatible = "samsung,exynos5250-dwusb3" }, - { .compatible = "samsung,exynos7-dwusb3" }, - {}, + { + .compatible = "samsung,exynos5250-dwusb3", + .data = &exynos5250_drvdata, + }, { + .compatible = "samsung,exynos7-dwusb3", + .data = &exynos7_drvdata, + }, { + } }; MODULE_DEVICE_TABLE(of, exynos_dwc3_match); @@ -159,9 +184,10 @@ MODULE_DEVICE_TABLE(of, exynos_dwc3_match); static int dwc3_exynos_suspend(struct device *dev) { struct dwc3_exynos *exynos = dev_get_drvdata(dev); + int i; - clk_disable(exynos->axius_clk); - clk_disable(exynos->clk); + for (i = exynos->num_clks - 1; i >= 0; i--) + clk_disable_unprepare(exynos->clks[i]); regulator_disable(exynos->vdd33); regulator_disable(exynos->vdd10); @@ -172,7 +198,7 @@ static int dwc3_exynos_suspend(struct device *dev) static int dwc3_exynos_resume(struct device *dev) { struct dwc3_exynos *exynos = dev_get_drvdata(dev); - int ret; + int i, ret; ret = regulator_enable(exynos->vdd33); if (ret) { @@ -185,8 +211,14 @@ static int dwc3_exynos_resume(struct device *dev) return ret; } - clk_enable(exynos->clk); - clk_enable(exynos->axius_clk); + for (i = 0; i < exynos->num_clks; i++) { + ret = clk_prepare_enable(exynos->clks[i]); + if (ret) { + while (--i > 0) + clk_disable_unprepare(exynos->clks[i]); + return ret; + } + } return 0; } From patchwork Tue Sep 18 08:16:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 10603829 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6DB7D161F for ; Tue, 18 Sep 2018 08:17:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5D55B2A4D9 for ; Tue, 18 Sep 2018 08:17:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 516CA2A500; Tue, 18 Sep 2018 08:17:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B29462A4FF for ; Tue, 18 Sep 2018 08:17:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729112AbeIRNs6 (ORCPT ); Tue, 18 Sep 2018 09:48:58 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:34075 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728681AbeIRNsk (ORCPT ); Tue, 18 Sep 2018 09:48:40 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20180918081709euoutp0129a2e1a9cc8f9f2073a6911897fa3306~VcJQa4Lr40716807168euoutp01i; Tue, 18 Sep 2018 08:17:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180918081709euoutp0129a2e1a9cc8f9f2073a6911897fa3306~VcJQa4Lr40716807168euoutp01i DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1537258629; bh=7rbPwsHgEgD8pVuma5f3A3rp0o+0GQ10xg81X6QAsZc=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=U+qohUCrlqJLhe2vPLb3Q79fmPXOzfYwoHPb9qe6Aj7be1eTq3aFg4VlyoIAy6XrL 3OxCuDYSEpq3TB+51VS8rbo8lVQw1DrjwFpFrvTkTU2fP/eg5ZOSIHl1t/cCxQuDJN pxYttmaOl0j9HedBEOVnkipEjG6qc9x2uFLEqn7A= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180918081708eucas1p266a1651c125598dec6b31f9c80f6f35e~VcJP6HLO10417104171eucas1p2O; Tue, 18 Sep 2018 08:17:08 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id C4.4D.04294.484B0AB5; Tue, 18 Sep 2018 09:17:08 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180918081707eucas1p1723fe82ab62b7d321f0e49bad8e3edf1~VcJPCsmWN1590615906eucas1p1-; Tue, 18 Sep 2018 08:17:07 +0000 (GMT) X-AuditID: cbfec7f4-c77a99c0000010c6-66-5ba0b484eeb0 Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 0A.6B.04128.384B0AB5; Tue, 18 Sep 2018 09:17:07 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PF800C5KSCD4H70@eusync4.samsung.com>; Tue, 18 Sep 2018 09:17:07 +0100 (BST) From: Marek Szyprowski To: linux-usb@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Greg Kroah-Hartman , Felipe Balbi , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz Subject: [PATCH 3/4] usb: dwc3: exynos: Add support for Exynos5433 variant with all clocks Date: Tue, 18 Sep 2018 10:16:52 +0200 Message-id: <20180918081653.314-4-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 In-reply-to: <20180918081653.314-1-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrGIsWRmVeSWpSXmKPExsWy7djP87otWxZEG2y5JmyxccZ6VotjbU/Y LZoXr2ezOH9+A7vFjPP7mCwWLWtltlh75C67A7vHplWdbB77565h9+jbsorR4/MmuQCWKC6b lNSczLLUIn27BK6Mn813WAuWSVRsO/CJuYFxikgXIyeHhICJxNmWn4xdjFwcQgIrGCVm/z7P CuF8ZpTo7LvPBlN1Z91BZojEMkaJ3fdOskM4DUwSO9seM4JUsQkYSnS97QLrEBFwkFiy9A4b SBGzwBOgjs1fwIqEBWIk7h/uZQexWQRUJf7MvwsU5+DgFbCWmLjLGGKbvMTqDQeYQWxOARuJ nRsfsYDMkRD4yyrxZt8uRogiF4lzxx+yQ9jCEq+Ob4GyZSQuT+6GamhmlGifMYsdwulhlNg6 ZwfUQ9YSh49fZAWxmQX4JCZtm84McoWEAK9ER5sQRImHxL1HB6De7GeU+N2zn3ECo+QCRoZV jOKppcW56anFRnmp5XrFibnFpXnpesn5uZsYgbF3+t/xLzsYd/1JOsQowMGoxMO7YMH8aCHW xLLiytxDjBIczEoivJw5C6KFeFMSK6tSi/Lji0pzUosPMUpzsCiJ8/JppUULCaQnlqRmp6YW pBbBZJk4OKUaGFN902qWrc5xrHtbtLZJPWiyxeIbKx31g73ZLfYaTWK5tXvdLvOPh4prf5ZZ LXpZcNQ3kKN+gdaG+tqzgsIJm2eUexwy2Xd4/cTzm1fUfU8rsC3n05lTzrCA13T7M75CrhWC AYklbvx3J9lP3yTZdH7hgcqbipzfM5UyZu40PyZ4ULEoJ/mQhxJLcUaioRZzUXEiAFdjM8O5 AgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpkluLIzCtJLcpLzFFi42I5/e/4Nd3mLQuiDbZM1bHYOGM9q8Wxtifs Fs2L17NZnD+/gd1ixvl9TBaLlrUyW6w9cpfdgd1j06pONo/9c9ewe/RtWcXo8XmTXABLFJdN SmpOZllqkb5dAlfGz+Y7rAXLJCq2HfjE3MA4RaSLkZNDQsBE4s66g8xdjFwcQgJLGCV6f85i BEkICTQxSTy5FwpiswkYSnS97WIDsUUEHCSWLL3DBtLALPCEUeLGlflgCWGBGIl1HQtYQGwW AVWJP/PvAg3i4OAVsJaYuMsYYpm8xOoNB5hBbE4BG4mdGx+xQOyylljWdpl1AiPPAkaGVYwi qaXFuem5xUZ6xYm5xaV56XrJ+bmbGIEBs+3Yzy07GLveBR9iFOBgVOLh/bFofrQQa2JZcWXu IUYJDmYlEV7OnAXRQrwpiZVVqUX58UWlOanFhxilOViUxHnPG1RGCQmkJ5akZqemFqQWwWSZ ODilgCGStU+B0+DZq2eM1869WvFg/rukllu2z7L8+vKPfdDd0xin/lLF8ZqNV7oUn7XR23aZ KUKf6xtmSblGeNc47i38+mj7j8wGfzkTPnmNBafYHrlrn3op+PAo5w7Ga9H2K7a3CobHaIp2 VyatZw3hcC58ErXMc9XZrdXr3m3ht5mTNHUq66HAciWW4oxEQy3mouJEACMGhnUUAgAA X-CMS-MailID: 20180918081707eucas1p1723fe82ab62b7d321f0e49bad8e3edf1 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180918081707eucas1p1723fe82ab62b7d321f0e49bad8e3edf1 References: <20180918081653.314-1-m.szyprowski@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP DWC3 variant found in Exynos5433 SoCs requires keeping all DRD30/UHOST30 clocks enabled all the time the driver does any access to DWC3 registers, otherwise external abort happens. So far DWC3 hardware module worked with samsung,exynos5250-dwusb3 compatible only by luck when built into kernel: all DRD30 clocks were left enabled by bootloader and later kept enabled by the DRD PHY driver. However, if one tried to use Exnos DWC3 driver as a module or performed system suspend/resume cycle, external abort happened. This patch finally fixes this issue. Signed-off-by: Marek Szyprowski --- Documentation/devicetree/bindings/usb/dwc3.txt | 1 + Documentation/devicetree/bindings/usb/exynos-usb.txt | 2 ++ drivers/usb/dwc3/dwc3-exynos.c | 9 +++++++++ 3 files changed, 12 insertions(+) diff --git a/Documentation/devicetree/bindings/usb/dwc3.txt b/Documentation/devicetree/bindings/usb/dwc3.txt index 3e4c38b806ac..636630fb92d7 100644 --- a/Documentation/devicetree/bindings/usb/dwc3.txt +++ b/Documentation/devicetree/bindings/usb/dwc3.txt @@ -19,6 +19,7 @@ Exception for clocks: "cavium,octeon-7130-usb-uctl" "qcom,dwc3" "samsung,exynos5250-dwusb3" + "samsung,exynos5433-dwusb3" "samsung,exynos7-dwusb3" "sprd,sc9860-dwc3" "st,stih407-dwc3" diff --git a/Documentation/devicetree/bindings/usb/exynos-usb.txt b/Documentation/devicetree/bindings/usb/exynos-usb.txt index c97374315049..b7111f43fa59 100644 --- a/Documentation/devicetree/bindings/usb/exynos-usb.txt +++ b/Documentation/devicetree/bindings/usb/exynos-usb.txt @@ -83,6 +83,8 @@ Required properties: - compatible: should be one of the following - "samsung,exynos5250-dwusb3": for USB 3.0 DWC3 controller on Exynos5250/5420. + "samsung,exynos5433-dwusb3": for USB 3.0 DWC3 controller on + Exynos5433. "samsung,exynos7-dwusb3": for USB 3.0 DWC3 controller on Exynos7. - #address-cells, #size-cells : should be '1' if the device has sub-nodes with 'reg' property. diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c index 3f434a53be8e..cb7fcd7c0ad8 100644 --- a/drivers/usb/dwc3/dwc3-exynos.c +++ b/drivers/usb/dwc3/dwc3-exynos.c @@ -162,6 +162,12 @@ static const struct dwc3_exynos_driverdata exynos5250_drvdata = { .suspend_clk_idx = -1, }; +static const struct dwc3_exynos_driverdata exynos5433_drvdata = { + .clk_names = { "aclk", "susp_clk", "pipe_pclk", "phyclk" }, + .num_clks = 4, + .suspend_clk_idx = 1, +}; + static const struct dwc3_exynos_driverdata exynos7_drvdata = { .clk_names = { "usbdrd30", "usbdrd30_susp_clk", "usbdrd30_axius_clk" }, .num_clks = 3, @@ -172,6 +178,9 @@ static const struct of_device_id exynos_dwc3_match[] = { { .compatible = "samsung,exynos5250-dwusb3", .data = &exynos5250_drvdata, + }, { + .compatible = "samsung,exynos5433-dwusb3", + .data = &exynos5433_drvdata, }, { .compatible = "samsung,exynos7-dwusb3", .data = &exynos7_drvdata, From patchwork Tue Sep 18 08:16:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 10603827 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 298E75A4 for ; Tue, 18 Sep 2018 08:17:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 108212A4D9 for ; Tue, 18 Sep 2018 08:17:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 043302A51E; Tue, 18 Sep 2018 08:17:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 495E52A4D9 for ; Tue, 18 Sep 2018 08:17:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726433AbeIRNs6 (ORCPT ); Tue, 18 Sep 2018 09:48:58 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:36656 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729017AbeIRNsk (ORCPT ); Tue, 18 Sep 2018 09:48:40 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20180918081709euoutp02a5933f558acf8ae42853e18ecd1073ba~VcJQ6Q1nF2950829508euoutp02S; Tue, 18 Sep 2018 08:17:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20180918081709euoutp02a5933f558acf8ae42853e18ecd1073ba~VcJQ6Q1nF2950829508euoutp02S DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1537258629; bh=m1GmPXjDNa4wsn2Zi0+wdX4bH6RuXMckvcmNXgYaZq4=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=dPZBFz0MKN57hi3rBR0WmH08g4PonFFGctWYGrVzY0rohwfHxwATOMmHmfTtktMjE GlddzJULSpjj+RQznTACPuhYYW2xGdl/dRYMObGBV9hMqY7kB1nLoS/Kh8VuWcsVcx FjJffzN24UV1CRVqTRcZlnAM1FRFT+BXV5t0kJt8= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180918081709eucas1p18c6c7b34863d6057b59eb8e0b7b0e0a8~VcJQRqGkc2691226912eucas1p1Q; Tue, 18 Sep 2018 08:17:09 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id A8.B4.04441.484B0AB5; Tue, 18 Sep 2018 09:17:08 +0100 (BST) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180918081708eucas1p174dfe9569034de05f04b6045cc906ab3~VcJPaWi9x1321813218eucas1p1C; Tue, 18 Sep 2018 08:17:08 +0000 (GMT) X-AuditID: cbfec7f2-5c9ff70000001159-4f-5ba0b4849c36 Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id ED.6E.04284.484B0AB5; Tue, 18 Sep 2018 09:17:08 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PF800C5KSCD4H70@eusync4.samsung.com>; Tue, 18 Sep 2018 09:17:08 +0100 (BST) From: Marek Szyprowski To: linux-usb@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Greg Kroah-Hartman , Felipe Balbi , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz Subject: [PATCH 4/4] arm64: dts: exynos: Update DWC3 modules on Exynos5433 SoCs Date: Tue, 18 Sep 2018 10:16:53 +0200 Message-id: <20180918081653.314-5-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 In-reply-to: <20180918081653.314-1-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrCIsWRmVeSWpSXmKPExsWy7djPc7otWxZEG7Qu1LXYOGM9q8Wxtifs Fs2L17NZnD+/gd1ixvl9TBaLlrUyW6w9cpfdgd1j06pONo/9c9ewe/RtWcXo8XmTXABLFJdN SmpOZllqkb5dAlfGjJaCgt/CFe9u/mRtYJwu0MXIySEhYCLx/O1n1i5GLg4hgRWMEr/6VjND OJ8ZJX4sus0IU7V+0hUwW0hgGaPEsj+1EEUNTBJPW5tYQBJsAoYSXW+72EBsEQEHiSVL77CB FDELPGGU2L35C1i3sECgxIG1M8CKWARUJd79uAC0m4ODV8BaYtchbYhl8hKrNxxgBrE5BWwk dm58xAIyR0LgL6vE2plTmSCKXCTOf3rNDGELS7w6voUdwpaR6Ow4yATR0Mwo0T5jFjuE08Mo sXXODjaIKmuJw8cvsoLYzAJ8EpO2TWcGuUJCgFeio00IosRD4v3Fm9CA6WeUWLpnFcsERskF jAyrGMVTS4tz01OLDfNSy/WKE3OLS/PS9ZLzczcxAuPu9L/jn3Ywfr2UdIhRgINRiYd3wYL5 0UKsiWXFlbmHGCU4mJVEeDlzFkQL8aYkVlalFuXHF5XmpBYfYpTmYFES5+XTSosWEkhPLEnN Tk0tSC2CyTJxcEo1MOYsvra8IVudWdZBVyt76+pb5pcPxf8QPr83YWm6UVnhQ31v+XQrvUjH vAkdMT+Uq98+E/6ia86l0hA4q96svr5q3vEJcmlWf265l26fYBE75TNT95yvRzfnzYuprCnI mX9Y2MesTeK4HvsvlplZDJsyUhQUv/1pFzJ3zhVTPvjtZqBqhvAVJZbijERDLeai4kQAqTYr yLcCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpgluLIzCtJLcpLzFFi42I5/e/4Nd2WLQuiDX51s1psnLGe1eJY2xN2 i+bF69kszp/fwG4x4/w+JotFy1qZLdYeucvuwO6xaVUnm8f+uWvYPfq2rGL0+LxJLoAlissm JTUnsyy1SN8ugStjRktBwW/hinc3f7I2ME4X6GLk5JAQMJFYP+kKYxcjF4eQwBJGiZsT21hA EkICTUwSJ3dbgNhsAoYSXW+72EBsEQEHiSVL77CBNDALPGGUuHFlPlhCWMBf4mVDOxOIzSKg KvHuxwXWLkYODl4Ba4ldh7QhlslLrN5wgBnE5hSwkdi58RHULmuJZW2XWScw8ixgZFjFKJJa WpybnltsqFecmFtcmpeul5yfu4kRGC7bjv3cvIPx0sbgQ4wCHIxKPLwLFsyPFmJNLCuuzD3E KMHBrCTCy5mzIFqINyWxsiq1KD++qDQntfgQozQHi5I473mDyighgfTEktTs1NSC1CKYLBMH p1QDo8DmL7lGN60tt7o+mdyqem6m/cY5z669eOzzf2e1yO18w23Xu+2bmET+beqbkMos3hPA qy+4rcTaa+vUqe+Whs0OYljhn7nzgr4rc5n+Ka9+Jt/lrlmMWkmefD926nzYlxFc7LHxq/jj t0nP/8yx2PjXOk7xkMW5w9Ou/rM5O6P0m/1RtyWLuJVYijMSDbWYi4oTAfjYr9cTAgAA X-CMS-MailID: 20180918081708eucas1p174dfe9569034de05f04b6045cc906ab3 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180918081708eucas1p174dfe9569034de05f04b6045cc906ab3 References: <20180918081653.314-1-m.szyprowski@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Update DWC3 hardware modules to Exynos5433 specific variant: change compatible name and add all required clocks (both to the glue node and DWC3 core node). Signed-off-by: Marek Szyprowski --- arch/arm64/boot/dts/exynos/exynos5433.dtsi | 24 ++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/arch/arm64/boot/dts/exynos/exynos5433.dtsi b/arch/arm64/boot/dts/exynos/exynos5433.dtsi index 162653b538bc..77297d66642c 100644 --- a/arch/arm64/boot/dts/exynos/exynos5433.dtsi +++ b/arch/arm64/boot/dts/exynos/exynos5433.dtsi @@ -1608,10 +1608,12 @@ }; usbdrd30: usbdrd { - compatible = "samsung,exynos5250-dwusb3"; + compatible = "samsung,exynos5433-dwusb3"; clocks = <&cmu_fsys CLK_ACLK_USBDRD30>, - <&cmu_fsys CLK_SCLK_USBDRD30>; - clock-names = "usbdrd30", "usbdrd30_susp_clk"; + <&cmu_fsys CLK_SCLK_USBDRD30>, + <&cmu_fsys CLK_PHYCLK_USBDRD30_UDRD30_PHYCLOCK>, + <&cmu_fsys CLK_PHYCLK_USBDRD30_UDRD30_PIPE_PCLK>; + clock-names = "aclk", "susp_clk", "phyclk", "pipe_pclk"; #address-cells = <1>; #size-cells = <1>; ranges; @@ -1619,6 +1621,10 @@ usbdrd_dwc3: dwc3@15400000 { compatible = "snps,dwc3"; + clocks = <&cmu_fsys CLK_SCLK_USBDRD30>, + <&cmu_fsys CLK_ACLK_USBDRD30>, + <&cmu_fsys CLK_SCLK_USBDRD30>; + clock-names = "ref", "bus_early", "suspend"; reg = <0x15400000 0x10000>; interrupts = ; phys = <&usbdrd30_phy 0>, <&usbdrd30_phy 1>; @@ -1655,10 +1661,12 @@ }; usbhost30: usbhost { - compatible = "samsung,exynos5250-dwusb3"; + compatible = "samsung,exynos5433-dwusb3"; clocks = <&cmu_fsys CLK_ACLK_USBHOST30>, - <&cmu_fsys CLK_SCLK_USBHOST30>; - clock-names = "usbdrd30", "usbdrd30_susp_clk"; + <&cmu_fsys CLK_SCLK_USBHOST30>, + <&cmu_fsys CLK_PHYCLK_USBHOST30_UHOST30_PHYCLOCK>, + <&cmu_fsys CLK_PHYCLK_USBHOST30_UHOST30_PIPE_PCLK>; + clock-names = "aclk", "susp_clk", "phyclk", "pipe_pclk"; #address-cells = <1>; #size-cells = <1>; ranges; @@ -1666,6 +1674,10 @@ usbhost_dwc3: dwc3@15a00000 { compatible = "snps,dwc3"; + clocks = <&cmu_fsys CLK_SCLK_USBHOST30>, + <&cmu_fsys CLK_ACLK_USBHOST30>, + <&cmu_fsys CLK_SCLK_USBHOST30>; + clock-names = "ref", "bus_early", "suspend"; reg = <0x15a00000 0x10000>; interrupts = ; phys = <&usbhost30_phy 0>, <&usbhost30_phy 1>;