linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2.6.12-rc3] pmac: save master volume on sleep
@ 2005-04-21 18:04 Colin Leroy
  2005-04-22  0:17 ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 4+ messages in thread
From: Colin Leroy @ 2005-04-21 18:04 UTC (permalink / raw)
  To: debian-powerpc@lists.debian.org, linuxppc-dev,
	Benjamin Herrenschmidt
  Cc: Takashi Iwai, Andrew Morton

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@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)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2.6.12-rc3] pmac: save master volume on sleep
  2005-04-21 18:04 [PATCH 2.6.12-rc3] pmac: save master volume on sleep Colin Leroy
@ 2005-04-22  0:17 ` Benjamin Herrenschmidt
  2005-04-24 16:24   ` Colin Leroy
  0 siblings, 1 reply; 4+ messages in thread
From: Benjamin Herrenschmidt @ 2005-04-22  0:17 UTC (permalink / raw)
  To: Colin Leroy
  Cc: Takashi Iwai, linuxppc-dev list, debian-powerpc@lists.debian.org,
	Andrew Morton

On Thu, 2005-04-21 at 20:04 +0200, Colin Leroy wrote:
> 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,

Looks good.

Ben.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2.6.12-rc3] pmac: save master volume on sleep
  2005-04-22  0:17 ` Benjamin Herrenschmidt
@ 2005-04-24 16:24   ` Colin Leroy
  2005-04-24 16:43     ` Takashi Iwai
  0 siblings, 1 reply; 4+ messages in thread
From: Colin Leroy @ 2005-04-24 16:24 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: Takashi Iwai, linuxppc-dev list, debian-powerpc@lists.debian.org,
	Andrew Morton

On 22 Apr 2005 at 10h04, Benjamin Herrenschmidt wrote:

Hi, 

> > 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,
> 
> Looks good.

Takashi: any news or comments on this?

Thanks,
-- 
Colin

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2.6.12-rc3] pmac: save master volume on sleep
  2005-04-24 16:24   ` Colin Leroy
@ 2005-04-24 16:43     ` Takashi Iwai
  0 siblings, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2005-04-24 16:43 UTC (permalink / raw)
  To: Colin Leroy
  Cc: Takashi Iwai, debian-powerpc@lists.debian.org, Andrew Morton,
	linuxppc-dev list

Hi Colin,

the patch looks OK to me too.
Could you resend this to Jaroslav to apply it to ALSA tree, since I'm
in vacation...?

Thanks.


Takashi

On 4/24/05, Colin Leroy <colin@colino.net> wrote:
> On 22 Apr 2005 at 10h04, Benjamin Herrenschmidt wrote:
>=20
> Hi,
>=20
> > > 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,
> >
> > Looks good.
>=20
> Takashi: any news or comments on this?
>=20
> Thanks,
> --
> Colin
>=20
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-04-24 16:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-21 18:04 [PATCH 2.6.12-rc3] pmac: save master volume on sleep Colin Leroy
2005-04-22  0:17 ` Benjamin Herrenschmidt
2005-04-24 16:24   ` Colin Leroy
2005-04-24 16:43     ` Takashi Iwai

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).