From patchwork Mon Apr 27 12:43:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 6279881 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-sh@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 7DED19F398 for ; Mon, 27 Apr 2015 12:43:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9D1302047D for ; Mon, 27 Apr 2015 12:43:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B0E4E20495 for ; Mon, 27 Apr 2015 12:43:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932739AbbD0Mnz (ORCPT ); Mon, 27 Apr 2015 08:43:55 -0400 Received: from baptiste.telenet-ops.be ([195.130.132.51]:56559 "EHLO baptiste.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932558AbbD0Mnx (ORCPT ); Mon, 27 Apr 2015 08:43:53 -0400 Received: from ayla.of.borg ([84.193.93.87]) by baptiste.telenet-ops.be with bizsmtp id M0jr1q00Y1t5w8s010jrE5; Mon, 27 Apr 2015 14:43: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 1YmiO7-00006s-CF; Mon, 27 Apr 2015 14:43:51 +0200 Received: from geert by ramsan with local (Exim 4.82) (envelope-from ) id 1YmiO8-0003fZ-2p; Mon, 27 Apr 2015 14:43:52 +0200 From: Geert Uytterhoeven To: "Rafael J. Wysocki" , Kevin Hilman , Ulf Hansson , Axel Haslam Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH/RFC v6 6/7] PM / Domains: Retrieve PM QoS device latencies from DT Date: Mon, 27 Apr 2015 14:43:41 +0200 Message-Id: <1430138622-14029-7-git-send-email-geert+renesas@glider.be> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1430138622-14029-1-git-send-email-geert+renesas@glider.be> References: <1430138622-14029-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=ham 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 Signed-off-by: Geert Uytterhoeven --- v6: - Rebased on top of v4.1-rc1 for new RFC, v4: - Drop save/restore state latencies, as they're Linux driver-specific, - Change state to RFC, as this is put on hold, v3: - No changes, v2: - New. --- drivers/base/power/domain.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index d20caa2c92b57edf..da0b9f69919988bb 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -2193,6 +2193,8 @@ int genpd_dev_pm_attach(struct device *dev) struct device_node *np = dev->of_node; struct of_phandle_args pd_args; struct generic_pm_domain *pd; + struct gpd_timing_data td; + u32 latency; int ret; if (!np) @@ -2225,10 +2227,16 @@ int genpd_dev_pm_attach(struct device *dev) return PTR_ERR(pd); } + memset(&td, 0, sizeof(td)); + if (!of_property_read_u32(np, "stop-latency", &latency)) + td.stop_latency_ns = latency; + if (!of_property_read_u32(np, "start-latency", &latency)) + td.start_latency_ns = latency; + dev_dbg(dev, "adding to PM domain %s\n", pd->name); while (1) { - ret = pm_genpd_add_device(pd, dev); + ret = __pm_genpd_add_device(pd, dev, &td); if (ret != -EAGAIN) break; cond_resched();