[PATCH 2.6.12-rc3] pmac: save master volume on sleep

Colin Leroy colin at colino.net
Fri Apr 22 04:04:08 EST 2005


Hi,

Ben's patch that shutdowns master switch and restores it after
resume ("pmac: Improve sleep code of tumbler driver") isn't enough here
on an iBook (snapper chip).

The master switch is correctly saved and restored, but somehow
tumbler_put_master_volume() gets called just after
tumbler_set_master_volume() and sets mix->master_vol[*] to 0. So, on
resuming, the master switch is reenabled, but the volume is set to 0.

Here's a patch that also saves and restores master_vol.
Thanks,

Signed-off-by: Colin Leroy <colin at colino.net>
--- a/sound/ppc/tumbler.c	2005-04-21 19:56:06.000000000 +0200
+++ b/sound/ppc/tumbler.c	2005-04-21 19:55:43.000000000 +0200
@@ -99,6 +99,7 @@
 	pmac_gpio_t hp_detect;
 	int headphone_irq;
 	int lineout_irq;
+	unsigned int save_master_vol[2];
 	unsigned int master_vol[2];
 	unsigned int save_master_switch[2];
 	unsigned int master_switch[2];
@@ -1128,6 +1129,8 @@
 		disable_irq(mix->lineout_irq);
 	mix->save_master_switch[0] = mix->master_switch[0];
 	mix->save_master_switch[1] = mix->master_switch[1];
+	mix->save_master_vol[0] = mix->master_vol[0];
+	mix->save_master_vol[1] = mix->master_vol[1];
 	mix->master_switch[0] = mix->master_switch[1] = 0;
 
 	tumbler_set_master_volume(mix);
@@ -1156,6 +1159,8 @@
 	mix->acs &= ~1;
 	mix->master_switch[0] = mix->save_master_switch[0];
 	mix->master_switch[1] = mix->save_master_switch[1];
+	mix->master_vol[0] = mix->save_master_vol[0];
+	mix->master_vol[1] = mix->save_master_vol[1];
 	tumbler_reset_audio(chip);
 	if (mix->i2c.client && mix->i2c.init_client) {
 		if (mix->i2c.init_client(&mix->i2c) < 0)



More information about the Linuxppc-dev mailing list