From patchwork Wed Mar 9 19:18:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 8549201 X-Patchwork-Delegate: horms@verge.net.au Return-Path: X-Original-To: patchwork-linux-renesas-soc@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 C70B9C0553 for ; Wed, 9 Mar 2016 19:19:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 35078202A1 for ; Wed, 9 Mar 2016 19:19:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7EAE82021A for ; Wed, 9 Mar 2016 19:19:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933778AbcCITT0 (ORCPT ); Wed, 9 Mar 2016 14:19:26 -0500 Received: from michel.telenet-ops.be ([195.130.137.88]:43081 "EHLO michel.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934045AbcCITSv (ORCPT ); Wed, 9 Mar 2016 14:18:51 -0500 Received: from ayla.of.borg ([84.195.106.123]) by michel.telenet-ops.be with bizsmtp id TvJo1s00B2fm56U06vJoGu; Wed, 09 Mar 2016 20:18:50 +0100 Received: from ramsan.of.borg ([192.168.97.29] helo=ramsan) by ayla.of.borg with esmtp (Exim 4.82) (envelope-from ) id 1adjdA-00062r-3r; Wed, 09 Mar 2016 20:18:48 +0100 Received: from geert by ramsan with local (Exim 4.82) (envelope-from ) id 1adjdA-0005j9-Qd; Wed, 09 Mar 2016 20:18:48 +0100 From: Geert Uytterhoeven To: Simon Horman , Magnus Damm , "Rafael J. Wysocki" , Kevin Hilman , Ulf Hansson Cc: Laurent Pinchart , linux-pm@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Geert Uytterhoeven , Michael Turquette , Stephen Boyd Subject: [PATCH v3 05/11] soc: renesas: rcar-sysc: Enable Clock Domain for r8a7795 I/O devices Date: Wed, 9 Mar 2016 20:18:41 +0100 Message-Id: <1457551127-21934-6-git-send-email-geert+renesas@glider.be> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1457551127-21934-1-git-send-email-geert+renesas@glider.be> References: <1457551127-21934-1-git-send-email-geert+renesas@glider.be> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 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 On R-Car H3, some power areas (e.g. A3VP) contain I/O devices, which are also part of the CPG/MSSR Clock Domain. Hook up the CPG/MSSR Clock Domain attach/detach callbacks to enable power management using module clocks. This also allows to support the Clock Domain for devices in the "always-on" power area. Signed-off-by: Geert Uytterhoeven Cc: Michael Turquette Cc: Stephen Boyd --- v3: - Hook up the CPG/MSSR Clock Domain attach/detach callbacks instead of using our own copies, v2: - New. --- drivers/soc/renesas/rcar-sysc.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/soc/renesas/rcar-sysc.c b/drivers/soc/renesas/rcar-sysc.c index 28af0b704fc008d2..2d6fbeb481883be7 100644 --- a/drivers/soc/renesas/rcar-sysc.c +++ b/drivers/soc/renesas/rcar-sysc.c @@ -9,6 +9,7 @@ * for more details. */ +#include #include #include #include @@ -251,6 +252,15 @@ static void __init rcar_sysc_pd_setup(struct device_node *np, gov = &pm_domain_always_on_gov; } +#ifdef CONFIG_ARCH_R8A7795 + if (!(pd->flags & (PD_CPU | PD_SCU))) { + /* Enable Clock Domain for I/O devices */ + genpd->flags = GENPD_FLAG_PM_CLK; + genpd->attach_dev = cpg_mssr_attach_dev; + genpd->detach_dev = cpg_mssr_detach_dev; + } +#endif + pm_genpd_init(genpd, gov, false); genpd->dev_ops.active_wakeup = rcar_sysc_active_wakeup; genpd->power_off = rcar_sysc_pd_power_off;