ALSA: juli - Patch for suspend/resume for ESI Juli@
PATCH 1/1 ALSA: juli - Patch for suspend/resume for ESI Juli@
From: Aleksey Kunitskiy <[email protected]>
Add proper suspend/resume code for Juli@ cards. Based on ice1724 suspend/resume work of Igor Chernyshev.
Fixes bug https://bugtrack.alsa-project.org/alsa-bug/view.php?id=4413
Tested on linux-2.6.31.6
--- pci/ice1712/juli.c | 29 +++++++++++++++++++++++++++++ 1 files changed, 29 insertions(+), 0 deletions(-)
pci/ice1712/juli.c +29 -0
@@ -483,6 +483,28 @@ static int __devinit juli_add_controls(struct snd_ice1712 *ice) }/* +* suspend/resume +* */ + +#ifdef CONFIG_PM +static int __devinit juli_resume (struct snd_ice1712 *ice) +{ +struct snd_akm4xxx *ak = ice->akm; +/* akm4358 un-reset, un-mute */ +snd_akm4xxx_reset (ak,0 ); +return 0 ; +} + +static int __devinit juli_suspend (struct snd_ice1712 *ice) +{ +struct snd_akm4xxx *ak = ice->akm; +/* akm4358 reset and soft-mute */ +snd_akm4xxx_reset (ak,1 ); +return 0 ; +} +#endif + +/* * initialize the chip */
@@ -626,6 +648,13 @@ static int __devinit juli_init(struct snd_ice1712 *ice) ice->set_spdif_clock = juli_set_spdif_clock; ice->spdif.ops.open = juli_spdif_in_open; + +#ifdef CONFIG_PM + ice->pm_resume = &juli_resume; + ice->pm_suspend = &juli_suspend; + ice->pm_suspend_enabled =1 ; +#endif +return 0 ; }
Signature · 1 line
1.6.4.4
At Sat, 14 Nov 2009 14:20:14 +0200,
Quoted 9 lines · [email protected] wrote:
From: Aleksey Kunitskiy <[email protected]>
Add proper suspend/resume code for Juli@ cards. Based on ice1724 suspend/resume work of Igor Chernyshev.
Fixes bug https://bugtrack.alsa-project.org/alsa-bug/view.php?id=4413
Tested on linux-2.6.31.6Signed-off-by Aleksey Kunitskiy <[email protected]>
Thanks for the patch.
A few quick review comments below.
pci/ice1712/juli.c static int __devinit juli_add_controls(struct snd_ice1712 *ice) · line 490
Quoted 6 lines
/*
+ * suspend/resume
+ * */pci/ice1712/juli.c +3
-0+ +#ifdef CONFIG_PM +static int __devinit juli_resume (struct snd_ice1712 *ice)
The __devinit is invalid for the resume. Remove it.
pci/ice1712/juli.c static int __devinit juli_add_controls(struct snd_ice1712 *ice) · line 494
Quoted 4 lines
pci/ice1712/juli.c +4
-0+{ +struct snd_akm4xxx *ak = ice->akm; +/* akm4358 un-reset, un-mute */ +snd_akm4xxx_reset (ak,0 );
Don't you need to re-initialize the ak4114 chip?
pci/ice1712/juli.c static int __devinit juli_add_controls(struct snd_ice1712 *ice) · line 498
Quoted 4 lines
pci/ice1712/juli.c +4
-0+return 0 ; +} + +static int __devinit juli_suspend (struct snd_ice1712 *ice)
Similarly, __devinit is invalid for suspend, too. Remove it.
pci/ice1712/juli.c static int __devinit juli_init(struct snd_ice1712 *ice) · line 654
Quoted 8 lines
pci/ice1712/juli.c +4
-0@@ -626,6 +648,13 @@ static int __devinit juli_init(struct snd_ice1712 *ice) ice->set_spdif_clock = juli_set_spdif_clock; ice->spdif.ops.open = juli_spdif_in_open; + +#ifdef CONFIG_PM + ice->pm_resume = &juli_resume; + ice->pm_suspend = &juli_suspend;
Usually '&' isn't needed for function pointers (although it's valid).
Could you fix these and repost?
thanks,
Takashi