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: 4399251 Return-Path: X-Original-To: patchwork-linux-arm@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 D1437BEEAA for ; Mon, 23 Jun 2014 04:14:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DD68420268 for ; Mon, 23 Jun 2014 04:14:43 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6D3D02022A for ; Mon, 23 Jun 2014 04:14:42 +0000 (UTC) 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 (/) 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-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 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 = {