From patchwork Thu May 28 18:53:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 6500791 X-Patchwork-Delegate: horms@verge.net.au Return-Path: X-Original-To: patchwork-linux-sh@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 89432C0020 for ; Thu, 28 May 2015 18:54:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9FC5F2076F for ; Thu, 28 May 2015 18:54:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0EE3F2076B for ; Thu, 28 May 2015 18:54:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754184AbbE1SyB (ORCPT ); Thu, 28 May 2015 14:54:01 -0400 Received: from xavier.telenet-ops.be ([195.130.132.52]:60776 "EHLO xavier.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754812AbbE1Sxy (ORCPT ); Thu, 28 May 2015 14:53:54 -0400 Received: from ayla.of.borg ([84.193.93.87]) by xavier.telenet-ops.be with bizsmtp id ZWtk1q00E1t5w8s01WtkBk; Thu, 28 May 2015 20:53:51 +0200 Received: from ramsan.of.borg ([192.168.97.29] helo=ramsan) by ayla.of.borg with esmtp (Exim 4.82) (envelope-from ) id 1Yy2w3-0001i7-QF; Thu, 28 May 2015 20:53:43 +0200 Received: from geert by ramsan with local (Exim 4.82) (envelope-from ) id 1Yy2wA-00009e-7P; Thu, 28 May 2015 20:53:50 +0200 From: Geert Uytterhoeven To: Mike Turquette , Stephen Boyd , Simon Horman , Magnus Damm , Laurent Pinchart , "Rafael J. Wysocki" , Kevin Hilman , Ulf Hansson Cc: linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, linux-sh@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v2 14/14] ARM: shmobile: R-Mobile: Use CPG Clock Domain attach/detach helpers Date: Thu, 28 May 2015 20:53:39 +0200 Message-Id: <1432839219-475-15-git-send-email-geert+renesas@glider.be> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1432839219-475-1-git-send-email-geert+renesas@glider.be> References: <1432839219-475-1-git-send-email-geert+renesas@glider.be> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 The R-Mobile PM Domain driver manages both power domains and a clock domain. The clock domain part is very similar to the CPG Clock Domain, which is used on shmobile SoCs without device power domains, except for the way how clocks suitable for power management are selected: - The former uses the first clock tied to the device through the NULL con_id, which is a relic from the legacy pm_clk_notifier-based method in drivers/sh/pm_runtime.c, - The latter looks for suitable clocks in DT, which is more future-proof. Hence switch to using the CPG Clock Domain helpers for DT-based multi-platform builds. The old method, using a NULL con_id, is still used for legacy builds. Signed-off-by: Geert Uytterhoeven --- v2: - New. --- arch/arm/mach-shmobile/pm-rmobile.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/arm/mach-shmobile/pm-rmobile.c b/arch/arm/mach-shmobile/pm-rmobile.c index 747d557b7016ec6d..cac564c5348cd851 100644 --- a/arch/arm/mach-shmobile/pm-rmobile.c +++ b/arch/arm/mach-shmobile/pm-rmobile.c @@ -12,6 +12,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. */ +#include #include #include #include @@ -118,6 +119,7 @@ static bool rmobile_pd_active_wakeup(struct device *dev) return true; } +#ifdef CONFIG_ARCH_SHMOBILE_LEGACY static int rmobile_pd_attach_dev(struct generic_pm_domain *domain, struct device *dev) { @@ -147,6 +149,10 @@ static void rmobile_pd_detach_dev(struct generic_pm_domain *domain, { pm_clk_destroy(dev); } +#else /* CONFIG_ARCH_SHMOBILE_LEGACY */ +#define rmobile_pd_attach_dev cpg_mstp_attach_dev +#define rmobile_pd_detach_dev cpg_mstp_detach_dev +#endif /* CONFIG_ARCH_SHMOBILE_LEGACY */ static void rmobile_init_pm_domain(struct rmobile_pm_domain *rmobile_pd) {