From patchwork Fri Apr 5 10:00:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 2397471 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 9B520DF2E5 for ; Fri, 5 Apr 2013 10:00:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754158Ab3DEKAt (ORCPT ); Fri, 5 Apr 2013 06:00:49 -0400 Received: from moutng.kundenserver.de ([212.227.17.9]:52043 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752035Ab3DEKAs (ORCPT ); Fri, 5 Apr 2013 06:00:48 -0400 Received: from axis700.grange (dslb-094-221-122-203.pools.arcor-ip.net [94.221.122.203]) by mrelayeu.kundenserver.de (node=mrbap3) with ESMTP (Nemesis) id 0MNLx3-1UHkze0wwb-006sGp; Fri, 05 Apr 2013 12:00:39 +0200 Received: from 6a.grange (6a.grange [192.168.1.11]) by axis700.grange (Postfix) with ESMTPS id C246540BB5; Fri, 5 Apr 2013 12:00:38 +0200 (CEST) Received: from lyakh by 6a.grange with local (Exim 4.72) (envelope-from ) id 1UO3Rm-0003Fj-H0; Fri, 05 Apr 2013 12:00:38 +0200 From: Guennadi Liakhovetski To: linux-sh@vger.kernel.org Cc: Magnus Damm , Simon Horman , linux-arm-kernel@lists.infradead.org, "Rafael J. Wysocki" , cpufreq@vger.kernel.org, Guennadi Liakhovetski Subject: [PATCH v5 3/3] ARM: shmobile: sh73a0: add CPUFreq support Date: Fri, 5 Apr 2013 12:00:38 +0200 Message-Id: <1365156038-12467-4-git-send-email-g.liakhovetski@gmx.de> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1365156038-12467-1-git-send-email-g.liakhovetski@gmx.de> References: <1365156038-12467-1-git-send-email-g.liakhovetski@gmx.de> X-Provags-ID: V02:K0:aa5BYX/4EVeD0Qmi9YrE+MHN0rE9cuyErXD9cuH7MDM FMqnG+2JsSsccOS/TgV9sS8eFUhiWG1sM/Ch2njCJHHY2bvwvY NA6hsxHosOm7Z4oEntfQ6RtpVu7bXDRpAJfbXqCzmdUQC1OXm6 Awci9sXqYnRLscVTFwIIkZGaqV+HSxkkkyoX0HzhDwXLYjV4zG grKFlYcHnXMuQGGg0/n+lnwuRUTn5DY6DoZ2ntmcfANa417EMv Hd/5MMhQKfDPMpaaRJTUnAFJJt5i4iv5oCKp9BS9nJzdaZgrl7 vRv4zl/+txzoTWVYDKNpJ7Nfs01NdbbOunDX61uExc6UxfZZtb i6rGaeE6D0IFUpwvH2NTkaqanHeyp6NlK09+gAtwbzH/MhaDO9 x0FcW09Chv3mQ== Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org This patch enables the use of the generic cpufreq-cpu0 driver on sh73a0. Providing a regulator, a list of OPPs in DT, combined with a virtual cpufreq-cpu0 platform device and a clock, attached to it is everything, the cpufreq-cpu0 driver needs. The first sh73a0 platform, implementing such CPUFreq support is kzm9g-reference. Signed-off-by: Guennadi Liakhovetski --- v5: remove sh73a0-kzm9g-reference.dts hunk, it's now merged into patch 2/3 arch/arm/mach-shmobile/Kconfig | 2 ++ arch/arm/mach-shmobile/setup-sh73a0.c | 5 +++++ 2 files changed, 7 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig index 1a517e2..4ac5bf9 100644 --- a/arch/arm/mach-shmobile/Kconfig +++ b/arch/arm/mach-shmobile/Kconfig @@ -177,6 +177,8 @@ config MACH_KZM9G config MACH_KZM9G_REFERENCE bool "KZM-A9-GT board - Reference Device Tree Implementation" depends on ARCH_SH73A0 + select ARCH_HAS_CPUFREQ + select ARCH_HAS_OPP select ARCH_REQUIRE_GPIOLIB select REGULATOR_FIXED_VOLTAGE if REGULATOR select SND_SOC_AK4642 if SND_SIMPLE_CARD diff --git a/arch/arm/mach-shmobile/setup-sh73a0.c b/arch/arm/mach-shmobile/setup-sh73a0.c index d10ded0..9a522f9 100644 --- a/arch/arm/mach-shmobile/setup-sh73a0.c +++ b/arch/arm/mach-shmobile/setup-sh73a0.c @@ -1003,6 +1003,8 @@ static const struct of_dev_auxdata sh73a0_auxdata_lookup[] __initconst = { void __init sh73a0_add_standard_devices_dt(void) { + struct platform_device_info devinfo = { .name = "cpufreq-cpu0", .id = -1, }; + /* clocks are setup late during boot in the case of DT */ sh73a0_clock_init(); @@ -1010,6 +1012,9 @@ void __init sh73a0_add_standard_devices_dt(void) ARRAY_SIZE(sh73a0_devices_dt)); of_platform_populate(NULL, of_default_bus_match_table, sh73a0_auxdata_lookup, NULL); + + /* Instantiate cpufreq-cpu0 */ + platform_device_register_full(&devinfo); } static const char *sh73a0_boards_compat_dt[] __initdata = {