From patchwork Tue Dec 8 14:32:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 7798201 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 75CF9BEEE1 for ; Tue, 8 Dec 2015 14:37:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 86F22202FE for ; Tue, 8 Dec 2015 14:37:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8FBE820515 for ; Tue, 8 Dec 2015 14:37:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756586AbbLHOgc (ORCPT ); Tue, 8 Dec 2015 09:36:32 -0500 Received: from mail-wm0-f46.google.com ([74.125.82.46]:34249 "EHLO mail-wm0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933246AbbLHOeX (ORCPT ); Tue, 8 Dec 2015 09:34:23 -0500 Received: by wmvv187 with SMTP id v187so216293864wmv.1 for ; Tue, 08 Dec 2015 06:34:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=eUSlsMQn+gJYTCN+vgreV4EIIfwv+H16LCXF9/g/gqw=; b=G7FHBDBdg77GsFm1erb1rj8HYBg8AZvyjoVPTs3zn721a7WCyakhqfDTpxmmdkwGi8 U66toPx5ReVB6qF3RFgFGyocfZmKbkJQGvRagmQ/4JHDjrAwe/gpAUCH+CSKv2vTI5sy gVyX1Zck53k7eOW/m9serABbnNUk7cuIbTfu7gUsfo2ems0IOE0L8xWcJ0IkJS//9Mnu oD5NsNoQSnZbUhF24sIz6MShKZ7D6Hk1TjN0Xpc1aUCW8OU7bi/XxUMsAFRaJZV3QF1L H7jzWZUK1tsvMGHQ2kFYgHBZbg03jSQN1r1PUD/P9mLkiK8laX6be0g149h3gwIq2rpV 7BXg== 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=eUSlsMQn+gJYTCN+vgreV4EIIfwv+H16LCXF9/g/gqw=; b=GYdjVKKT8dbqYCqhzJI7lLssoaKRWR7nJDGCROTz7iqjPemzRn/GE9N6z6e//IwLyI 9JBjZbcnXviTcmYH2WeMZjbCzxat1I1PJllFmssgo/5eq88ww0OmZoiuZ5f3TtxgKagE 1gaE4KzgLCFcqsl3YPcQtc6a17xi4JBO5ZkpTvLf1MGlOxjEWs0QMJgQKUffYN0d0Dyy QJQal0buArrayHcEERYNcw0w3CfLaWxjUcPFfHmJvnwgDUiDW8wl5+RRtoXb3IZyPOLD KFfQpIT2gUzpoX4UrswCZWJ2zw6QF4IPX9Nr960KfTmgn2Pvkkei6GcqoreadplcqnLY ahIQ== X-Gm-Message-State: ALoCoQnimfBJ82ffuyj7uvDHh3fj2xA0Tuf/9HVrGv/IVwzQywFEWzjj/Qz9whGi+Kq34fNT6rnuEooE8M076bCSmcBxVGS4Hg== X-Received: by 10.28.210.74 with SMTP id j71mr4730413wmg.96.1449585262247; Tue, 08 Dec 2015 06:34:22 -0800 (PST) Received: from localhost.localdomain (host81-129-169-67.range81-129.btcentralplus.com. [81.129.169.67]) by smtp.gmail.com with ESMTPSA id q6sm21710438wmd.8.2015.12.08.06.34.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 08 Dec 2015 06:34:21 -0800 (PST) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: kernel@stlinux.com, maxime.coquelin@st.com, viresh.kumar@linaro.org, linux-pm@vger.kernel.org, rjw@rjwysocki.net, devicetree@vger.kernel.org, ajitpal.singh@st.com, Lee Jones Subject: [PATCH v5 08/11] ARM: STi: Register CPUFreq device Date: Tue, 8 Dec 2015 14:32:01 +0000 Message-Id: <1449585124-15596-9-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1449585124-15596-1-git-send-email-lee.jones@linaro.org> References: <1449585124-15596-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=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,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 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} | 1 + 4 files changed, 19 insertions(+), 4 deletions(-) rename arch/arm/mach-sti/{platsmp.c => cpu.c} (93%) rename arch/arm/mach-sti/{smp.h => cpu.h} (93%) 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 ae10fb2..60b23a7 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 *const stih41x_dt_match[] __initconst = { "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 93% rename from arch/arm/mach-sti/platsmp.c rename to arch/arm/mach-sti/cpu.c index c4ad6ea..335ecaf 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 @@ -21,13 +22,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; @@ -161,3 +166,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 93% rename from arch/arm/mach-sti/smp.h rename to arch/arm/mach-sti/cpu.h index ae22707..957c4d1 100644 --- a/arch/arm/mach-sti/smp.h +++ b/arch/arm/mach-sti/cpu.h @@ -15,5 +15,6 @@ extern struct smp_operations sti_smp_ops; void sti_secondary_startup(void); +extern void init_cpufreq(void); #endif