public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Omar Ramirez Luna <omar.ramirez@ti.com>
To: linux-omap <linux-omap@vger.kernel.org>
Cc: Ameya Palande <ameya.palande@nokia.com>,
	Hiroshi Doyu <Hiroshi.DOYU@nokia.com>,
	Felipe Contreras <felipe.contreras@nokia.com>,
	Nishanth Menon <nm@ti.com>,
	Fernando Guzman Lugo <x0095840@ti.com>
Subject: [PATCH 2/3] DSPBRIDGE: change to cpufreq_register_notifier for OPP changes
Date: Fri, 15 Jan 2010 20:01:46 -0600	[thread overview]
Message-ID: <1263607307-21693-3-git-send-email-omar.ramirez@ti.com> (raw)
In-Reply-To: <1263607307-21693-2-git-send-email-omar.ramirez@ti.com>

From: Fernando Guzman Lugo <x0095840@ti.com>

This patch changes clk_notifier_unregister with
cpufreq_unregister_notifier, which is used for OPP change
notifications

Signed-off-by: Fernando Guzman Lugo <x0095840@ti.com>
---
 drivers/dsp/bridge/Kconfig              |    2 +-
 drivers/dsp/bridge/rmgr/drv_interface.c |   25 +++++++++++++++----------
 2 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/drivers/dsp/bridge/Kconfig b/drivers/dsp/bridge/Kconfig
index e494f02..ea639e3 100644
--- a/drivers/dsp/bridge/Kconfig
+++ b/drivers/dsp/bridge/Kconfig
@@ -13,7 +13,7 @@ menuconfig MPU_BRIDGE
 
 config BRIDGE_DVFS
 	bool "Enable Bridge Dynamic Voltage and Frequency Scaling (DVFS)"
-	depends on MPU_BRIDGE && OMAP_PM_SRF
+	depends on MPU_BRIDGE && OMAP_PM_SRF && CPU_FREQ
 	default n
 	help
 	  DVFS allows DSP Bridge to initiate the operating point change to
diff --git a/drivers/dsp/bridge/rmgr/drv_interface.c b/drivers/dsp/bridge/rmgr/drv_interface.c
index 8fce70c..19682b5 100644
--- a/drivers/dsp/bridge/rmgr/drv_interface.c
+++ b/drivers/dsp/bridge/rmgr/drv_interface.c
@@ -236,15 +236,18 @@ u32 vdd1_dsp_freq[6][4] = {
 };
 
 #ifdef CONFIG_BRIDGE_DVFS
-static int dspbridge_post_scale(struct notifier_block *op, unsigned long level,
-				void *ptr)
+static int dspbridge_scale_notification(struct notifier_block *op,
+		unsigned long val, void *ptr)
 {
-	PWR_PM_PostScale(PRCM_VDD1, level);
+	struct dspbridge_platform_data *pdata =
+					omap_dspbridge_dev->dev.platform_data;
+	if (CPUFREQ_POSTCHANGE == val && pdata->dsp_get_opp)
+		PWR_PM_PostScale(PRCM_VDD1, pdata->dsp_get_opp());
 	return 0;
 }
 
 static struct notifier_block iva_clk_notifier = {
-	.notifier_call = dspbridge_post_scale,
+	.notifier_call = dspbridge_scale_notification,
 	NULL,
 };
 #endif
@@ -380,12 +383,13 @@ static int __devinit omap34xx_bridge_probe(struct platform_device *pdev)
 			GT_0trace(driverTrace, GT_7CLASS,
 			"clk_get PASS to get iva2_ck \n");
 		}
-		if (!clk_notifier_register(clk_handle, &iva_clk_notifier)) {
+		if (!cpufreq_register_notifier(&iva_clk_notifier,
+						CPUFREQ_TRANSITION_NOTIFIER)) {
 			GT_0trace(driverTrace, GT_7CLASS,
-			"clk_notifier_register PASS for iva2_ck \n");
+				"cpufreq_register_notifier PASS for iva2_ck\n");
 		} else {
 			GT_0trace(driverTrace, GT_7CLASS,
-			"clk_notifier_register FAIL for iva2_ck \n");
+				"cpufreq_register_notifier FAIL for iva2_ck\n");
 		}
 #endif
 		driverContext = DSP_Init(&initStatus);
@@ -429,12 +433,13 @@ static int __devexit omap34xx_bridge_remove(struct platform_device *pdev)
 		goto func_cont;
 
 #ifdef CONFIG_BRIDGE_DVFS
-	if (!clk_notifier_unregister(clk_handle, &iva_clk_notifier)) {
+	if (!cpufreq_unregister_notifier(&iva_clk_notifier,
+						CPUFREQ_TRANSITION_NOTIFIER)) {
 		GT_0trace(driverTrace, GT_7CLASS,
-		"clk_notifier_unregister PASS for iva2_ck \n");
+			"cpufreq_unregister_notifier PASS for iva2_ck\n");
 	} else {
 		GT_0trace(driverTrace, GT_7CLASS,
-		"clk_notifier_unregister FAILED for iva2_ck \n");
+			"cpufreq_unregister_notifier FAILED for iva2_ck\n");
 	}
 #endif /* #ifdef CONFIG_BRIDGE_DVFS */
 
-- 
1.6.2.4


  reply	other threads:[~2010-01-16  1:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-16  2:01 [PATCH 0/3] dspbridge-pm patches Omar Ramirez Luna
2010-01-16  2:01 ` [PATCH 1/3] DSPBRIDGE: Fix header locations mach to plat Omar Ramirez Luna
2010-01-16  2:01   ` Omar Ramirez Luna [this message]
2010-01-16  2:01     ` [PATCH 3/3] DSPBRIDGE: Use dspbridge to initialize platform data Omar Ramirez Luna
2010-01-18 10:32       ` Ameya Palande
2010-01-18 18:09         ` Ramirez Luna, Omar
2010-01-18 10:20     ` [PATCH 2/3] DSPBRIDGE: change to cpufreq_register_notifier for OPP changes Ameya Palande
2010-01-18 18:09       ` Ramirez Luna, Omar
2010-01-18  9:55   ` [PATCH 1/3] DSPBRIDGE: Fix header locations mach to plat Ameya Palande
2010-01-18 18:08     ` Ramirez Luna, Omar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1263607307-21693-3-git-send-email-omar.ramirez@ti.com \
    --to=omar.ramirez@ti.com \
    --cc=Hiroshi.DOYU@nokia.com \
    --cc=ameya.palande@nokia.com \
    --cc=felipe.contreras@nokia.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=x0095840@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox