From patchwork Tue Dec 17 01:40:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Tobias X-Patchwork-Id: 3358211 Return-Path: X-Original-To: patchwork-linux-mmc@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 6D3BF9F380 for ; Tue, 17 Dec 2013 01:40:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 79B02202E5 for ; Tue, 17 Dec 2013 01:40:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A0312202DD for ; Tue, 17 Dec 2013 01:40:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752009Ab3LQBkT (ORCPT ); Mon, 16 Dec 2013 20:40:19 -0500 Received: from mail-oa0-f43.google.com ([209.85.219.43]:33314 "EHLO mail-oa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751019Ab3LQBkS (ORCPT ); Mon, 16 Dec 2013 20:40:18 -0500 Received: by mail-oa0-f43.google.com with SMTP id i7so5947236oag.30 for ; Mon, 16 Dec 2013 17:40:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=JbakX4NyJb4RzITS5sPig7gZ9gCT6Mez8Za7zAfb8vc=; b=s5vtHIXt026dGaR633q9kUt/7GfA5OGvFkI6VxuzhDOgTbYsR8ZCXraZWkmbJMYOjX E+K22PiCZ8eAL43notTpIYGk2o36GN4xMjFySV6kwqqL+tcFkOfhMf9yoBKKkz+fMqtT GzU6GJJvo6ZYQIUBAGwLhUdV5wIJgwXVHVQtADyFCTSy5/bS97umazZ3dlFxohsIcTud 7ycEe0GAdXRZ550jltPFVoOSEJRN6KpGXLSHjJZgpUl/f2iYDczV/lS9Iw8alLt2FLsO jG/4OajuWEl991mOWnD+Kjgm3cxiNEslY9OZPZO5V6r/xtfXRhvc1jVnfJna8Jpk+kO+ UK4w== MIME-Version: 1.0 X-Received: by 10.182.112.130 with SMTP id iq2mr8914503obb.57.1387244418355; Mon, 16 Dec 2013 17:40:18 -0800 (PST) Received: by 10.60.36.166 with HTTP; Mon, 16 Dec 2013 17:40:18 -0800 (PST) Date: Mon, 16 Dec 2013 17:40:18 -0800 Message-ID: Subject: [PATCH 2/3]: Support cpu frequency scaling and power management for iMX6SL From: John Tobias To: linux-arm-kernel@lists.infradead.org, linux-mmc@vger.kernel.org, Shawn Guo , Fabio Estevam , Chris Ball Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@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 iMX6SL re-using iMX6Q driver in order to enable the cpu frequency scaling and power management From: John Tobias MACHINE_END --- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/mach-imx/mach-imx6sl.c b/arch/arm/mach-imx/mach-imx6sl.c index 2f952e3..e66eccf 100644 --- a/arch/arm/mach-imx/mach-imx6sl.c +++ b/arch/arm/mach-imx/mach-imx6sl.c @@ -9,7 +9,10 @@ #include #include +#include +#include #include +#include #include #include #include @@ -17,6 +20,7 @@ #include #include "common.h" +#include "cpuidle.h" static void __init imx6sl_fec_init(void) { @@ -34,6 +38,47 @@ static void __init imx6sl_fec_init(void) } } + +static void __init imx6sl_opp_init(void) +{ + struct device_node *np; + struct device *cpu_dev = get_cpu_device(0); + + if (!cpu_dev) { + pr_warn("failed to get cpu0 device\n"); + return; + } + np = of_node_get(cpu_dev->of_node); + if (!np) { + pr_warn("failed to find cpu0 node\n"); + return; + } + + if (of_init_opp_table(cpu_dev)) { + pr_warn("failed to init OPP table\n"); + goto put_node; + } + +put_node: + of_node_put(np); +} + +static struct platform_device imx6q_cpufreq_pdev = { + .name = "imx6q-cpufreq", +}; + + +static void __init imx6sl_init_late(void) +{ + /* re-use imx6q */ + imx6q_cpuidle_init(); + + if (IS_ENABLED(CONFIG_ARM_IMX6SQ_CPUFREQ)) { + imx6sl_opp_init(); + platform_device_register(&imx6q_cpufreq_pdev); + } +} + static void __init imx6sl_init_machine(void) { struct device *parent; @@ -70,6 +115,7 @@ DT_MACHINE_START(IMX6SL, "Freescale i.MX6 SoloLite (Device Tree)") .map_io = debug_ll_io_init, .init_irq = imx6sl_init_irq, .init_machine = imx6sl_init_machine, + .init_late = imx6sl_init_late, .dt_compat = imx6sl_dt_compat, .restart = mxc_restart,