kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [KJ] [RFC][PATCH 3/5] ppc/pmac_cpufreq: use poll_event*() interface
@ 2005-03-03 18:26 Nishanth Aravamudan
  0 siblings, 0 replies; only message in thread
From: Nishanth Aravamudan @ 2005-03-03 18:26 UTC (permalink / raw)
  To: kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 1133 bytes --]

Hi,

Description: Use new poll_event() interface to encapsulate sleep-loops.

Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>

--- 2.6.11-kj-v/arch/ppc/platforms/pmac_cpufreq.c	2005-03-01 23:38:10.000000000 -0800
+++ 2.6.11-kj/arch/ppc/platforms/pmac_cpufreq.c	2005-03-02 17:53:35.000000000 -0800
@@ -167,8 +167,6 @@ static unsigned int __pmac dfs_get_cpu_s
  */
 static int __pmac gpios_set_cpu_speed(int low_speed)
 {
-	int gpio;
-
 	/* If ramping up, set voltage first */
 	if (low_speed == 0) {
 		pmac_call_feature(PMAC_FTR_WRITE_GPIO, NULL, voltage_gpio, 0x05);
@@ -180,11 +178,8 @@ static int __pmac gpios_set_cpu_speed(in
 	pmac_call_feature(PMAC_FTR_WRITE_GPIO, NULL, frequency_gpio,
 			  low_speed ? 0x04 : 0x05);
 	udelay(200);
-	do {
-		set_current_state(TASK_UNINTERRUPTIBLE);
-		schedule_timeout(1);
-		gpio = pmac_call_feature(PMAC_FTR_READ_GPIO, NULL, slew_done_gpio, 0);
-	} while((gpio & 0x02) == 0);
+	/* check every millisecond until true */
+	poll_event(((pmac_call_feature(PMAC_FTR_READ_GPIO, NULL, slew_done_gpio, 0) & 0x02) != 0), 1);
 
 	/* If ramping down, set voltage last */
 	if (low_speed == 1) {

[-- Attachment #2: Type: text/plain, Size: 167 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-03-03 18:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-03 18:26 [KJ] [RFC][PATCH 3/5] ppc/pmac_cpufreq: use poll_event*() interface Nishanth Aravamudan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).