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: 6668011 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id AA6089F399 for ; Wed, 24 Jun 2015 14:01:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E348F206E0 for ; Wed, 24 Jun 2015 14:01:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C2F11206E3 for ; Wed, 24 Jun 2015 14:00:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753412AbbFXOAj (ORCPT ); Wed, 24 Jun 2015 10:00:39 -0400 Received: from mail-wg0-f50.google.com ([74.125.82.50]:34296 "EHLO mail-wg0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752796AbbFXN7Z (ORCPT ); Wed, 24 Jun 2015 09:59:25 -0400 Received: by wgqq4 with SMTP id q4so37160952wgq.1 for ; Wed, 24 Jun 2015 06:59:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=uctJyCcib69Jt+NegMqqJqWCxc/pX3dN0QmeqmrH07o=; b=IQx1m6dqGRw75PJuAd1GDmPJ4cM2uCDfX1+Ez2cv+rtbqelfDM6DEg/TdOwygEKdH9 uLM1CKT6L0/sdXXXquh4tJD9LHwkyV9dRuwPyNUC0mHLnzi+5noIQG+sLeniqKIsZUFx FF23U1XSj2P/AtdJOhtbegY1tlLUeWBh66fvHm+byKCMaEdZFWzNpXS9ACOwvuu4vfKj SN7JiZCV9MJtAfxIgLLhcbHblBkMwy+lJ7fWbKFtLH5Hd4n+hghF6T7wozbLudpAlcTt bcalul2NJ5C/3R93WO7fz3+dD3qbVPdlNKq6Ttbyl/3z5bEfIC08bZmD6FkwRvmiD0q3 BWOw== X-Gm-Message-State: ALoCoQk9S6o9JAlMaXqu3MzHz7KTADu0Acam87GPHitS5DWXlirhREraOvg1wKmGgBrmzuVfzHlk 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: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 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