From patchwork Mon Sep 10 09:52:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Shimoda X-Patchwork-Id: 10593857 X-Patchwork-Delegate: geert@linux-m68k.org 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 E57E71515 for ; Mon, 10 Sep 2018 09:54:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D63F028E24 for ; Mon, 10 Sep 2018 09:54:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C8B9128E2A; Mon, 10 Sep 2018 09:54:16 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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 A475928E24 for ; Mon, 10 Sep 2018 09:54:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728086AbeIJOr2 (ORCPT ); Mon, 10 Sep 2018 10:47:28 -0400 Received: from relmlor3.renesas.com ([210.160.252.173]:63252 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727353AbeIJOr2 (ORCPT ); Mon, 10 Sep 2018 10:47:28 -0400 Received: from unknown (HELO relmlir2.idc.renesas.com) ([10.200.68.152]) by relmlie2.idc.renesas.com with ESMTP; 10 Sep 2018 18:54:12 +0900 Received: from relmlii2.idc.renesas.com (relmlii2.idc.renesas.com [10.200.68.66]) by relmlir2.idc.renesas.com (Postfix) with ESMTP id DEC107DA78; Mon, 10 Sep 2018 18:54:12 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.53,355,1531753200"; d="scan'208";a="292071058" Received: from mail-hk2apc01lp0211.outbound.protection.outlook.com (HELO APC01-HK2-obe.outbound.protection.outlook.com) ([65.55.88.211]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA256; 10 Sep 2018 18:54:11 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesas-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0rLM+bfQJNAFwvvpowk9opqtB2Fdj4+8aKFZdkUGR2M=; b=l2axIUT4Vjl7aZnoYf72trPvYluTegmitM5N+vhBdpXPk3PihmbqoKiHCMT7y4rryQU7w6uI7uo2hNaHrB9y/m5OQ3GDht2UvgPWWcTKBgV7TB5wKta+qDP4kPUKIOY/9hr/j1kIDA4Mn9GAfl0wOFeKlyF5Hm/vVSS0FPl2fW4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=<>; Received: from localhost.localdomain (211.11.155.144) by TY2PR01MB2298.jpnprd01.prod.outlook.com (2603:1096:404:10::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.18; Mon, 10 Sep 2018 09:54:08 +0000 From: Yoshihiro Shimoda To: balbi@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com Cc: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, Yoshihiro Shimoda Subject: [PATCH v4 1/3] usb: renesas_usbhs: Add reset_control Date: Mon, 10 Sep 2018 18:52:18 +0900 Message-Id: <1536573140-24123-2-git-send-email-yoshihiro.shimoda.uh@renesas.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1536573140-24123-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> References: <1536573140-24123-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> MIME-Version: 1.0 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: TYAPR01CA0147.jpnprd01.prod.outlook.com (2603:1096:404:7e::15) To TY2PR01MB2298.jpnprd01.prod.outlook.com (2603:1096:404:10::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b99d388d-fb51-44ac-6ebd-08d6170359fa X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(8559020)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:TY2PR01MB2298; X-Microsoft-Exchange-Diagnostics: 1;TY2PR01MB2298;3:xWm5c9pkk9YRMHh6ndnYmqiQdpn4y2YIFAi1uaYcV3nyCKodnXNsG5Ihg+wOZ6NU75XzrMUGrhLAruYkiG4aUl3yXxUJH1mPIx4wCpn2S2RXx/iNpRunJ77MmnW1ATvLmYGupW8crmO5unzf7AkA7fEGnVwqgSpWyNazl1hcgWqa6QZsuaNT3tp7AaRgS5NyTh2NHcEkO8b+n4D5IYW1OB/NOFhioUJs8B+2MM93AvKmd27YAV7HlyClvsr0vYJO;25:x14x4HMVFm3Nn/syj4vsF1FXiqKXjOGtEpgiTgSsrP7DHw6LrHU6A/eS/aqOLwjGgwgdVtOJPQMl8K7fPuEwzqE6K4Q4MwV4pa3vyxg6ZEGb0NwAnTAQTfICQxZlQuq+BgRPENs4T0lEOeUhprLtIxMank0n5ZLXsb0wY+iXf6FTzbu+knUxpT6kqWgdL2Jr/TBqfXoevi7P2VmpNyDexNWP9ZXCMzoChi3oZ2h1BV/GVGemADDUm7sgb9M7Vs+JVxEE0XZY3/cb1Kd1+HBRppKgs+jFz8Qn0amFPoLnsW/82jZy8VQfV3MVHsSiWp69ITrEHmd+rRyzWexWA3x9Pg==;31:H2JQA1r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4Sb/UJ0ECCiKSW/A== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(823301075)(3002001)(93006095)(3231311)(944501410)(52105095)(10201501046)(6055026)(149027)(150027)(6041310)(20161123562045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061750153)(20161123564045)(201708071742011)(7699050);SRVR:TY2PR01MB2298;BCL:0;PCL:0;RULEID:;SRVR:TY2PR01MB2298; X-Forefront-PRVS: 07915F544A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6069001)(136003)(366004)(396003)(39860400002)(376002)(346002)(199004)(189003)(2906002)(498600001)(6506007)(3846002)(7736002)(305945005)(53936002)(386003)(5660300001)(97736004)(81166006)(76176011)(81156014)(52116002)(6512007)(78352004)(16526019)(51416003)(6116002)(486006)(476003)(42882007)(446003)(26005)(69590400006)(956004)(11346002)(2616005)(107886003)(16586007)(8676002)(8936002)(105586002)(6486002)(4326008)(316002)(6666003)(36756003)(68736007)(66066001)(47776003)(106356001)(48376002)(50226002)(25786009)(50466002)(3720700003);DIR:OUT;SFP:1102;SCL:1;SRVR:TY2PR01MB2298;H:localhost.localdomain;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:0;MX:0; Received-SPF: None (protection.outlook.com: localhost.localdomain does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: 1;TY2PR01MB2298;23:1/sAJ61k2nnAMUOhR02ho8Dd7k4cORbsQnxXUrFk90eq0iG+fe2PY3zWKv7IqWy++OYMmyi4lYnIXDFM113Y26FVJZgDOaaXzGXu6eQuOrsOjrY3YlNFXFg6hGgs67WJOXATNOD5okuzjDGg3H63hH2zda+9BTJ3T+hS6uqskVAUwWQDIZAHX4biCmjup8mivpwBIO04NJMH91js/g5uJVjuwUUet6DnChl2TJ2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BdikY+vx3AZf5HEtvcp08+K3W4/fKqD/VWP6iuhQwxAMcY+vOpns2/IbnXsAaMauzbI+chMkAUqXuImYVCJY7vdh18ketfXlcmgPD1qKrlGB2A4LSafy4Ul8GNdehfAstAUYvgY7qoYGz4T01ju0iNBb31wp+I+MxK2qpnmS9Vkc/P5Kel/ran7uHhHCh9zGg1rhtl+FpePetaUB/0Ufumvb6 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;TY2PR01MB2298;20:FfI/KF/b4mhrOKXz6h+Uv8LEOKOqm1SAPnJ4kcy+mz3kfZETnBYDDFKfhdqthYMQRgwiLR8AjqKgv+4AuGTuHNLB/9Abg0jUf/Oz5c5PpBZJqhe4HlJJPBeSbRTS3k9E8bfv4NYcmgdunGRZkkqXTmkayYJHDpdmym/J4HS01Jc= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2018 09:54:08.0618 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b99d388d-fb51-44ac-6ebd-08d6170359fa X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY2PR01MB2298 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP R-Car Gen3 needs to deassert resets of both host and peripheral. Since [eo]hci-platform is possible to assert the reset(s) when the probing failed, renesas_usbhs driver doesn't work correctly regardless of finished probing. To fix this issue, this patch adds reset_control on this renesas_usbhs driver. Signed-off-by: Yoshihiro Shimoda --- drivers/usb/renesas_usbhs/common.c | 12 ++++++++++++ drivers/usb/renesas_usbhs/common.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c index 4310df4..1d355d5 100644 --- a/drivers/usb/renesas_usbhs/common.c +++ b/drivers/usb/renesas_usbhs/common.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include "common.h" @@ -574,6 +575,10 @@ static int usbhs_probe(struct platform_device *pdev) return PTR_ERR(priv->edev); } + priv->rsts = devm_reset_control_array_get_optional_shared(&pdev->dev); + if (IS_ERR(priv->rsts)) + return PTR_ERR(priv->rsts); + /* * care platform info */ @@ -658,6 +663,10 @@ static int usbhs_probe(struct platform_device *pdev) /* dev_set_drvdata should be called after usbhs_mod_init */ platform_set_drvdata(pdev, priv); + ret = reset_control_deassert(priv->rsts); + if (ret) + goto probe_fail_rst; + /* * deviece reset here because * USB device might be used in boot loader. @@ -711,6 +720,8 @@ static int usbhs_probe(struct platform_device *pdev) return ret; probe_end_mod_exit: + reset_control_assert(priv->rsts); +probe_fail_rst: usbhs_mod_remove(priv); probe_end_fifo_exit: usbhs_fifo_remove(priv); @@ -739,6 +750,7 @@ static int usbhs_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); usbhs_platform_call(priv, hardware_exit, pdev); + reset_control_assert(priv->rsts); usbhs_mod_remove(priv); usbhs_fifo_remove(priv); usbhs_pipe_remove(priv); diff --git a/drivers/usb/renesas_usbhs/common.h b/drivers/usb/renesas_usbhs/common.h index 6137f79..bce7d35 100644 --- a/drivers/usb/renesas_usbhs/common.h +++ b/drivers/usb/renesas_usbhs/common.h @@ -10,6 +10,7 @@ #include #include +#include #include struct usbhs_priv; @@ -277,6 +278,7 @@ struct usbhs_priv { struct usbhs_fifo_info fifo_info; struct phy *phy; + struct reset_control *rsts; }; /* From patchwork Mon Sep 10 09:52:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Shimoda X-Patchwork-Id: 10593861 X-Patchwork-Delegate: geert@linux-m68k.org 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 91C7A14E5 for ; Mon, 10 Sep 2018 09:54:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 82A6F28CB7 for ; Mon, 10 Sep 2018 09:54:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 76B8828E2A; Mon, 10 Sep 2018 09:54:17 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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 0187728CB7 for ; Mon, 10 Sep 2018 09:54:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728122AbeIJOra (ORCPT ); Mon, 10 Sep 2018 10:47:30 -0400 Received: from relmlor3.renesas.com ([210.160.252.173]:4933 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727799AbeIJOr3 (ORCPT ); Mon, 10 Sep 2018 10:47:29 -0400 Received: from unknown (HELO relmlir2.idc.renesas.com) ([10.200.68.152]) by relmlie2.idc.renesas.com with ESMTP; 10 Sep 2018 18:54:13 +0900 Received: from relmlii2.idc.renesas.com (relmlii2.idc.renesas.com [10.200.68.66]) by relmlir2.idc.renesas.com (Postfix) with ESMTP id EB1227DA7A; Mon, 10 Sep 2018 18:54:13 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.53,355,1531753200"; d="scan'208";a="292071060" Received: from mail-hk2apc01lp0211.outbound.protection.outlook.com (HELO APC01-HK2-obe.outbound.protection.outlook.com) ([65.55.88.211]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA256; 10 Sep 2018 18:54:12 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesas-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qt9sLhZEgPWUx+D0LDQvXNXbT/iD8JbpzC1Qs28iEk4=; b=SWz5dE7jeALYT4ji7oJa/ZeLjhFpsDoMgeVRaii40LeCWs3wsB8uWHtSut0kOXXfir1ASTzNnUmOhVkKROpLmNgnu+4vroz/Mq0HKuh3MkTaM295lCTP8DXVW5aR01FmOaEAC/g4cgDUtfsQMcLuAnXLyJx490mTjs/u1o3EmIk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=<>; Received: from localhost.localdomain (211.11.155.144) by TY2PR01MB2298.jpnprd01.prod.outlook.com (2603:1096:404:10::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.18; Mon, 10 Sep 2018 09:54:08 +0000 From: Yoshihiro Shimoda To: balbi@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com Cc: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, Yoshihiro Shimoda Subject: [PATCH v4 2/3] dt-bindings: usb: renesas_usbhs: add clock-names property Date: Mon, 10 Sep 2018 18:52:19 +0900 Message-Id: <1536573140-24123-3-git-send-email-yoshihiro.shimoda.uh@renesas.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1536573140-24123-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> References: <1536573140-24123-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> MIME-Version: 1.0 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: TYAPR01CA0147.jpnprd01.prod.outlook.com (2603:1096:404:7e::15) To TY2PR01MB2298.jpnprd01.prod.outlook.com (2603:1096:404:10::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f77a6a27-3ad8-4f91-e03b-08d617035a2f X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(8559020)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:TY2PR01MB2298; X-Microsoft-Exchange-Diagnostics: 1;TY2PR01MB2298;3:mrTKv+dwFvnP/l75hNEv4KUxlyO8JoKyrsE2FPG/JKci1lfMbbdzQ6T7ZQjjTndrfS2sH9XlC1DY9yZt00MW2hszvB2nSbYq//2pjAk61Z6zRQpu2cr2aKHdoqkb48sb8jpfNmX7P0hCjGDeI9TndXHm/NLhVUYxjb4vq16Or4p+6UYxmeBvsWgOUWA/VAjrYK2qOOC2VY5cQw1qHIUo/p4SlUSYqEvZXfaSh/gjMFgALgB6oOdAfJHAClRRkG+m;25:1hQOlpvbIfyAleP7qkFiguRH+bfxtkytUYPwfUzJ5NW3kml8t29vvX42ZnESki5GX0jb3QquOL5Fft8NB20PsFJPGWxl4K25UNlZweGvRJhGpxI4Ncm4ZBMZoJrH3wVjoN5BF+2+Gqbzvw4c3gyFouh4xDiyKN49TbqTNCoiH53//vuAYx7n2Pu9CFc1iemImS75ft7f50uVgPmI9EVyl9ifibsqx38mTlALTfUL2r5gymlp0Jf9e6E0zEEPlVAZIWdOGB5HWagLAkEnFDlGvyMzc9m33V3wEvoJllpQXJ+SxAHpgPJLdzaJr6eR4Xb634eBB0dQnJDDpIZtj1i6GA==;31:LvBC2/WCcGMekaxtg47tA9UROLAzXhduP5bOPIQogwn0Y/B8B40Io+dipFDV4QdJaDrETXwnxOAmHlOEZCjIUY2A2uaq09U1F6Ekyk/ua71FPMwU9pHegl72feh+hrvuXOXYASsjv3jZex3P2YIUrtHARVuK3073jV+ilzDJWUs6DhSiqduZYgOqZ/ddHhVdIDWaKkpKPUOtUU5+HM0kgefWlPbtZnUu/i8humzDeow= X-MS-TrafficTypeDiagnostic: TY2PR01MB2298: X-Microsoft-Exchange-Diagnostics: 1;TY2PR01MB2298;20:LXYLgm6Z54UvD5PWg9YD0vJFASCVQQuU/HzO7p2BcfUq7iH5wjWspC/X580Bj0Tp8EITZh0MoDRXQdw1JTLzjLL7NxhwssjM1g/ZL8L0yj/C+ZRf7LFSm9a6YSFK1rioW8fmgaZIii5E/G699j7tjq/FO6k46Fu+4h/npbM7JINDaapq528OnUDNzuqxWjaSYsuh1ZVCZrxcoD7Uv8MVgpmCH8P9yfVg2kk+SAOyc/6qoisb6VLHf4t9rgwrE1CoGg3Q8wu5bL0LgVH9S9Po/domPoSg6iuatf+QRaX0imMpdPXLD3x1FelidJ/j021GZ0UJB1oTSOnzcvh6ijruGQn3+BG6rfuW8UsdvWC+2KVk+pwUa8HtEh9+62LlQ5Swi4qW5KAVr2wA2w5xNoG+hJz1tnkBvEiBGV/H3Yc1YE/rHVHxqRex0PbRLw8zBiGqaMELRaE+rN3LMTnxqPtt2FTqBisqdzHTbKwuMM1CreCt2I9GTDasLdUMcKJgypLX;4:yrCxcD//yIWsJpelk3CdxXPiKbgZM0WFfJkzgrC1DJgxyg+hk5uHWPU/H6+GsilWKdI1XvzLl6mQt7xVDdQMHlKNmlG00GuNOMgd1JDbPqT4/PDSYD6feWKDBwz899NfJg2uGaFrivXiLvXyAvdbutC40v+NsqSQORVrHIMvdwhHaarm+lmZitoqIcd1AdVQeShTtWuJwUaBIr4yT6lik62GJr+pgae/K5mnly/0p0RbBtorxE2jWVeH8xxvs71yyg3Wit8OoY1qb/eNitEffg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(823301075)(3002001)(93006095)(3231311)(944501410)(52105095)(10201501046)(6055026)(149027)(150027)(6041310)(20161123562045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061750153)(20161123564045)(201708071742011)(7699050);SRVR:TY2PR01MB2298;BCL:0;PCL:0;RULEID:;SRVR:TY2PR01MB2298; X-Forefront-PRVS: 07915F544A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6069001)(136003)(366004)(396003)(39860400002)(376002)(346002)(199004)(189003)(2906002)(498600001)(6506007)(3846002)(7736002)(305945005)(53936002)(386003)(5660300001)(97736004)(81166006)(76176011)(81156014)(52116002)(6512007)(78352004)(16526019)(51416003)(6116002)(486006)(476003)(14444005)(42882007)(446003)(26005)(69590400006)(956004)(11346002)(2616005)(107886003)(16586007)(8676002)(8936002)(105586002)(6486002)(4326008)(316002)(6666003)(36756003)(68736007)(66066001)(47776003)(106356001)(48376002)(50226002)(25786009)(50466002)(3720700003);DIR:OUT;SFP:1102;SCL:1;SRVR:TY2PR01MB2298;H:localhost.localdomain;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:0;MX:0; Received-SPF: None (protection.outlook.com: localhost.localdomain does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: 1;TY2PR01MB2298;23:6JsdVHFUBxg2eAG66PZOhXqsqA1DNHGVFPeobA/EMp4djpkxzX4zYn175p8nSmXSQpoCk+MAzXLK8oHbLuKS4H1cSLXc1+MPqrp8kHtGihdjbaiJhXCkMiKfSQYq8mRE/Mw8pRoA5EC+9SkmHPSzLHCiHddV67iA4V2j+iACnnfV7j4u3AdqhKKgLfFPflRWJ/vpEpqbkWCq7YgtRfZgbixr7ClQ+ePY/+w7JmW3XggcA9sgCkY+CWv73knkbr0na/Y8iVrYxkV7KOJEPqlgjvAKjPaJe+aL+Hh97QyZ7On1UeeeWWt4Asw9FzzBNmlcXLyJfe+8+xVglsdjVcIXRKBd6QerKZJk+ezHuVriRNYxFa4JIkc6mDAs3P0hYcvfZcLdQzS1QBj7YceV50xeO97CmQbimBUhYkI23BKDrJF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1hBDHJpw0aMVM SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;TY2PR01MB2298;20:k3Una+tEbO4q8fcaTYqzABrMVEvR6BXZJRYed96X1pTLEHAPcaUFaFBhH7Ga2qdsfTHVebdmVflE8wYEUAoZaFIJoHj8wwcYzwxhK/ptFsctWi3GDP3p9Tbtkh7GLhgWcri1u0XXVh2juvFEYhxMaztG1pXIhYC7qqV/hjE3vtI= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2018 09:54:08.4151 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f77a6a27-3ad8-4f91-e03b-08d617035a2f X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY2PR01MB2298 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP R-Car Gen3 needs to enable clocks of both host and peripheral. Otherwise, other side device cannot work correctly. So, this patch adds a property of clock-names for R-Car Gen3 as an optional. Signed-off-by: Yoshihiro Shimoda --- Documentation/devicetree/bindings/usb/renesas_usbhs.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt index 087140a..dbdb92c 100644 --- a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt +++ b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt @@ -26,7 +26,9 @@ Required properties: - reg: Base address and length of the register for the USBHS - interrupts: Interrupt specifier for the USBHS - - clocks: A list of phandle + clock specifier pairs + - clocks: A list of phandle + clock specifier pairs. In case of + "renesas,rcar-gen3-usbhs" compatible device, first clock should be + peripheral and second one should be host. Optional properties: - renesas,buswait: Integer to use BUSWAIT register From patchwork Mon Sep 10 09:52:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Shimoda X-Patchwork-Id: 10593867 X-Patchwork-Delegate: geert@linux-m68k.org 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 8D28C1515 for ; Mon, 10 Sep 2018 09:54:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 79CC028E34 for ; Mon, 10 Sep 2018 09:54:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6DBD028E2A; Mon, 10 Sep 2018 09:54:19 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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 036B828E23 for ; Mon, 10 Sep 2018 09:54:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727799AbeIJOrb (ORCPT ); Mon, 10 Sep 2018 10:47:31 -0400 Received: from relmlor4.renesas.com ([210.160.252.174]:45268 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727353AbeIJOra (ORCPT ); Mon, 10 Sep 2018 10:47:30 -0400 Received: from unknown (HELO relmlir2.idc.renesas.com) ([10.200.68.152]) by relmlie3.idc.renesas.com with ESMTP; 10 Sep 2018 18:54:15 +0900 Received: from relmlii2.idc.renesas.com (relmlii2.idc.renesas.com [10.200.68.66]) by relmlir2.idc.renesas.com (Postfix) with ESMTP id 02C097DA7E; Mon, 10 Sep 2018 18:54:15 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.53,355,1531753200"; d="scan'208";a="292071062" Received: from mail-hk2apc01lp0211.outbound.protection.outlook.com (HELO APC01-HK2-obe.outbound.protection.outlook.com) ([65.55.88.211]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA256; 10 Sep 2018 18:54:13 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesas-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IiDFO4zX9gRA9SNBvVtAK9SHlNNpDwoAhiAC18SlNxQ=; b=etLw8mkOOM9liKF0TP67lv79xkzYlj1CWdgoyQN/mYcdl5BPb8kGhVMUmjA5rblkCGtSqzBNNHkSstlApXnYjw/PJ5YI91DLewrXoTAXWQYENJEhLqWbMgzv/PorBg/UxYN9Qs48CzeT1VEYIp1hebEArrOCFE43uG7aGS+f+Ok= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=<>; Received: from localhost.localdomain (211.11.155.144) by TY2PR01MB2298.jpnprd01.prod.outlook.com (2603:1096:404:10::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.18; Mon, 10 Sep 2018 09:54:08 +0000 From: Yoshihiro Shimoda To: balbi@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com Cc: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, Yoshihiro Shimoda Subject: [PATCH v4 3/3] usb: renesas_usbhs: Add multiple clocks management Date: Mon, 10 Sep 2018 18:52:20 +0900 Message-Id: <1536573140-24123-4-git-send-email-yoshihiro.shimoda.uh@renesas.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1536573140-24123-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> References: <1536573140-24123-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> MIME-Version: 1.0 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: TYAPR01CA0147.jpnprd01.prod.outlook.com (2603:1096:404:7e::15) To TY2PR01MB2298.jpnprd01.prod.outlook.com (2603:1096:404:10::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 05bed115-ed68-439e-b565-08d617035a64 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(8559020)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:TY2PR01MB2298; X-Microsoft-Exchange-Diagnostics: 1;TY2PR01MB2298;3:0jIbXQr2ukFYngUMOwQgrPDMdW6VpnFJEYt0bBYjqTCGVWrOBT0svNv0ApeEB4d9yFIwzoJFBsOBaHYplB1aXQaGhiwq2mrchcZKmXCCXaXj+8gey6xr/qIbVlO6LHm7ZMz/e0/lUAQjwwTE5hCfzPKI29XXxvkdQJQZZlf9OBdy4DK2glex3n2zmzsPOdvbrjQZpPJZZiwZkDkppuotHGiH9aaIAK2PK6bOVNGv3D5vtitPlu3GgfFgI2v8ykor;25:YVDY6N1N8MHnGu1p8HgRyC4Mrlg6hMc6US/vwYCuteq1lj4jhAcR5r0a7AhsZ5UEZSM6KKmgyE6b5EEtRGJE3iVf7oEoq8tBfNKWqLimZUEfAM7FHNjwvbW7qYfXeDQYxpdRJ6qt6Jk/Z//wWV/mkWeuIt7YqbqIc+zGop+Y9ORLe4ZMLNlcGtP4sNUa+0HtJ+8UmlQdZYrmo9YfDIN+stpYWMYYFS3b59rWLZ9wod3ILCSmIr0XNQmG6JgC+EgKbzozLaN1zE6WH70LAkiU1e2V+RHAd1NEEzbY8nfoNOkoxvHtn89MzZBLhPQMgNkAxkuQjf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5if2bXfMqWGM46UrH+armH62ox5E54muCGFmYP/KM/kFA85ig== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(823301075)(3002001)(93006095)(3231311)(944501410)(52105095)(10201501046)(6055026)(149027)(150027)(6041310)(20161123562045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061750153)(20161123564045)(201708071742011)(7699050);SRVR:TY2PR01MB2298;BCL:0;PCL:0;RULEID:;SRVR:TY2PR01MB2298; X-Forefront-PRVS: 07915F544A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6069001)(136003)(366004)(396003)(39860400002)(376002)(346002)(199004)(189003)(2906002)(498600001)(6506007)(3846002)(7736002)(305945005)(53936002)(386003)(5660300001)(97736004)(81166006)(76176011)(81156014)(52116002)(6512007)(78352004)(16526019)(51416003)(6116002)(486006)(476003)(42882007)(446003)(26005)(69590400006)(956004)(11346002)(2616005)(107886003)(16586007)(8676002)(8936002)(105586002)(6486002)(4326008)(316002)(6666003)(36756003)(68736007)(66066001)(47776003)(106356001)(48376002)(50226002)(25786009)(50466002)(3720700003);DIR:OUT;SFP:1102;SCL:1;SRVR:TY2PR01MB2298;H:localhost.localdomain;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:0;MX:0; Received-SPF: None (protection.outlook.com: localhost.localdomain does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: 1;TY2PR01MB2298;23:4mWQ2tQIVI8qj6SQMfxu5MYozL6hvfop7N9WheP+9NOL7ok5JqwKK5fM5QldWLD9LZXnPMfjfqIBrVCrvfffvVoubSfvTrVbDwcdtLsu3o+qIR0M8kYZvmdAVOB/VGkZKgU4DZs7AZNub5dp6J3aMb8zt0znmVasba592KA1+E+Hv5u3sMs/OwZOGmuqk/39cA+2kji6FvQ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tMeRYAno7qld81dQRyJ91haa1toac36+Hi741gY/l2rawFilg6YX5LESgRTPe9OY8V0HxlGB7YW3tA0qE3gEb2iFoHRUHWDsDEeOeDxMHNiJKhDaqhFBFqz41s0Y//wR/A7vzb4HxChzyXhIt/n0hzHFpDte/CbAJvcEjRYozLBAx782tgu7OjwjjtABh04EqyZwhobAta8bG51QBLB2ek1NpKmoO7fjmTvpQ7 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;TY2PR01MB2298;20:U5Lbwt2w+JbtX6ycn7q+zHTUwH04Uh/MRYJDYO7KwJPDyT0ZW8TEzD5da7qV7NLjePI7QVD5fWTulDCVcynPAm/R/RNxKqDJ+FztNPLJsULvrcgt7QLoTOlKFgmxDh3dmxUuofT0j+OLS3ubrKPnPsR1o2dZ91LI049TuNuZX04= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2018 09:54:08.7593 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 05bed115-ed68-439e-b565-08d617035a64 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY2PR01MB2298 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP R-Car Gen3 needs to enable clocks of both host and peripheral. Since [eo]hci-platform disables the reset(s) when the drivers are removed, renesas_usbhs driver doesn't work correctly. To fix this issue, this patch adds multiple clocks management on this renesas_usbhs driver. Signed-off-by: Yoshihiro Shimoda --- drivers/usb/renesas_usbhs/common.c | 88 ++++++++++++++++++++++++++++++++++++++ drivers/usb/renesas_usbhs/common.h | 2 + 2 files changed, 90 insertions(+) diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c index 1d355d5..d6c39ba 100644 --- a/drivers/usb/renesas_usbhs/common.c +++ b/drivers/usb/renesas_usbhs/common.c @@ -5,6 +5,7 @@ * Copyright (C) 2011 Renesas Solutions Corp. * Kuninori Morimoto */ +#include #include #include #include @@ -291,6 +292,79 @@ static void usbhsc_set_buswait(struct usbhs_priv *priv) usbhs_bset(priv, BUSWAIT, 0x000F, wait); } +static bool usbhsc_is_multi_clks(struct usbhs_priv *priv) +{ + if (priv->dparam.type == USBHS_TYPE_RCAR_GEN3 || + priv->dparam.type == USBHS_TYPE_RCAR_GEN3_WITH_PLL) + return true; + + return false; +} + +static int usbhsc_clk_get(struct device *dev, struct usbhs_priv *priv) +{ + if (!usbhsc_is_multi_clks(priv)) + return 0; + + /* The first clock should exist */ + priv->clks[0] = of_clk_get(dev->of_node, 0); + if (IS_ERR(priv->clks[0])) + return PTR_ERR(priv->clks[0]); + + /* + * To backward compatibility with old DT, this driver checks the return + * value if it's -ENOENT or not. + */ + priv->clks[1] = of_clk_get(dev->of_node, 1); + if (PTR_ERR(priv->clks[1]) == -ENOENT) + priv->clks[1] = NULL; + else if (IS_ERR(priv->clks[1])) + return PTR_ERR(priv->clks[1]); + + return 0; +} + +static void usbhsc_clk_put(struct usbhs_priv *priv) +{ + int i; + + if (!usbhsc_is_multi_clks(priv)) + return; + + for (i = 0; i < ARRAY_SIZE(priv->clks); i++) + clk_put(priv->clks[i]); +} + +static int usbhsc_clk_prepare_enable(struct usbhs_priv *priv) +{ + int i, ret; + + if (!usbhsc_is_multi_clks(priv)) + return 0; + + for (i = 0; i < ARRAY_SIZE(priv->clks); i++) { + ret = clk_prepare_enable(priv->clks[i]); + if (ret) { + while (--i >= 0) + clk_disable_unprepare(priv->clks[i]); + return ret; + } + } + + return ret; +} + +static void usbhsc_clk_disable_unprepare(struct usbhs_priv *priv) +{ + int i; + + if (!usbhsc_is_multi_clks(priv)) + return; + + for (i = 0; i < ARRAY_SIZE(priv->clks); i++) + clk_disable_unprepare(priv->clks[i]); +} + /* * platform default param */ @@ -341,6 +415,10 @@ static void usbhsc_power_ctrl(struct usbhs_priv *priv, int enable) /* enable PM */ pm_runtime_get_sync(dev); + /* enable clks */ + if (usbhsc_clk_prepare_enable(priv)) + return; + /* enable platform power */ usbhs_platform_call(priv, power_ctrl, pdev, priv->base, enable); @@ -353,6 +431,9 @@ static void usbhsc_power_ctrl(struct usbhs_priv *priv, int enable) /* disable platform power */ usbhs_platform_call(priv, power_ctrl, pdev, priv->base, enable); + /* disable clks */ + usbhsc_clk_disable_unprepare(priv); + /* disable PM */ pm_runtime_put_sync(dev); } @@ -667,6 +748,10 @@ static int usbhs_probe(struct platform_device *pdev) if (ret) goto probe_fail_rst; + ret = usbhsc_clk_get(&pdev->dev, priv); + if (ret) + goto probe_fail_clks; + /* * deviece reset here because * USB device might be used in boot loader. @@ -720,6 +805,8 @@ static int usbhs_probe(struct platform_device *pdev) return ret; probe_end_mod_exit: + usbhsc_clk_put(priv); +probe_fail_clks: reset_control_assert(priv->rsts); probe_fail_rst: usbhs_mod_remove(priv); @@ -750,6 +837,7 @@ static int usbhs_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); usbhs_platform_call(priv, hardware_exit, pdev); + usbhsc_clk_put(priv); reset_control_assert(priv->rsts); usbhs_mod_remove(priv); usbhs_fifo_remove(priv); diff --git a/drivers/usb/renesas_usbhs/common.h b/drivers/usb/renesas_usbhs/common.h index bce7d35..555b3e7 100644 --- a/drivers/usb/renesas_usbhs/common.h +++ b/drivers/usb/renesas_usbhs/common.h @@ -8,6 +8,7 @@ #ifndef RENESAS_USB_DRIVER_H #define RENESAS_USB_DRIVER_H +#include #include #include #include @@ -279,6 +280,7 @@ struct usbhs_priv { struct phy *phy; struct reset_control *rsts; + struct clk *clks[2]; }; /*