From patchwork Wed May 9 11:33:06 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Zhao X-Patchwork-Id: 8490 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 6618C23E9A for ; Wed, 9 May 2012 11:33:57 +0000 (UTC) Received: from mail-yx0-f180.google.com (mail-yx0-f180.google.com [209.85.213.180]) by fiordland.canonical.com (Postfix) with ESMTP id 35B58A18595 for ; Wed, 9 May 2012 11:33:57 +0000 (UTC) Received: by mail-yx0-f180.google.com with SMTP id q6so155788yen.11 for ; Wed, 09 May 2012 04:33:57 -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=x8F9K7aH53tawZA7nh20zf8y8Rq5bf/1rajRtt4421Q=; b=bfjTIbWsTMvuNEtFlGU8KO75zuixZ1cNY7qg55eHuzEAINFexMztiKfsngrN3Ksfzf qqWRUVZLkFuYtmKMG6Er6CWYh77IEXtCMj1RYJMSo/Ckp0phqlM5ocVAQwBRvFjUjU72 aKI3gf6Gkc9qB4pQfkyVfqPs4DApQmt18nq670YYHcXlOil09hp8LCWwPeSLBXUC141K YhDB/T2GQqzyleypZXEJpZgaAlUgRq/khRys6wioUXoOF3+FbllqvhscJH0rv+k4u64r ucaeuWRkPm7QJf0iAPNCDZBTvQBGNkSHUYUSm0Ad/EwTZNfCfeD75SCaNMUEj2B2XeH/ gaxA== Received: by 10.50.220.136 with SMTP id pw8mr13077747igc.1.1336563236662; Wed, 09 May 2012 04:33:56 -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.73.147 with SMTP id q19csp8651ibj; Wed, 9 May 2012 04:33:55 -0700 (PDT) Received: by 10.180.86.194 with SMTP id r2mr46654939wiz.15.1336563235300; Wed, 09 May 2012 04:33:55 -0700 (PDT) Received: from tx2outboundpool.messaging.microsoft.com (tx2ehsobe004.messaging.microsoft.com. [65.55.88.14]) by mx.google.com with ESMTPS id j12si12426499wiv.12.2012.05.09.04.33.54 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 09 May 2012 04:33:55 -0700 (PDT) Received-SPF: neutral (google.com: 65.55.88.14 is neither permitted nor denied by best guess record for domain of B20223@freescale.com) client-ip=65.55.88.14; Authentication-Results: mx.google.com; spf=neutral (google.com: 65.55.88.14 is neither permitted nor denied by best guess record for domain of B20223@freescale.com) smtp.mail=B20223@freescale.com Received: from mail161-tx2-R.bigfish.com (10.9.14.247) by TX2EHSOBE001.bigfish.com (10.9.40.21) with Microsoft SMTP Server id 14.1.225.23; Wed, 9 May 2012 11:33:53 +0000 Received: from mail161-tx2 (localhost [127.0.0.1]) by mail161-tx2-R.bigfish.com (Postfix) with ESMTP id F14C716066C; Wed, 9 May 2012 11:33:52 +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 mail161-tx2 (localhost.localdomain [127.0.0.1]) by mail161-tx2 (MessageSwitch) id 133656323163565_3072; Wed, 9 May 2012 11:33:51 +0000 (UTC) Received: from TX2EHSMHS042.bigfish.com (unknown [10.9.14.247]) by mail161-tx2.bigfish.com (Postfix) with ESMTP id F192F260070; Wed, 9 May 2012 11:33:50 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by TX2EHSMHS042.bigfish.com (10.9.99.142) with Microsoft SMTP Server (TLS) id 14.1.225.23; Wed, 9 May 2012 11:33:50 +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; Wed, 9 May 2012 06:33:49 -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 q49BXDtR001540; Wed, 9 May 2012 06:33:45 -0500 (CDT) From: Richard Zhao To: , , CC: , , , , , , , , , , Richard Zhao Subject: [PATCH V2 07/11] ARM: imx6q_sabrelite: clk_register_clkdev cko1 for sgtl5000 Date: Wed, 9 May 2012 19:33:06 +0800 Message-ID: <1336563190-19974-8-git-send-email-richard.zhao@freescale.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1336563190-19974-1-git-send-email-richard.zhao@freescale.com> References: <1336563190-19974-1-git-send-email-richard.zhao@freescale.com> MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-Gm-Message-State: ALoCoQnq42BBR487Mlcj/9WOCHkLLWGBPC8Xc1WbUnOhU+jq01TRlwCoGoCKZdOXb0olAztEnKPV 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 92550c5..096fcfb 100644 --- a/arch/arm/mach-imx/clk-imx6q.c +++ b/arch/arm/mach-imx/clk-imx6q.c @@ -420,6 +420,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_ipg], 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 74e44d3..494c365 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 @@ -76,10 +78,36 @@ static int ksz9021rn_phy_fixup(struct phy_device *phydev) return 0; } +static void __init imx6q_sabrelite_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)) { + pr_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_sabrelite_cko1_setup(); } static void __init imx6q_init_machine(void)