From patchwork Wed Jun 24 13:59:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 50275 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E283221575 for ; Wed, 24 Jun 2015 14:01:02 +0000 (UTC) Received: by laar3 with SMTP id r3sf11378274laa.1 for ; Wed, 24 Jun 2015 07:01:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=OYHRhAWbHcfOjLm7LO+MGbZCUTMaXwywGTadTLaOnI0=; b=dua3xxFmNXcyZGC+WsYKroonTPmDfCU4uDGBUZZQ3/VSUg6UQNw0djwXOZ9NNzzCO6 6aEY4BTifgB+Ymg4dMJO985GlHrJmyy6mGfOU5KQU5BuFosxurTV4lys6ETy1IJb8IHE gw3GxJBOHYN00t4c23QKWlBGmAdPgek2NReaBml/Cg4kGD5F1eBsags1SDK0R4MfP0Wj DJbtph2hEyE2qeRlJdrpGsDZTdx2kkMUcR04zFGBCWJ58L0+T/azklg3Klns/gTh/4Tj jYqtnY8moaYNkSw29v58WTUxEdxsJEmECiddPW4gWVSuTghBPWK3Cvwgyk6EQ7C+V5pY tnJw== X-Gm-Message-State: ALoCoQmIdKCWamc1GB9YCNyWqJDNDFUd66LECM0mcLlTX1DhKe0C/1q2h7OECMIVBuN/keDGNrCo X-Received: by 10.152.26.134 with SMTP id l6mr36106154lag.10.1435154461843; Wed, 24 Jun 2015 07:01:01 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.87.198 with SMTP id ba6ls209414lab.40.gmail; Wed, 24 Jun 2015 07:01:01 -0700 (PDT) X-Received: by 10.112.50.66 with SMTP id a2mr32015477lbo.68.1435154461696; Wed, 24 Jun 2015 07:01:01 -0700 (PDT) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id p2si22090108lap.109.2015.06.24.07.01.01 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Jun 2015 07:01:01 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by lagx9 with SMTP id x9so26644544lag.1 for ; Wed, 24 Jun 2015 07:01:01 -0700 (PDT) X-Received: by 10.152.42.177 with SMTP id p17mr18692768lal.29.1435154461587; Wed, 24 Jun 2015 07:01:01 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp3810150lbb; Wed, 24 Jun 2015 07:01:00 -0700 (PDT) X-Received: by 10.70.54.196 with SMTP id l4mr79650199pdp.2.1435154443776; Wed, 24 Jun 2015 07:00:43 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x7si13153938pdl.233.2015.06.24.07.00.42; Wed, 24 Jun 2015 07:00:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753374AbbFXOAf (ORCPT + 8 others); Wed, 24 Jun 2015 10:00:35 -0400 Received: from mail-wi0-f170.google.com ([209.85.212.170]:34979 "EHLO mail-wi0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752802AbbFXN7Z (ORCPT ); Wed, 24 Jun 2015 09:59:25 -0400 Received: by wiga1 with SMTP id a1so136611253wig.0 for ; Wed, 24 Jun 2015 06:59:24 -0700 (PDT) X-Received: by 10.194.179.10 with SMTP id dc10mr59110776wjc.63.1435154364335; Wed, 24 Jun 2015 06:59:24 -0700 (PDT) Received: from localhost.localdomain (host81-129-169-163.range81-129.btcentralplus.com. [81.129.169.163]) by mx.google.com with ESMTPSA id q2sm40833925wjz.15.2015.06.24.06.59.22 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 24 Jun 2015 06:59:23 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: kernel@stlinux.com, rjw@rjwysocki.net, viresh.kumar@linaro.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, ajitpal.singh@st.com, Lee Jones Subject: [PATCH v2 5/9] ARM: STi: Register CPUFreq device Date: Wed, 24 Jun 2015 14:59:04 +0100 Message-Id: <1435154348-28840-6-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1435154348-28840-1-git-send-email-lee.jones@linaro.org> References: <1435154348-28840-1-git-send-email-lee.jones@linaro.org> Sender: devicetree-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: devicetree@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , DT will not allow pseudo-devices. Only devices which represent real hardware are permitted. So we have to register the CPUFreq driver from platform code instead. Rather than create a new file, we're bundling this in with the SMP functionality and renaming it from 'smp' to the more generic 'cpu'. Signed-off-by: Lee Jones --- arch/arm/mach-sti/Makefile | 2 +- arch/arm/mach-sti/board-dt.c | 3 ++- arch/arm/mach-sti/{platsmp.c => cpu.c} | 17 +++++++++++++++-- arch/arm/mach-sti/{smp.h => cpu.h} | 2 ++ 4 files changed, 20 insertions(+), 4 deletions(-) rename arch/arm/mach-sti/{platsmp.c => cpu.c} (91%) rename arch/arm/mach-sti/{smp.h => cpu.h} (92%) diff --git a/arch/arm/mach-sti/Makefile b/arch/arm/mach-sti/Makefile index acb3309..caaeeaa 100644 --- a/arch/arm/mach-sti/Makefile +++ b/arch/arm/mach-sti/Makefile @@ -1,2 +1,2 @@ -obj-$(CONFIG_SMP) += platsmp.o headsmp.o +obj-$(CONFIG_SMP) += cpu.o headsmp.o obj-$(CONFIG_ARCH_STI) += board-dt.o diff --git a/arch/arm/mach-sti/board-dt.c b/arch/arm/mach-sti/board-dt.c index b373aca..482159f 100644 --- a/arch/arm/mach-sti/board-dt.c +++ b/arch/arm/mach-sti/board-dt.c @@ -12,7 +12,7 @@ #include #include -#include "smp.h" +#include "cpu.h" static const char *stih41x_dt_match[] __initdata = { "st,stih415", @@ -31,4 +31,5 @@ DT_MACHINE_START(STM, "STiH415/416 SoC with Flattened Device Tree") L2C_AUX_CTRL_WAY_SIZE(4), .l2c_aux_mask = 0xc0000fff, .smp = smp_ops(sti_smp_ops), + .init_late = init_cpufreq, MACHINE_END diff --git a/arch/arm/mach-sti/platsmp.c b/arch/arm/mach-sti/cpu.c similarity index 91% rename from arch/arm/mach-sti/platsmp.c rename to arch/arm/mach-sti/cpu.c index d4b624f..283cb30 100644 --- a/arch/arm/mach-sti/platsmp.c +++ b/arch/arm/mach-sti/cpu.c @@ -1,5 +1,5 @@ /* - * arch/arm/mach-sti/platsmp.c + * arch/arm/mach-sti/cpu.c * * Copyright (C) 2013 STMicroelectronics (R&D) Limited. * http://www.st.com @@ -13,6 +13,7 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ + #include #include #include @@ -20,13 +21,17 @@ #include #include #include +#include #include #include #include -#include "smp.h" +#include "cpu.h" +/** + * SMP Operations + */ static void write_pen_release(int val) { pen_release = val; @@ -114,3 +119,11 @@ struct smp_operations __initdata sti_smp_ops = { .smp_secondary_init = sti_secondary_init, .smp_boot_secondary = sti_boot_secondary, }; + +/** + * CPUFreq Registration + */ +void init_cpufreq(void) +{ + platform_device_register_simple("sti-cpufreq", -1, NULL, 0); +} diff --git a/arch/arm/mach-sti/smp.h b/arch/arm/mach-sti/cpu.h similarity index 92% rename from arch/arm/mach-sti/smp.h rename to arch/arm/mach-sti/cpu.h index 1871b72..39e05ff 100644 --- a/arch/arm/mach-sti/smp.h +++ b/arch/arm/mach-sti/cpu.h @@ -14,4 +14,6 @@ extern struct smp_operations sti_smp_ops; +extern void init_cpufreq(void); + #endif