From patchwork Fri Feb 14 14:20:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Fritz X-Patchwork-Id: 3652871 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5E91EBF13A for ; Fri, 14 Feb 2014 14:25:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 897A22018B for ; Fri, 14 Feb 2014 14:25:16 +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 976BE2017A for ; Fri, 14 Feb 2014 14:25:15 +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 1WEJfV-0001D1-LP; Fri, 14 Feb 2014 14:23:07 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WEJf9-0002Vz-7a; Fri, 14 Feb 2014 14:22:43 +0000 Received: from mail-la0-x233.google.com ([2a00:1450:4010:c03::233]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WEJeH-0002PI-HG for linux-arm-kernel@lists.infradead.org; Fri, 14 Feb 2014 14:22:01 +0000 Received: by mail-la0-f51.google.com with SMTP id c6so9272456lan.38 for ; Fri, 14 Feb 2014 06:21:27 -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=SQtJUdGhqVlYV4uVLLDvKlhcwBgREGHzXQYMHr1XHQbufzcxxgjsbbDNJNIHkTtR1o iK/wZEpV5XFOV2gDrut23O0azUfjNKJoDMEisoaggq2no3h0VZjb9z2XN5krdJsmljUJ hXASHZg0x9X0GddubnLYDAnuT/Rv7oBtZNArFCCUO75D2ZQ6yJL0NK0KBPl+FTzYe6Pa V7YIP7lXrjhckw0qSOZcH8vwSZf8SO5NyI1eiPstAAKqbMVL6qtSKLxPYzYGEZjJwrMa jgATv1NqavBOmzJG3QS4qryg2Hg5B2NqmdI/71AXsyhIPk2wwwvXialccJLC96oDYr9H 2v2g== X-Received: by 10.112.148.104 with SMTP id tr8mr1621620lbb.62.1392387687351; Fri, 14 Feb 2014 06:21:27 -0800 (PST) Received: from mars.ipredator.se (anon-38-216.vpn.ipredator.se. [46.246.38.216]) by mx.google.com with ESMTPSA id rt7sm6075562lbb.0.2014.02.14.06.21.24 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 14 Feb 2014 06:21:26 -0800 (PST) From: Christoph Fritz To: Subject: [PATCH v4 4/4] ARM: OMAP2+: Add pdata quirk for sys_clkout2 for omap3 DBB056 Date: Fri, 14 Feb 2014 15:20:56 +0100 Message-Id: <1392387656-15186-5-git-send-email-chf.fritz@googlemail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1392387656-15186-1-git-send-email-chf.fritz@googlemail.com> References: <1392387656-15186-1-git-send-email-chf.fritz@googlemail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140214_092149_806272_950258AC X-CRM114-Status: GOOD ( 12.17 ) X-Spam-Score: -2.0 (--) Cc: Nishanth Menon , devicetree@vger.kernel.org, Tony Lindgren , Daniel Mack , Tero Kristo , Tomi Valkeinen , linux-omap@vger.kernel.org, Javier Martinez Canillas , 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.7 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 */