From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936101AbcJ0AUC (ORCPT ); Wed, 26 Oct 2016 20:20:02 -0400 Received: from vern.gendns.com ([206.190.152.46]:40096 "EHLO vern.gendns.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934174AbcJ0ATy (ORCPT ); Wed, 26 Oct 2016 20:19:54 -0400 From: David Lechner To: Sekhar Nori , Kevin Hilman Cc: Axel Haslam , David Lechner , Sergei Shtylyov , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v7 4/4] ARM: davinci: da8xx: register USB PHY clocks in the DT file Date: Wed, 26 Oct 2016 19:18:18 -0500 Message-Id: <1477527498-21930-5-git-send-email-david@lechnology.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1477527498-21930-1-git-send-email-david@lechnology.com> References: <1477527498-21930-1-git-send-email-david@lechnology.com> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vern.gendns.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lechnology.com X-Get-Message-Sender-Via: vern.gendns.com: authenticated_id: davidmain+lechnology.com/only user confirmed/virtual account not confirmed X-Authenticated-Sender: vern.gendns.com: davidmain@lechnology.com X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Axel Haslam The usb20_phy clock needs to be registered for the driver to be able to get and enable a clock. Currently the usb phy clocks are registered form board files, which will not be called during a device tree based boot. To be able to probe correctly usb form a device tree boot, register the usb phy clocks form the DT specific init. Unfortunately, davinci does not have proper clock support on device tree yet, so by registering the clock form de DT specific file we are forced to hardcode the parent clock, and cannot select refclkin as parent for any of the phy clocks of the da850 family. As none of the current da850 based boards currently in mainline use refclkin as source. I guess we can live with this limitation until clocks are correctly represented through CCF/device tree. Signed-off-by: Axel Haslam [Added error checking] Signed-off-by: David Lechner --- This patch was recently submitted separately. I added error checking and I am including it in this series since it is closely related. It could be combined with the "ARM: davinci: da8xx: add usb phy clocks" patch, but I think it is good to have a separate commit for the explanation in the commit message. arch/arm/mach-davinci/da8xx-dt.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/arch/arm/mach-davinci/da8xx-dt.c b/arch/arm/mach-davinci/da8xx-dt.c index 75e831d..839f8db 100644 --- a/arch/arm/mach-davinci/da8xx-dt.c +++ b/arch/arm/mach-davinci/da8xx-dt.c @@ -49,6 +49,17 @@ static struct of_dev_auxdata da850_auxdata_lookup[] __initdata = { static void __init da850_init_machine(void) { + int ret; + + ret = da8xx_register_usb20_phy_clk(false); + if (ret) + pr_warn("%s: registering USB 2.0 PHY clock failed: %d", + __func__, ret); + ret = da8xx_register_usb11_phy_clk(false); + if (ret) + pr_warn("%s: registering USB 1.1 PHY clock failed: %d", + __func__, ret); + of_platform_default_populate(NULL, da850_auxdata_lookup, NULL); } -- 2.7.4 From mboxrd@z Thu Jan 1 00:00:00 1970 From: david@lechnology.com (David Lechner) Date: Wed, 26 Oct 2016 19:18:18 -0500 Subject: [PATCH v7 4/4] ARM: davinci: da8xx: register USB PHY clocks in the DT file In-Reply-To: <1477527498-21930-1-git-send-email-david@lechnology.com> References: <1477527498-21930-1-git-send-email-david@lechnology.com> Message-ID: <1477527498-21930-5-git-send-email-david@lechnology.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org From: Axel Haslam The usb20_phy clock needs to be registered for the driver to be able to get and enable a clock. Currently the usb phy clocks are registered form board files, which will not be called during a device tree based boot. To be able to probe correctly usb form a device tree boot, register the usb phy clocks form the DT specific init. Unfortunately, davinci does not have proper clock support on device tree yet, so by registering the clock form de DT specific file we are forced to hardcode the parent clock, and cannot select refclkin as parent for any of the phy clocks of the da850 family. As none of the current da850 based boards currently in mainline use refclkin as source. I guess we can live with this limitation until clocks are correctly represented through CCF/device tree. Signed-off-by: Axel Haslam [Added error checking] Signed-off-by: David Lechner --- This patch was recently submitted separately. I added error checking and I am including it in this series since it is closely related. It could be combined with the "ARM: davinci: da8xx: add usb phy clocks" patch, but I think it is good to have a separate commit for the explanation in the commit message. arch/arm/mach-davinci/da8xx-dt.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/arch/arm/mach-davinci/da8xx-dt.c b/arch/arm/mach-davinci/da8xx-dt.c index 75e831d..839f8db 100644 --- a/arch/arm/mach-davinci/da8xx-dt.c +++ b/arch/arm/mach-davinci/da8xx-dt.c @@ -49,6 +49,17 @@ static struct of_dev_auxdata da850_auxdata_lookup[] __initdata = { static void __init da850_init_machine(void) { + int ret; + + ret = da8xx_register_usb20_phy_clk(false); + if (ret) + pr_warn("%s: registering USB 2.0 PHY clock failed: %d", + __func__, ret); + ret = da8xx_register_usb11_phy_clk(false); + if (ret) + pr_warn("%s: registering USB 1.1 PHY clock failed: %d", + __func__, ret); + of_platform_default_populate(NULL, da850_auxdata_lookup, NULL); } -- 2.7.4