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: 3540441 Return-Path: X-Original-To: patchwork-linux-omap@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 51B42C02DC for ; Mon, 27 Jan 2014 00:34:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7BFFE20117 for ; Mon, 27 Jan 2014 00:34:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F019F20115 for ; Mon, 27 Jan 2014 00:34:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753601AbaA0Adu (ORCPT ); Sun, 26 Jan 2014 19:33:50 -0500 Received: from mail-lb0-f169.google.com ([209.85.217.169]:39146 "EHLO mail-lb0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753594AbaA0Adt (ORCPT ); Sun, 26 Jan 2014 19:33:49 -0500 Received: by mail-lb0-f169.google.com with SMTP id q8so3990460lbi.14 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" Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org 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> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 */