From patchwork Fri Apr 27 06:56:01 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Zhao X-Patchwork-Id: 8247 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 009C023E42 for ; Fri, 27 Apr 2012 06:57:14 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id BA81DA186EE for ; Fri, 27 Apr 2012 06:57:13 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id e36so857924iag.11 for ; Thu, 26 Apr 2012 23:57:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf :x-spamscore:x-bigfish:x-forefront-antispam-report:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :mime-version:content-type:x-originatororg:x-gm-message-state; bh=hVxszrBdDziUFVoFXOWTBSgBVEW8avWNZDSt4/tdkLk=; b=LcQA9SlC4gJjBGXd2veLvSxI3nvTSaB1MuGBbroHe9nrmmvhwfW3lHR6rwCYCxBePB F4S7elxCPownma6VdP5O0PaCETcs2qt7cEnpTEl8RTow3QBllyQOPe0QSD5q6Bg+pY3P 1kAtXAzSUgqjeWEbNue38DWnSaoX/pr9yGpQQ4ARE9eYu3xekDHJFsT37x76fK2x8KYL bPn5en4NtohIAE3JWXTKHjvKeagrWjHhBVoHB6cGxVkijNDl4ZafxhHP0yx0y/C5UxXF KfPyiXmSp1WqeQROa6SOVfcW3+jTs2kvVmxm0NtyNFXSfwoEkPc/mJ3jM/JpqS4o3TXF Hx5w== Received: by 10.50.168.106 with SMTP id zv10mr827463igb.55.1335509833530; Thu, 26 Apr 2012 23:57:13 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.137.198 with SMTP id x6csp5155ibt; Thu, 26 Apr 2012 23:57:13 -0700 (PDT) Received: by 10.68.72.70 with SMTP id b6mr10974239pbv.58.1335509832839; Thu, 26 Apr 2012 23:57:12 -0700 (PDT) Received: from va3outboundpool.messaging.microsoft.com (va3ehsobe002.messaging.microsoft.com. [216.32.180.12]) by mx.google.com with ESMTPS id rb2si2171852pbc.305.2012.04.26.23.57.12 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 26 Apr 2012 23:57:12 -0700 (PDT) Received-SPF: neutral (google.com: 216.32.180.12 is neither permitted nor denied by best guess record for domain of B20223@freescale.com) client-ip=216.32.180.12; Authentication-Results: mx.google.com; spf=neutral (google.com: 216.32.180.12 is neither permitted nor denied by best guess record for domain of B20223@freescale.com) smtp.mail=B20223@freescale.com Received: from mail165-va3-R.bigfish.com (10.7.14.251) by VA3EHSOBE008.bigfish.com (10.7.40.28) with Microsoft SMTP Server id 14.1.225.23; Fri, 27 Apr 2012 06:57:09 +0000 Received: from mail165-va3 (localhost [127.0.0.1]) by mail165-va3-R.bigfish.com (Postfix) with ESMTP id 043F73A0457; Fri, 27 Apr 2012 06:57:09 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275bh8275dhz2dh2a8h668h839hd24he5bh) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI Received: from mail165-va3 (localhost.localdomain [127.0.0.1]) by mail165-va3 (MessageSwitch) id 1335509826651388_9461; Fri, 27 Apr 2012 06:57:06 +0000 (UTC) Received: from VA3EHSMHS020.bigfish.com (unknown [10.7.14.244]) by mail165-va3.bigfish.com (Postfix) with ESMTP id 8D89838004D; Fri, 27 Apr 2012 06:57:06 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by VA3EHSMHS020.bigfish.com (10.7.99.30) with Microsoft SMTP Server (TLS) id 14.1.225.23; Fri, 27 Apr 2012 06:57:05 +0000 Received: from az33smr01.freescale.net (10.64.34.199) by 039-SN1MMR1-003.039d.mgd.msft.net (10.84.1.16) with Microsoft SMTP Server id 14.1.355.3; Fri, 27 Apr 2012 01:56:55 -0500 Received: from b20223-02.ap.freescale.net (b20223-02.ap.freescale.net [10.192.242.124]) by az33smr01.freescale.net (8.13.1/8.13.0) with ESMTP id q3R6uBps008244; Fri, 27 Apr 2012 01:56:52 -0500 (CDT) From: Richard Zhao To: , , CC: , , , , , , , Richard Zhao Subject: [PATCH 10/11] ARM: imx6q_sabrelite: clkdev_add cko1 for sgtl5000 Date: Fri, 27 Apr 2012 14:56:01 +0800 Message-ID: <1335509762-7777-11-git-send-email-richard.zhao@freescale.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1335509762-7777-1-git-send-email-richard.zhao@freescale.com> References: <1335509762-7777-1-git-send-email-richard.zhao@freescale.com> MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-Gm-Message-State: ALoCoQlUujFjESvStgKb2ZRAKyEutQevn+BLD5N2z5GwuGxEca+cZvu0iSIGpeWmvlG+AxXxM52P Signed-off-by: Richard Zhao --- arch/arm/mach-imx/clk-imx6q.c | 3 +++ arch/arm/mach-imx/mach-imx6q.c | 28 ++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-imx/clk-imx6q.c b/arch/arm/mach-imx/clk-imx6q.c index 9a03dcc..4ea0de0 100644 --- a/arch/arm/mach-imx/clk-imx6q.c +++ b/arch/arm/mach-imx/clk-imx6q.c @@ -419,6 +419,9 @@ int __init mx6q_clocks_init(void) clk_register_clkdev(clk[dummy], NULL, "20bc000.wdog"); clk_register_clkdev(clk[dummy], NULL, "20c0000.wdog"); clk_register_clkdev(clk[ssi1], NULL, "2028000.ssi"); + clk_register_clkdev(clk[cko1_sel], "cko1_sel", NULL); + clk_register_clkdev(clk[ahb], "ahb", NULL); + clk_register_clkdev(clk[cko1], "cko1", NULL); for (i = 0; i < ARRAY_SIZE(clks_init_on); i++) { c = clk_get_sys(clks_init_on[i], NULL); diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c index d25c5d8..e9b2522 100644 --- a/arch/arm/mach-imx/mach-imx6q.c +++ b/arch/arm/mach-imx/mach-imx6q.c @@ -10,6 +10,8 @@ * http://www.gnu.org/copyleft/gpl.html */ +#include +#include #include #include #include @@ -75,10 +77,36 @@ static int ksz9021rn_phy_fixup(struct phy_device *phydev) return 0; } +static void __init imx6q_cko1_setup(void) +{ + struct clk *cko1_sel, *ahb, *cko1; + unsigned long rate; + + cko1_sel = clk_get_sys(NULL, "cko1_sel"); + ahb = clk_get_sys(NULL, "ahb"); + cko1 = clk_get_sys(NULL, "cko1"); + if (IS_ERR(cko1_sel) || IS_ERR(ahb) || IS_ERR(cko1)) { + printk(KERN_ERR "cko1 setup failed!\n"); + goto put_clk; + } + clk_set_parent(cko1_sel, ahb); + rate = clk_round_rate(cko1, 16000000); + clk_set_rate(cko1, rate); + clk_register_clkdev(cko1, NULL, "0-000a"); +put_clk: + if (!IS_ERR(cko1_sel)) + clk_put(cko1_sel); + if (!IS_ERR(ahb)) + clk_put(ahb); + if (!IS_ERR(cko1)) + clk_put(cko1); +} + static void __init imx6q_sabrelite_init(void) { phy_register_fixup_for_uid(PHY_ID_KSZ9021, MICREL_PHY_ID_MASK, ksz9021rn_phy_fixup); + imx6q_cko1_setup(); } static void __init imx6q_init_machine(void)