From patchwork Mon Jan 27 00:33:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Fritz X-Patchwork-Id: 3540711 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2D3D79F391 for ; Mon, 27 Jan 2014 00:36:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 86A6E20114 for ; Mon, 27 Jan 2014 00:36:50 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 97AAF200FF for ; Mon, 27 Jan 2014 00:36:49 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W7aAQ-0005KR-Qf; Mon, 27 Jan 2014 00:35:12 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1W7aA4-0000ia-CG; Mon, 27 Jan 2014 00:34:48 +0000 Received: from mail-la0-x229.google.com ([2a00:1450:4010:c03::229]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W7a9T-0000dE-Lz for linux-arm-kernel@lists.infradead.org; Mon, 27 Jan 2014 00:34:13 +0000 Received: by mail-la0-f41.google.com with SMTP id mc6so4079305lab.0 for ; Sun, 26 Jan 2014 16:33:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=MaEdm7ZZit4cVpov6iAkIiUq5HS361DSOoZe9qtP9oQ=; b=FvkhSvUYbFBR9jMBhmEtL7knlZAQWa+N2phWScq16KKxKvLUINS5qvz/BlcIq/L1Tf Jje4CM8xNyVoS0FKpZYs7nJRohrUWBEsgyKcsexrISeeYLTjh1qzGErt1XasUl31tfKz odtx86WqUSiGCuX19DauOcTqvT9vM6RxHSF587itDDXx7qwPa0eWSxvbu8j7MEnpAfd6 HDdnXTFv58EM/ytgF5kG5NEEGdIQ9TwbSBpiMI5CAtMevQH0qQ74VC9oZxrS8OFavTK0 n9AvuYpxJ44uCQWFd9GlsTM4KCtUEr3h2fRckL3/PDzNtWZlGJ2ecNDzjEhahlRq8Zeo 1uyA== X-Received: by 10.112.129.168 with SMTP id nx8mr736694lbb.37.1390782827800; Sun, 26 Jan 2014 16:33:47 -0800 (PST) Received: from mars.ipredator.se (anon-32-241.vpn.ipredator.se. [46.246.32.241]) by mx.google.com with ESMTPSA id z3sm14294789lag.10.2014.01.26.16.33.45 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 26 Jan 2014 16:33:47 -0800 (PST) From: Christoph Fritz To: Nishanth Menon , Tero Kristo , Javier Martinez Canillas , Ulf Hansson , Mark Rutland , Ian Campbell , Tony Lindgren , Tomi Valkeinen , bcousson@baylibre.com, Daniel Mack , "Hans J. Koch" Subject: [PATCH 4/4] ARM: OMAP2+: Add pdata quirk for sys_clkout2 for omap3 DBB056 Date: Mon, 27 Jan 2014 01:33:17 +0100 Message-Id: <1390782797-24105-5-git-send-email-chf.fritz@googlemail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1390782797-24105-1-git-send-email-chf.fritz@googlemail.com> References: <1390782797-24105-1-git-send-email-chf.fritz@googlemail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140126_193411_950091_365BAC4A X-CRM114-Status: GOOD ( 12.85 ) X-Spam-Score: -2.0 (--) Cc: devicetree@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Full device tree support for clock control, especially to set frequencies, is not yet accomplished. Until then, configure the 24Mhz of sys_clkout2 to feed an USB-Hub here. Signed-off-by: Christoph Fritz --- arch/arm/mach-omap2/pdata-quirks.c | 37 ++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c index 435a823..e36ac3f 100644 --- a/arch/arm/mach-omap2/pdata-quirks.c +++ b/arch/arm/mach-omap2/pdata-quirks.c @@ -172,6 +172,43 @@ static void __init am3517_evm_legacy_init(void) static void __init omap3_dbb056_legacy_init(void) { + struct clk *clkout2; + struct clk *cm96fck; + + /* Reparent clkout2 to 96M_FCK */ + pr_info("%s: Late Reparent clkout2 to 96M_FCK\n", __func__); + clkout2 = clk_get(NULL, "clkout2_src_ck"); + if (clkout2 < 0) { + pr_err("a83x-quirk: couldn't get clkout2_src_ck\n"); + return; + } + cm96fck = clk_get(NULL, "cm_96m_fck"); + if (cm96fck < 0) { + pr_err("a83x-quirk: couldn't get cm_96m_fck\n"); + return; + } + if (clk_set_parent(clkout2, cm96fck) < 0) { + pr_err("a83x-quirk: couldn't reparent clkout2_src_ck\n"); + return; + } + + /* Set clkout2 to 24MHz for internal usb hub*/ + pr_info("%s: Set clkout2 to 24MHz for internal usb hub\n", __func__); + clkout2 = clk_get(NULL, "sys_clkout2"); + if (clkout2 < 0) { + pr_err("%s: couldn't get sys_clkout2\n", __func__); + return; + } + if (clk_set_rate(clkout2, 24000000) < 0) { + pr_err("%s: couldn't set sys_clkout2 rate\n", __func__); + return; + } + if (clk_prepare_enable(clkout2) < 0) { + pr_err("%s: couldn't enable sys_clkout2\n", __func__); + return; + } + + /* Initialize display */ omap3_dbb056_display_init_of(); } #endif /* CONFIG_ARCH_OMAP3 */