From patchwork Mon Jun 23 04:10:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anson Huang X-Patchwork-Id: 362658 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 14B7E140094 for ; Mon, 23 Jun 2014 14:15:00 +1000 (EST) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WyvcW-0002pi-LY; Mon, 23 Jun 2014 04:12:40 +0000 Received: from mail-bn1lp0141.outbound.protection.outlook.com ([207.46.163.141] helo=na01-bn1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WyvcS-0002ld-NY for linux-arm-kernel@lists.infradead.org; Mon, 23 Jun 2014 04:12:38 +0000 Received: from BN3PR0301CA0043.namprd03.prod.outlook.com (25.160.152.139) by DM2PR03MB349.namprd03.prod.outlook.com (10.141.54.11) with Microsoft SMTP Server (TLS) id 15.0.954.9; Mon, 23 Jun 2014 04:12:13 +0000 Received: from BN1BFFO11FD021.protection.gbl (2a01:111:f400:7c10::1:115) by BN3PR0301CA0043.outlook.office365.com (2a01:111:e400:401e::11) with Microsoft SMTP Server (TLS) id 15.0.969.15 via Frontend Transport; Mon, 23 Jun 2014 04:12:12 +0000 Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1BFFO11FD021.mail.protection.outlook.com (10.58.144.84) with Microsoft SMTP Server (TLS) id 15.0.969.12 via Frontend Transport; Mon, 23 Jun 2014 04:12:12 +0000 Received: from ubuntu.ap.freescale.net (ubuntu-010192242118.ap.freescale.net [10.192.242.118]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id s5N4C4F6016817; Sun, 22 Jun 2014 21:12:05 -0700 From: Anson Huang To: , , Subject: [PATCH] ARM: imx: add cpufreq support for i.mx6sx Date: Mon, 23 Jun 2014 12:10:32 +0800 Message-ID: <1403496632-20308-1-git-send-email-b20788@freescale.com> X-Mailer: git-send-email 1.7.9.5 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:CAL; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(6009001)(189002)(199002)(87286001)(80022001)(77156001)(84676001)(20776003)(62966002)(50986999)(21056001)(104016002)(93916002)(85306003)(2201001)(4396001)(92726001)(92566001)(104166001)(97736001)(50226001)(48376002)(88136002)(89996001)(36756003)(95666004)(79102001)(44976005)(64706001)(83322001)(99396002)(46102001)(74502001)(6806004)(106466001)(26826002)(87936001)(83072002)(85852003)(74662001)(102836001)(31966008)(77982001)(50466002)(76482001)(81342001)(33646001)(81542001)(47776003)(105606002)(19580395003)(19580405001)(68736004)(42262001); DIR:OUT; SFP:; SCL:1; SRVR:DM2PR03MB349; H:tx30smr01.am.freescale.net; FPR:; MLV:ovrnspm; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Antispam: BL:0; ACTION:Default; RISK:Low; SCL:0; SPMLVL:NotSpam; PCL:0; RULEID: X-Forefront-PRVS: 025100C802 Received-SPF: Fail (: domain of freescale.com does not designate 192.88.168.50 as permitted sender) receiver=; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=Anson.Huang@freescale.com; X-OriginatorOrg: freescale.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140622_211236_960040_B61B1951 X-CRM114-Status: UNSURE ( 8.92 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [207.46.163.141 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [207.46.163.141 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record Cc: linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org Add cpufreq support for i.MX6SX, using common i.MX6Q cpufreq driver. Signed-off-by: Anson Huang --- arch/arm/mach-imx/mach-imx6sx.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/arch/arm/mach-imx/mach-imx6sx.c b/arch/arm/mach-imx/mach-imx6sx.c index 74ff7d6..be2ca52 100644 --- a/arch/arm/mach-imx/mach-imx6sx.c +++ b/arch/arm/mach-imx/mach-imx6sx.c @@ -8,6 +8,7 @@ #include #include +#include #include #include @@ -39,9 +40,35 @@ static void __init imx6sx_init_irq(void) irqchip_init(); } +static void __init imx6sx_opp_init(struct device *cpu_dev) +{ + struct device_node *np; + + np = of_find_node_by_path("/cpus/cpu@0"); + if (!np) { + pr_warn("failed to find cpu0 node\n"); + return; + } + + cpu_dev->of_node = np; + if (of_init_opp_table(cpu_dev)) + pr_warn("failed to init OPP table\n"); + + of_node_put(np); +} + +static struct platform_device imx6sx_cpufreq_pdev = { + .name = "imx6q-cpufreq", +}; + static void __init imx6sx_init_late(void) { imx6q_cpuidle_init(); + + if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ)) { + imx6sx_opp_init(&imx6sx_cpufreq_pdev.dev); + platform_device_register(&imx6sx_cpufreq_pdev); + } } static const char *imx6sx_dt_compat[] __initconst = {