[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: TEST: Sleep suppport for iBook G4 & Aluminium PowerBooks (ATI based)



On Sat, 20 Nov 2004 09:04 am, benh wrote:
> On Sat, 2004-11-20 at 04:44 +1030, John Steele Scott wrote:
> > I can confirm that if sleep is invoked by closing the lid, then opening the 
> > lid causes the machine to wake up and then immediately go back to sleep. But 
> > if sleep is invoked by using the power button, then you close the lid while 
> > the machine is asleep, opening the lid wakes it up correctly.
> 
> That must be a problem with pbbuttons/pmud... maybe you have both
> running with pbbuttons set to pmud replacement mode ?

Yes, disabling pmud solved that problem.
 
> > ALSA has some kind of issue where an app which is playing sound will freeze 
> > after resume. After restarting the application, sound is okay. Also ALSA will 
> > not recognise if the headphones are unplugged/plugged-in during sleep.
> 
> Ok, Alsa bugs ... I suppose I'll have to put my hand into those drivers
> sooner or later (volunteers to help here are welcome, the hard part is
> done, now it's time to fix drivers :)

Okay, with the headphones unplugged/re-plug issue, that's simple: ALSA was
updating the mixer, but not notifying clients, so alsamixer was
inconsistent. The solution looks like:

--- linux/sound/ppc/tumbler.c.orig	2004-11-20 12:03:32.000000000 +1030
+++ linux/sound/ppc/tumbler.c	2004-11-20 12:03:53.000000000 +1030
@@ -1023,7 +1023,7 @@
 	}
 	tumbler_set_master_volume(mix);
 	if (chip->update_automute)
-		chip->update_automute(chip, 0);
+		chip->update_automute(chip, 1);
 }
 #endif

I will see if I can figure out the playback freeze issue sometime in the next
few days, unless someone beats me to it. Can somebody tell me whether it affects
the Tumbler chip, or just the Snapper?
 
> > Also, this patch will stop the "cpufreq: resume failed to assert current 
> > frequency is what timing core thinks it is" complaint on 7447A based 
> > machines.

Reproducing this patch here, since I forgot to cc any list on the previous
attempt.

--- linux/arch/ppc/platforms/pmac_cpufreq.c.orig	2004-11-20 03:29:42.000000000 +1030
+++ linux/arch/ppc/platforms/pmac_cpufreq.c	2004-11-20 03:38:57.000000000 +1030
@@ -456,18 +456,25 @@
 	return 0;
 }
 
+static unsigned int __pmac pmac_cpufreq_get_7447A(unsigned int cpu)
+{
+	if (mfspr(HID1) & HID1_DFS)
+		return low_freq;
+	else
+		return hi_freq;
+}
+
 static int __pmac pmac_cpufreq_init_7447A(struct device_node *cpunode)
 {
 	struct device_node *volt_gpio_np;
 	u32 *reg;
+	struct cpufreq_driver *driver = &pmac_cpufreq_driver;
 
 	/* OF only reports the high frequency */
 	hi_freq = cur_freq;
 	low_freq = cur_freq/2;
-	if (mfspr(HID1) & HID1_DFS)
-		cur_freq = low_freq;
-	else
-		cur_freq = hi_freq;
+	driver->get = pmac_cpufreq_get_7447A;
+	cur_freq = driver->get(0);
 
 	volt_gpio_np = of_find_node_by_name(NULL, "cpu-vcore-select");
 	if (!volt_gpio_np){

cheers,

John

Attachment: pgpCcBwFjuIXF.pgp
Description: PGP signature


Reply to: