From patchwork Tue Mar 17 09:36:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 6029541 Return-Path: X-Original-To: patchwork-linux-pm@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 D47769FB24 for ; Tue, 17 Mar 2015 09:40:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0EF1320035 for ; Tue, 17 Mar 2015 09:40:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8250D20461 for ; Tue, 17 Mar 2015 09:40:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932186AbbCQJjj (ORCPT ); Tue, 17 Mar 2015 05:39:39 -0400 Received: from mail-wg0-f49.google.com ([74.125.82.49]:32848 "EHLO mail-wg0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932230AbbCQJhX (ORCPT ); Tue, 17 Mar 2015 05:37:23 -0400 Received: by wgbcc7 with SMTP id cc7so3532420wgb.0; Tue, 17 Mar 2015 02:37:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=RJ4CGx4Oo4s/ePhV/Hr4JT875TWZhYyP7290LWxQqCc=; b=W/TPXD8tuIj9f/nbtqrPEc2q5oFd2B/Kijit2YfQ00utVY3O+yQDsHHnfp2IpTIATw 7H1V2Bpflcb3kcDvees60c8o6oeWu9QG8qjQkQ9SINbbRUifeGo1huDHggIdWQFqGItO xnZh3WK4Svvi4IeWLrigHMaXVH+RyYdlI7Eypw9jq4oOCC3PEUkaTWfcU7ZH/jlFYZDI 9QDqrWeyaI6Jr8lg/3QqcFyCULYehIHKrvlyi0qFLvuftfNy+bNiCgpXCtiy7pdSgh7V XTfHINoSRMmKPvisppXfcrPAbBWEKXOAcXFWzCrtbBsfi+bvHb1Fu0+TT5X9ivkq8D6w 2gnA== X-Received: by 10.194.75.193 with SMTP id e1mr127238880wjw.126.1426585041612; Tue, 17 Mar 2015 02:37:21 -0700 (PDT) Received: from cizrna.lan ([109.72.12.78]) by mx.google.com with ESMTPSA id q10sm19113700wjr.41.2015.03.17.02.37.19 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Mar 2015 02:37:20 -0700 (PDT) From: Tomeu Vizoso To: linux-tegra@vger.kernel.org Cc: Mikko Perttunen , Tomeu Vizoso , MyungJoo Ham , Kyungmin Park , Stephen Warren , Thierry Reding , Alexandre Courbot , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v6 5/8] PM / devfreq: tegra: remove operating-points Date: Tue, 17 Mar 2015 10:36:15 +0100 Message-Id: <1426584991-11110-6-git-send-email-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1426584991-11110-1-git-send-email-tomeu.vizoso@collabora.com> References: <1426584991-11110-1-git-send-email-tomeu.vizoso@collabora.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,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 As the DT bindings don't have an operating-points property any more, build the OPP table from the frequencies supported by the EMC clock. Signed-off-by: Tomeu Vizoso --- drivers/devfreq/tegra-devfreq.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/devfreq/tegra-devfreq.c b/drivers/devfreq/tegra-devfreq.c index 5a6164c..1de3f8b 100644 --- a/drivers/devfreq/tegra-devfreq.c +++ b/drivers/devfreq/tegra-devfreq.c @@ -618,6 +618,7 @@ static int tegra_devfreq_probe(struct platform_device *pdev) struct tegra_devfreq_device *dev; struct resource *res; unsigned int i; + unsigned long rate; int irq; int err; @@ -649,12 +650,6 @@ static int tegra_devfreq_probe(struct platform_device *pdev) return PTR_ERR(tegra->emc_clock); } - err = of_init_opp_table(&pdev->dev); - if (err) { - dev_err(&pdev->dev, "Failed to init operating point table\n"); - return err; - } - clk_set_rate(tegra->emc_clock, ULONG_MAX); tegra->rate_change_nb.notifier_call = tegra_actmon_rate_notify_cb; @@ -691,6 +686,11 @@ static int tegra_devfreq_probe(struct platform_device *pdev) tegra_actmon_configure_device(tegra, dev); } + for (rate = 0; rate <= tegra->max_freq * KHZ; rate++) { + rate = clk_round_rate(tegra->emc_clock, rate); + dev_pm_opp_add(&pdev->dev, rate, 0); + } + irq = platform_get_irq(pdev, 0); if (irq <= 0) { dev_err(&pdev->dev, "Failed to get IRQ\n");