From patchwork Tue Sep 11 08:47:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Shimoda X-Patchwork-Id: 10595313 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 3CE42920 for ; Tue, 11 Sep 2018 08:49:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2E1122924C for ; Tue, 11 Sep 2018 08:49:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 22AA929255; Tue, 11 Sep 2018 08:49:03 +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 A3B0B2924C for ; Tue, 11 Sep 2018 08:49:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726754AbeIKNrT (ORCPT ); Tue, 11 Sep 2018 09:47:19 -0400 Received: from relmlor3.renesas.com ([210.160.252.173]:46763 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726645AbeIKNrS (ORCPT ); Tue, 11 Sep 2018 09:47:18 -0400 Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie2.idc.renesas.com with ESMTP; 11 Sep 2018 17:48:52 +0900 Received: from relmlii1.idc.renesas.com (relmlii1.idc.renesas.com [10.200.68.65]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id 811F76BAC7; Tue, 11 Sep 2018 17:48:52 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.53,359,1531753200"; d="scan'208";a="290617687" Received: from mail-os2jpn01lp0147.outbound.protection.outlook.com (HELO JPN01-OS2-obe.outbound.protection.outlook.com) ([23.103.139.147]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA256; 11 Sep 2018 17:48:52 +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=FsJk9nWskEV7BepW5Ug1iDgtLqvfXE382vPd6SOfIqKac6r287GgnKViFK+sWqtmymFvNzyB2+baN347Y53o/S2Nr0fIMnqvbJlNrk0rYo9LX2u7LU3Bci+U3nucmHkOgv5T1Rx7jBrKTtX5ZrwlN9fGY6iNzb2OY0+OGdct9gE= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=<>; Received: from localhost.localdomain (211.11.155.144) by TYAPR01MB2302.jpnprd01.prod.outlook.com (2603:1096:404:3::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.16; Tue, 11 Sep 2018 08:48:46 +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 v5 1/3] usb: renesas_usbhs: Add reset_control Date: Tue, 11 Sep 2018 17:47:03 +0900 Message-Id: <1536655625-10550-2-git-send-email-yoshihiro.shimoda.uh@renesas.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1536655625-10550-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> References: <1536655625-10550-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> MIME-Version: 1.0 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: OS2PR01CA0132.jpnprd01.prod.outlook.com (2603:1096:602::26) To TYAPR01MB2302.jpnprd01.prod.outlook.com (2603:1096:404:3::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f02fd75e-c4a7-4e4c-a4dc-08d617c36317 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:TYAPR01MB2302; X-Microsoft-Exchange-Diagnostics: 1;TYAPR01MB2302;3:9HvSHxYwojLU1tEv3cs2fDK6BbS+eYI3dflIdXh89Mo/4IQIB++hVDWqKpcqA3OG4O61U6wP4pbOEC81jWxNacH8AeaXbiwy+8e6OZZABc6fWIi5rhEXbbYErxqrmxUZZST7ZA6RVhGjPQjm9vQxHcaaSPIsfBb7Z1kGBytGtO7wLa5nDczwcWVKxQsLrPC5ZmRq+keYEIe+aEXIfahoMVqbnBdt8zO76ZB0jY+E36+V3GHDMQ97zpBGbOZZ1/mc;25:nZI3aZavkQYBAuHtLsbOpSB+q8i+gXCcyzqsrMd4Su1eKraqVAAvT7QGbven0tg5fqmhAwrZrMTzIhS+y82L1gY7tGNKq78X7fek5N2H1P7kwR55nsZlfReeaFVwyIkXuMDiUzxoKXJgMiiiDn8QugUX3NiEeK07fy/KiI7rXoNG4GIsoIq6M2GGTw5yni+nXrhLMyR6vieaw9InF2N0IHohTCOIOXMZZaSoDSrE9TqZwbmzZZgNwnC50vl3on0mqgW78TVmXtA0xe3WETlFhQE65pbClXesicTjl1usBBYWZgRvBuFWm6VDqkkxZMEq6HtdYuamwk8HNI7y33VXuQ==;31:2jeCEt9hkGo2zcG/lSFq7v51IlaNIYwE7NQMGClMhS+0MyPvDTFrFeh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-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(823301075)(10201501046)(3002001)(3231311)(944501410)(52105095)(93006095)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061750153)(20161123564045)(20161123560045)(201708071742011)(7699050);SRVR:TYAPR01MB2302;BCL:0;PCL:0;RULEID:;SRVR:TYAPR01MB2302; X-Forefront-PRVS: 0792DBEAD0 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6069001)(396003)(366004)(376002)(39860400002)(346002)(136003)(199004)(189003)(107886003)(97736004)(2906002)(5660300001)(53936002)(4326008)(25786009)(6486002)(78352004)(8676002)(305945005)(7736002)(16586007)(316002)(105586002)(106356001)(76176011)(6666003)(6512007)(6506007)(52116002)(51416003)(26005)(386003)(476003)(2616005)(956004)(486006)(3846002)(446003)(11346002)(47776003)(68736007)(42882007)(498600001)(48376002)(6116002)(50466002)(36756003)(16526019)(66066001)(81156014)(81166006)(50226002)(69590400006)(8936002)(3720700003);DIR:OUT;SFP:1102;SCL:1;SRVR:TYAPR01MB2302;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;TYAPR01MB2302;23:GsxTUP6YP4q3nb+AE5SvnqCeNvJyhPS+yBd3yxyKaW8WypGrL9hntgYn8WZoLMoqX/+5rRXwXvCFFYNGh/lKfGbnEBmabLQVlEo/+dTcte6M+JYQSFJ9z9LxztAeLn72flg7xJ9oWXfRHxFGmOWKoDn1e/ewh6bFF8ye56deAnLAcm0pCT9r7eHK9Eotc3EeOR/zXHZKYMIA8PU0cjPSaJEarQyPnz51FMVwHY/3xcPRwtSv8d9NuzS7CDoEKuS3J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IGIOxfgNtmJqfejvThf1j+XggfeJDaEXlW3x2a9TcYZNovasU81g9H5+SDHTQ6ZGANDd4GbmGM1iQOnNBmWH5xEQ3RURWDuRaU8GXx935a60/suHy9O9C0/Z2lr9qgjHuIutyFkXgo7qIztXbLREv0Xl7 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;TYAPR01MB2302;20:YfA5QGg2ywP5D11sY7rzUhQ7upNb/DOaguUnlwEVcVALcqSHUVwbQGSg8PZXax8cWBnS4Kjs2lNReRwPNgc6xu6MXsXzln5YZTAGfoWiwfF8ccQA3KSbRRWRPjzewk4X7QjdhgdshprqM6hNhva5SROcydS9lkARsvXPWDe7JLk= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Sep 2018 08:48:46.5537 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f02fd75e-c4a7-4e4c-a4dc-08d617c36317 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYAPR01MB2302 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@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 Tue Sep 11 08:47:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Shimoda X-Patchwork-Id: 10595303 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 AE48E3E9D for ; Tue, 11 Sep 2018 08:48:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9EAE22924A for ; Tue, 11 Sep 2018 08:48:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 92F2229255; Tue, 11 Sep 2018 08:48:56 +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 25F732924A for ; Tue, 11 Sep 2018 08:48:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726556AbeIKNrK (ORCPT ); Tue, 11 Sep 2018 09:47:10 -0400 Received: from relmlor4.renesas.com ([210.160.252.174]:32776 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726517AbeIKNrK (ORCPT ); Tue, 11 Sep 2018 09:47:10 -0400 Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie3.idc.renesas.com with ESMTP; 11 Sep 2018 17:48:51 +0900 Received: from relmlii2.idc.renesas.com (relmlii2.idc.renesas.com [10.200.68.66]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id 469096CBA7; Tue, 11 Sep 2018 17:48:51 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.53,359,1531753200"; d="scan'208";a="292175655" Received: from mail-os2jpn01lp0152.outbound.protection.outlook.com (HELO JPN01-OS2-obe.outbound.protection.outlook.com) ([23.103.139.152]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA256; 11 Sep 2018 17:48:50 +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=d4Liw95mA5cN3s0FJbnEgPWGjcP96yic0LKwhgCBqQo=; b=Y396VIWzLPMalHFr+Z1pmLYCdbCyHl5iDENSxMrLgjJKlWqPQywBXGR74bn9ceIka6Mr60u6icG0P40vpAWhwutlSvVv0cigWep6icPUhNJSBh3UmdfNvIiCSjuD3MWwnp2lpHWt49APpEIlrXSyzA+SrmCNoTFXWtXp8rik7Wk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=<>; Received: from localhost.localdomain (211.11.155.144) by TYAPR01MB2302.jpnprd01.prod.outlook.com (2603:1096:404:3::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.16; Tue, 11 Sep 2018 08:48:47 +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 v5 2/3] dt-bindings: usb: renesas_usbhs: add clock-names property Date: Tue, 11 Sep 2018 17:47:04 +0900 Message-Id: <1536655625-10550-3-git-send-email-yoshihiro.shimoda.uh@renesas.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1536655625-10550-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> References: <1536655625-10550-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> MIME-Version: 1.0 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: OS2PR01CA0132.jpnprd01.prod.outlook.com (2603:1096:602::26) To TYAPR01MB2302.jpnprd01.prod.outlook.com (2603:1096:404:3::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2c307478-1dd3-4d35-cd7d-08d617c36372 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:TYAPR01MB2302; X-Microsoft-Exchange-Diagnostics: 1;TYAPR01MB2302;3:zYvaiEkKeGd3GAAIauWV0hiejQle6raaBJ6P+RK49sGA1BhcAfWZ/t1npTY6MipTNA/jm3bYvEtnZtKN9RBYXJLe3E/asOwEg0XwJ/rLfam54l002nf6jdBZbdS50qAqkjbDyFwUT9gbXwaJPQmfG3/3voEFY603wZP2qOhKI8qBu3b0GFZiiHJMux+dOUYOByBpawCMGzgXbeYc550EofFnRfNLJyUnSlgL7uXjJDNaZOiX7Adjei5FmCsLoULv;25:dviivigxda0K9pR3p0QIOMUm8jiI2z5TFY6Wo+zO4qC/i9Q1qa/986e/aq5pxxRSK9uwhBgeZJUqh6m3UwaRmLiq2QUGFz4ZEYmifhA0UstZKEOw2MMleZUeIdT4CkWIStkNYijrmnfd4mPkHZlrbVItQ/b6XrgUO/3iQq5PMgU/m5+Ts5ebFFAWw6AfRzLv08sQVRWMFPLv7qZW1kGhpU65g5DMcffMLjnfo1m3E/Bj+JI4kdZQa+VHBfRY/LZG8C823PEKE1oanfNXfMkcyLIm96moPI7tHzUhB4lQPNEf8eNXZwU/cJKveSHJpyT1DmTjTzSqEE7AvhkzenMt+Q==;31:g23qrMWVofF4Yr0BYgzxL7sV1RjKMeFxP70qhRk2MR4S6Y9ReS0wKsnBt9Wk0Bwp/jtwTffmjC32uyIOuCQUbZdn4ugI0PzwvIT8OxOPIvQxXyKws+Lf4DjaeNNyNTgY+phEOiCLzFbSQhE4canKlytVpZ4LZbJQxIML7bruVScpgfqUrEIJrDztrAwWuDBhpiYSlJ7eRcfmjwZh2PCBHDNkh3XmvPAB56+G3io9xiA= X-MS-TrafficTypeDiagnostic: TYAPR01MB2302: X-Microsoft-Exchange-Diagnostics: 1;TYAPR01MB2302;20:MSC43PLerF4nSnZf4TfJjtMHLiuOSYxu4Jwsxcen62/NafeY8DYFivJuS8o+/ytbYsusWX3Sp2x3R0t7O+jVd54q6NT6/y7UiccPzK6AtYy0pR2Af55N5lmMQs69B8WRW/MQaKoX3ulrM4q9b+4wNKdorHRUZQp9nj8n/wyseHtDXCD55Mb5ozg78pV5uDUifAoppPwq/hu1+NtofJhtXQyWoRnQNsMEeiqDxoofkZ8g4+or2HU5YYWt12fotN8fRUVwJ5+ipPXaJLRbJ2VYLPN2V9EeFabbf2uAvvsKI7A3Q8Cu++Xo+NxPIOyKxBJGsxg3w9BxHCIhkpqST0a8a2pPJHsGNQpk7ucoAMOTD8cWIcQ0/krr5pOSK26QBIX6+krP8WZ60RkTq6TCYsVczuMnLRIjsbNddwBZWYxePHx+rAfhKNggTegBqGujPhKPmy1hJzIdBHDPt/UAl+TZyzn0kmkfaH1CwZ/d6TUP/xbtXoC28iKGMl6welyet4Hp;4:BvOZoBGk72X/ltI4FGWbuecO0wHjB5MJbQIaiP7+fCVy4Y/AlOcTgMcpg1UVjQQ7ihsh6ozvBCRymq2aqKFkrFQnuTt1iIgEetFycZ4qm2hJw+lkw/OoqUe/AeKdQK12taHMFAJcuiyY01dg6sCWcHFbg1gtFWcf3QUZ1JkE4d+tEA3m4PVwfIuQLg5JYWUb68Y0syzW7UzDHkph6PAjebznVidAamB7pjhIotFHIAVl3EUDnmQPXxj5QozKnxZZAzzwgOPOtZoA5QjsmgvEhA== 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)(5005006)(8121501046)(823301075)(10201501046)(3002001)(3231311)(944501410)(52105095)(93006095)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061750153)(20161123564045)(20161123560045)(201708071742011)(7699050);SRVR:TYAPR01MB2302;BCL:0;PCL:0;RULEID:;SRVR:TYAPR01MB2302; X-Forefront-PRVS: 0792DBEAD0 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6069001)(396003)(366004)(376002)(39860400002)(346002)(136003)(199004)(189003)(107886003)(97736004)(2906002)(5660300001)(53936002)(4326008)(25786009)(6486002)(78352004)(8676002)(305945005)(7736002)(14444005)(16586007)(316002)(105586002)(106356001)(76176011)(6666003)(6512007)(6506007)(52116002)(51416003)(26005)(386003)(476003)(2616005)(956004)(486006)(3846002)(446003)(11346002)(47776003)(68736007)(42882007)(498600001)(48376002)(6116002)(50466002)(36756003)(16526019)(66066001)(81156014)(81166006)(50226002)(69590400006)(8936002)(3720700003);DIR:OUT;SFP:1102;SCL:1;SRVR:TYAPR01MB2302;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;TYAPR01MB2302;23:n+ipGy7mIcnbBVctTkGMjiJjLrS9hnI1ZjLTtNt9Rf67sB4HEpcalZRFHAf+fmbKgNUMEJ67mUFSRTjd0ICcRtOmo173pcGHyX6YsIXdEIeqR0VgmYK6AN5/QDPh86O+yVkxgOPm7L+fWUDDelRwWTkc/cKvF1D04B9EQp04c/tyw2WCGWm2NicAGDmdazijjEFgd58qMl2TLvcR48/UE9mJ0pwHL0Le16Agm6E97nBvHGlbgfaTPegwBwcw/+wJv72gTj6aK5GmwmA4Y41eXDK3MFolrKCFG7HpKY+u2VJ0WNjlLZ1od2W3oykJVxIS4Ddt781GTrCfxKCmteGVGWrlqpGrABgoRYi1DCK3q/HY4Rq1ps/b5Y32ylP6MA6FnmrFs69+sj0lbRyQ9yqa+ceMMzjBAPLskkHymd9/BkM96E/m27y48so784tWgGDxrwBs/a8AlTKUGqbj3+U9dActZW73tdRRCvrkAF+TDZ0NzA8B8pi5AshmxgyKW+SZUciD4+O798zPmzpMmkQHo0eJ9Jv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HCw7Cc4ZniLM7hLlCffmxMWd0= X-Microsoft-Exchange-Diagnostics: 1;TYAPR01MB2302;6:G30zoXjFCKS5X7j2pisOewxbfqrscudWHJAD4JyjhF+9mkN46U5WGr+Uv2n08SWOqP38GDtiJ4HfSQqeNLw9QeG8fRAbOdkJy6rmzQToHZuWlXkbyRTFyWq0BX2RhayhLCb16NfrRV6IpPtEGC493b+14Jskx2kX9t3m7bANNIPuttT8iJILuuumDleN2XMiE7lpSVkRAyDEGG0S6S0sHnx8AjAQmmOJaMmih/N9xhDJ9tq8XxMbHUn1Dff9Y2HSRjQfC7hFHk9gQyQPV9uqmbYIAO8bv8t+YpP3dWyq3vqXZv+XCHTsulqiZ0/1YnEGLjEyaOjcjzJpgna2LN3pvIvLjeKtQiIGAtu4HUS3UOYn9mh6EoqKeXngV74zxsGFDY/cgjWGuG+NQ7TeNId3/vff13KwA7+TIUZ1Bprp0Na+pjOYwn5Z3l9CgAZnbcOcSpJ+dh9Or7qTWpaPOudjaQ==;5:RUwATnpu/rQGr+gIo2qQdPeXHV3UjsYdyBV8F7aeSasjsKK59PR8GVPQftVgryaGWqJXm7B/QrPS9Qfru5ryLLqheYM1hulCHqut4fGtbgu+CD0Pc2e6u3slr0cz00a8DYVPXZm0Li96j0LaQzTK8TMWPMVyQqTRz/Lk41i4I8s=;7:soM4X6buyRn+Imu1TbHu3ftFpDjPpQNyLfJihowDQJk6DTCWCtDoUSB4BXGa8XiPBV56OwXiu7WZPRPyV6Jo6dG3PwOFlY93UXrCezmX8zu3ZovToEK7/1H8scC+DmMI2STs7s64OK1kglaUMM2NRmUg0rpvoVu+3Jv13dXfBdQdM4RUZH94RSY7eVTW9m7qrai9t143dXAPHtJvT8HnmuiUmRhWJgWrrn1RW0u51P09x1iySVTbZB45W+SkPGIy SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;TYAPR01MB2302;20:PXMO9mUpu6GVVTix47EO1Il8bpyYoRDAkmQMHdnlIKnt09Ymgk6E/uVbtL5PKqiCeyYsROZWePi4De+0kSlf7FgQwBxVRujvOO1MmQxLJka4CbAP7cxfiTPhRhr1PejNy7NAWqFAr/VztdazP7b7Y6m7/jmOW3Nd+/jLxgN5fEg= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Sep 2018 08:48:47.1641 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2c307478-1dd3-4d35-cd7d-08d617c36372 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYAPR01MB2302 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@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 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt index 087140a..15fb3b3 100644 --- a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt +++ b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt @@ -26,7 +26,11 @@ 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", two clocks are required. + First clock should be peripheral and second one should be host. + - In case of except above, one clock is required. First clock + should be peripheral. Optional properties: - renesas,buswait: Integer to use BUSWAIT register From patchwork Tue Sep 11 08:47:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Shimoda X-Patchwork-Id: 10595309 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 30498921 for ; Tue, 11 Sep 2018 08:49:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 20E652924C for ; Tue, 11 Sep 2018 08:49:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1570C292CB; Tue, 11 Sep 2018 08:49:01 +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 671852924C for ; Tue, 11 Sep 2018 08:49:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726734AbeIKNrQ (ORCPT ); Tue, 11 Sep 2018 09:47:16 -0400 Received: from relmlor3.renesas.com ([210.160.252.173]:46763 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726546AbeIKNrQ (ORCPT ); Tue, 11 Sep 2018 09:47:16 -0400 Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie2.idc.renesas.com with ESMTP; 11 Sep 2018 17:48:51 +0900 Received: from relmlii2.idc.renesas.com (relmlii2.idc.renesas.com [10.200.68.66]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id 992686CBAF; Tue, 11 Sep 2018 17:48:51 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.53,359,1531753200"; d="scan'208";a="292175658" Received: from mail-os2jpn01lp0152.outbound.protection.outlook.com (HELO JPN01-OS2-obe.outbound.protection.outlook.com) ([23.103.139.152]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA256; 11 Sep 2018 17:48:51 +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=dFqlX4HpHVnHugq2IYGuSl4vhQ8wIMXpYusYNu5mu0TNZM4vpCBNtMck65uuN+87vWrYEqUfSE7mRrju9l7eIwhCL33b+WpCG4YJjhERU+9YmmmecRWHQR5HN1I7FYxgDvop6CA2bRNYdKXysR86Dcfb+XM9OCepoTFeva04iWI= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=<>; Received: from localhost.localdomain (211.11.155.144) by TYAPR01MB2302.jpnprd01.prod.outlook.com (2603:1096:404:3::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.16; Tue, 11 Sep 2018 08:48:47 +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 v5 3/3] usb: renesas_usbhs: Add multiple clocks management Date: Tue, 11 Sep 2018 17:47:05 +0900 Message-Id: <1536655625-10550-4-git-send-email-yoshihiro.shimoda.uh@renesas.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1536655625-10550-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> References: <1536655625-10550-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> MIME-Version: 1.0 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: OS2PR01CA0132.jpnprd01.prod.outlook.com (2603:1096:602::26) To TYAPR01MB2302.jpnprd01.prod.outlook.com (2603:1096:404:3::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c3941694-5411-45e7-9e0e-08d617c363c8 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:TYAPR01MB2302; X-Microsoft-Exchange-Diagnostics: 1;TYAPR01MB2302;3:6NqFbRyUCh1sl86iH4UKHYHoZv6P1EvNKSljibwUswz/LGnrYDfVqzxpC5NOnkHKE9Ars6w0GlMopa7RwXplnx6UeC4Sfslcg2hNqiwC5AqtLd7SwUi2MXWkJwRhf+zwUr/4k+IVmDMD03aOlDFqRf4HfVvuN712ZsFjrqH8PayTl/WEW76qvYFgDovE98sn0VDjOMUy4XNoeI56Kn6AFYQHdEgQdIwCo9Qrp5Bx3qgI8PsEpugNKN/PAeT47HUg;25:iPx04j7WBFA6jYH19NKeJcIKv9YQzkgbtylYfec+Pal5pKWTFwzV1cBgCZbuP8k/zop0Ycow7T9EC85pxcWJmBTWPbZABrOH3ppwCdxzbJkcPaHlyz5GUvh7l6PrN5hoB/9lISBYK5VxpfrNwaxQq/dKtJ3ex6x+sZAcvlt9T5jxx6Gn8BmYv9IKSMdvCgZA77FqEhXDi0L7JGeOdx0sxLmQycCf3HsgijchtZCwqiUrmWeSxN8FsT0PrHlKL1z9fMFyoq0Az5k8/WUVm6B3RAfA/SYWtjnSaa99EbavbAtjNZDCmelzwrM/2Gfyn7eaYEpJ4bXRH+ux1iphfe+h5g==;31:ubAhha4yxxX6v2gRT5BGuWHfLX1WRHPRPp+79rUxx1+1MfBR2nOlQDk2LyBJAxgcswwMUcT3DZKsl89Sb88v5qCcsqfHunNTHMDzNfWuJFoytLLY6cjtC+7nylNdC5NtBBg0SkeKlLsK3rbEk7sjNB6VsJNkASdOLECfupbuuUu00tQo3xw2+UmPCQb68pyy38lhNhutsloFffzMjDyHzMeI6hP0PCP9BhWX1PfJKpc= X-MS-TrafficTypeDiagnostic: TYAPR01MB2302: X-Microsoft-Exchange-Diagnostics: 1;TYAPR01MB2302;20:ipMEUYnYp2YnEjtSYAfBHZiLxayVt51UYmG7M8V3P0/+ivdKlPG3Y+9ayKUlEDVCTZBOrETXAUa/iyvK1rErfbjVTWfgnTyydFXmebDJDvqdnWEyKSDhWD0oKtW0W8KoEKaFLc3jt5b8QwJOZgOEfqcRY+dn7WzXsZkdQjhC/Dxkf4y+r5ENDDS5io9ZvWz4IWv3e/umEwPJGGr/AcKD9ofeON0I8xkCbXhJb7KOYRQwUSfjImAZgxaNrcdlDp8TBWHC3rrElspeAdLFDjPhOxjfUuPJvCzbgiyg6UjbJJ+mGkHf1jCxHwDrwa8PQnQ7ggWfL9wzLKJJbmRM4IP7m5bAXIvB1Oxr/fKavEezJ6YNROB14GIRjnbKXFbC6Qj3/WDNbJGvJzyWy0ittOxDn8ys8M+Q7lrfBdzyU7ExvHAgAkWT3qds7h1dkE0MS2SC62s1BBEuwFhB5tlnK9kCKynwhZAjn8QDAh9+fISGK1wQ+srs986vMdEGaejC2vlF;4:bGFMGW5rSBrHPZdk6zVigechCbArKYdVok5FiDPuli9ISh2pEWVbSmZKYYTKHBCgXEskfGXChT689STWSgCN7LY1cOF827BIUWw5bBRQQpHb1Y4wtYM5foxfBjO5/Cnjccrp/uUaIVR9rOI4kRPGLGuo/hrzX0RDSIwQBIaH5xZsiRBmWQQsm1kKWOYgxL5vJtXSjFNQZ6MuVggim74MPAjlkUJ5CXho+Wdjx4PvWRmymXcZE/9ZH+HwtDU9pLJgrltisSu95/QyIndvb5x/Ng== 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)(5005006)(8121501046)(823301075)(10201501046)(3002001)(3231311)(944501410)(52105095)(93006095)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061750153)(20161123564045)(20161123560045)(201708071742011)(7699050);SRVR:TYAPR01MB2302;BCL:0;PCL:0;RULEID:;SRVR:TYAPR01MB2302; X-Forefront-PRVS: 0792DBEAD0 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6069001)(396003)(366004)(376002)(39860400002)(346002)(136003)(199004)(189003)(107886003)(97736004)(2906002)(5660300001)(53936002)(4326008)(25786009)(6486002)(78352004)(8676002)(305945005)(7736002)(16586007)(316002)(105586002)(106356001)(76176011)(6666003)(6512007)(6506007)(52116002)(51416003)(26005)(386003)(476003)(2616005)(956004)(486006)(3846002)(446003)(11346002)(47776003)(68736007)(42882007)(498600001)(48376002)(6116002)(50466002)(36756003)(16526019)(66066001)(81156014)(81166006)(50226002)(69590400006)(8936002)(3720700003);DIR:OUT;SFP:1102;SCL:1;SRVR:TYAPR01MB2302;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;TYAPR01MB2302;23:ZcyRxp8GBQOxpB2kXsWBsuvIBowWWT97LWdypipdGnNSdvyCO66w0BsRCqDAlKZJev9qhAR6ByPNMOyXeW2HDaP8aE3xK2Ie0xPhMouQnWPGsItvKEvxmGDZuEAKptfD3nzZlh2rRhEnkpJNJl7BTa5XBFu+CaVMdKwzE0qTWsnZtDaMg5PjK8oEuC9pbRLYU0hPNlzGr9iTzSTjwvUQCGPtcRAbzrRf89j3X11AkE3Y1UKP7HtiBoxnnCbuMeKQCv9BSmBfWDf48nwOdEaY1T+/iaWWtgumNMmBgpyuhX+swSykWdhOuftswCR6/H9uBGcZumNc/hyN60b54LA/vSy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PAep6KAHYHOKu8ZOLCCt0IhLEOJy4jxp31tZPoaX5phT3qrk6ncyb6WN5qrYIDN28NoC71KMaMky4mUxfMWT/l9/KqZ4i4INY SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;TYAPR01MB2302;20:6LMSHBF5H9yQoi9XZ+8RS+Y+AHiDNifChPgsyF9ynHt6AIsmiiAtdzubqBz1Z87fw6pa7cmVZushtTNTN/ZlS/yERq85+fYxffarhUW5jjgFlwaqJRODt1d9xBnnbLapzpf5OTzH9EcSDpxJVnvI2u3kCVwD7q4MwywQXyIdS5Y= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Sep 2018 08:48:47.7125 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c3941694-5411-45e7-9e0e-08d617c363c8 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYAPR01MB2302 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@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]; }; /*