From patchwork Tue Jan 21 19:47:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Fritz X-Patchwork-Id: 3519441 Return-Path: X-Original-To: patchwork-linux-omap@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 5C2F59F1C3 for ; Tue, 21 Jan 2014 19:48:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 800DF20117 for ; Tue, 21 Jan 2014 19:48:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A598720109 for ; Tue, 21 Jan 2014 19:48:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753715AbaAUTsW (ORCPT ); Tue, 21 Jan 2014 14:48:22 -0500 Received: from mail-la0-f48.google.com ([209.85.215.48]:35007 "EHLO mail-la0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753456AbaAUTsV (ORCPT ); Tue, 21 Jan 2014 14:48:21 -0500 Received: by mail-la0-f48.google.com with SMTP id el20so589488lab.35 for ; Tue, 21 Jan 2014 11:48:19 -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=4Ct/75yoQH3UC/2eeB1rAw4VFlDuW65wky9X6MHwa+o=; b=Sn93s0fuO6Z0w8dsY9BLX8Bz3P6lRGMkvhyNBczdZ1ZPRCKB8qaqRQMwDby828X1um dFVB1faEfhiGmLwE7KdxZAMmouZycNbpofv3vwbDU+iQN0Nk0lXurDW+zsvcuD++qbSu 7ZNmQHWsbGkizO9okab3/4EcXnND5Tpwuxod8k1T3+92SwBX6XL24GyyNUzpOTa6cGY8 WpG7xWsYHeNEOKIbavthlWWwaUWF3aHWTriLDxfyOS6AyJbl3NVlvMHEx13hBjfmSaJB 9LeYqjolA0whGQeoNEKOqrEzXfUXHh5m8SHth0LJ89YBwzq4WbJO4/xnn4StQJUPgDr1 BUvQ== X-Received: by 10.112.130.35 with SMTP id ob3mr16831220lbb.2.1390333699800; Tue, 21 Jan 2014 11:48:19 -0800 (PST) Received: from mars.ipredator.se (anon-35-60.vpn.ipredator.se. [46.246.35.60]) by mx.google.com with ESMTPSA id n13sm5015606lbl.17.2014.01.21.11.48.17 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 21 Jan 2014 11:48:18 -0800 (PST) From: Christoph Fritz To: Tony Lindgren , Tomi Valkeinen , Mark Rutland , Ian Campbell , , Archit Taneja , Javier Martinez Canillas , Daniel Mack , "Hans J. Koch" Cc: devicetree@vger.kernel.org, linux-omap@vger.kernel.org Subject: [PATCH 5/6] ARM: OMAP2+: Add pdata quirk for sys_clkout2 for omap3 DBB056 Date: Tue, 21 Jan 2014 20:47:39 +0100 Message-Id: <1390333660-30573-6-git-send-email-chf.fritz@googlemail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1390333660-30573-1-git-send-email-chf.fritz@googlemail.com> References: <1390333660-30573-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 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 bce8020..07d05f6 100644 --- a/arch/arm/mach-omap2/pdata-quirks.c +++ b/arch/arm/mach-omap2/pdata-quirks.c @@ -95,6 +95,43 @@ static void __init omap3_zoom_legacy_init(void) static void __init omap3_dbb056_legacy_init(void) { + struct clk *clkout2; + struct clk *cm96fck; + + /* Reparent clkout2 to 96M_FCK */ + pr_info("a83x-quirk: Late Reparent clkout2 to 96M_FCK\n"); + 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("a83x-quirk: Set clkout2 to 24MHz for internal usb hub\n"); + clkout2 = clk_get(NULL, "sys_clkout2"); + if(clkout2 < 0) { + pr_err("a83x-quirk: couldn't get sys_clkout2\n"); + return; + } + if(clk_set_rate(clkout2, 24000000) < 0) { + printk(KERN_ERR "board-omap3evm: couldn't set sys_clkout2 rate\n"); + return; + } + if(clk_prepare_enable(clkout2) < 0) { + pr_err("a83x-quirk: couldn't enable sys_clkout2\n"); + return; + } + + /* Initialize display */ omap3_dbb056_display_init_of(); } #endif /* CONFIG_ARCH_OMAP3 */