From patchwork Fri Mar 14 19:25:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Gerlach X-Patchwork-Id: 3834731 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4C818BF540 for ; Fri, 14 Mar 2014 19:26:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 599902034E for ; Fri, 14 Mar 2014 19:26:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8E65320340 for ; Fri, 14 Mar 2014 19:26:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755969AbaCNT0f (ORCPT ); Fri, 14 Mar 2014 15:26:35 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:45271 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755962AbaCNT0d (ORCPT ); Fri, 14 Mar 2014 15:26:33 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id s2EJPs7Z023835; Fri, 14 Mar 2014 14:25:54 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id s2EJPsan018270; Fri, 14 Mar 2014 14:25:54 -0500 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.174.1; Fri, 14 Mar 2014 14:25:53 -0500 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id s2EJPsYC010176; Fri, 14 Mar 2014 14:25:54 -0500 Received: from localhost (lta0274052.am.dhcp.ti.com [128.247.71.78]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id s2EJPst18982; Fri, 14 Mar 2014 14:25:54 -0500 (CDT) From: Dave Gerlach To: , , CC: , , , "Rafael J. Wysocki" , Jisheng Zhang , Anson Huang , Shawn Guo , Viresh Kumar , Nishanth Menon , Dave Gerlach Subject: [RFC 3/9] PM / OPP: Add hook to modify OPPs after they are loaded. Date: Fri, 14 Mar 2014 14:25:29 -0500 Message-ID: <1394825135-60110-4-git-send-email-d-gerlach@ti.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1394825135-60110-1-git-send-email-d-gerlach@ti.com> References: <1394825135-60110-1-git-send-email-d-gerlach@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@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 Add a hook inside opp_init_cpufreq_table to allow all cpufreq drivers to utilize OPP modifier functionality. Hook will return success if no phandle is present for devices that do not use opp-modifier. Signed-off-by: Dave Gerlach --- drivers/base/power/opp.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c index fa41874..eaedc6b 100644 --- a/drivers/base/power/opp.c +++ b/drivers/base/power/opp.c @@ -24,6 +24,7 @@ #include #include #include +#include /* * Internal data structure organization with the OPP layer library is as @@ -629,6 +630,13 @@ int dev_pm_opp_init_cpufreq_table(struct device *dev, struct dev_pm_opp *opp; struct cpufreq_frequency_table *freq_table; int i = 0; + int ret; + + ret = opp_modify_dev_table(dev); + if (ret) { + pr_err("failed to modify OPP table: %d\n", ret); + return ret; + } /* Pretend as if I am an updater */ mutex_lock(&dev_opp_list_lock);