aboutsummaryrefslogtreecommitdiffstats
path: root/sound/oss/opl3sa2.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/oss/opl3sa2.c')
-rw-r--r--sound/oss/opl3sa2.c110
1 files changed, 0 insertions, 110 deletions
diff --git a/sound/oss/opl3sa2.c b/sound/oss/opl3sa2.c
index cd41d0e4706a..5cecdbcbea9d 100644
--- a/sound/oss/opl3sa2.c
+++ b/sound/oss/opl3sa2.c
@@ -69,8 +69,6 @@
69#include <linux/init.h> 69#include <linux/init.h>
70#include <linux/module.h> 70#include <linux/module.h>
71#include <linux/delay.h> 71#include <linux/delay.h>
72#include <linux/pm.h>
73#include <linux/pm_legacy.h>
74#include "sound_config.h" 72#include "sound_config.h"
75 73
76#include "ad1848.h" 74#include "ad1848.h"
@@ -139,10 +137,6 @@ typedef struct {
139 struct pnp_dev* pdev; 137 struct pnp_dev* pdev;
140 int activated; /* Whether said devices have been activated */ 138 int activated; /* Whether said devices have been activated */
141#endif 139#endif
142#ifdef CONFIG_PM_LEGACY
143 unsigned int in_suspend;
144 struct pm_dev *pmdev;
145#endif
146 unsigned int card; 140 unsigned int card;
147 int chipset; /* What's my version(s)? */ 141 int chipset; /* What's my version(s)? */
148 char *chipset_name; 142 char *chipset_name;
@@ -341,22 +335,6 @@ static void opl3sa2_mixer_reset(opl3sa2_state_t* devc)
341 } 335 }
342} 336}
343 337
344/* Currently only used for power management */
345#ifdef CONFIG_PM_LEGACY
346static void opl3sa2_mixer_restore(opl3sa2_state_t* devc)
347{
348 if (devc) {
349 opl3sa2_set_volume(devc, devc->volume_l, devc->volume_r);
350 opl3sa2_set_mic(devc, devc->mic);
351
352 if (devc->chipset == CHIPSET_OPL3SA3) {
353 opl3sa3_set_bass(devc, devc->bass_l, devc->bass_r);
354 opl3sa3_set_treble(devc, devc->treble_l, devc->treble_r);
355 }
356 }
357}
358#endif /* CONFIG_PM_LEGACY */
359
360static inline void arg_to_vol_mono(unsigned int vol, int* value) 338static inline void arg_to_vol_mono(unsigned int vol, int* value)
361{ 339{
362 int left; 340 int left;
@@ -832,84 +810,6 @@ static struct pnp_driver opl3sa2_driver = {
832 810
833/* End of component functions */ 811/* End of component functions */
834 812
835#ifdef CONFIG_PM_LEGACY
836
837static DEFINE_SPINLOCK(opl3sa2_lock);
838
839/* Power Management support functions */
840static int opl3sa2_suspend(struct pm_dev *pdev, unsigned int pm_mode)
841{
842 unsigned long flags;
843 opl3sa2_state_t *p;
844
845 if (!pdev)
846 return -EINVAL;
847
848 spin_lock_irqsave(&opl3sa2_lock,flags);
849
850 p = (opl3sa2_state_t *) pdev->data;
851 switch (pm_mode) {
852 case 1:
853 pm_mode = OPL3SA2_PM_MODE1;
854 break;
855 case 2:
856 pm_mode = OPL3SA2_PM_MODE2;
857 break;
858 case 3:
859 pm_mode = OPL3SA2_PM_MODE3;
860 break;
861 default:
862 /* we don't know howto handle this... */
863 spin_unlock_irqrestore(&opl3sa2_lock, flags);
864 return -EBUSY;
865 }
866
867 p->in_suspend = 1;
868
869 /* its supposed to automute before suspending, so we won't bother */
870 opl3sa2_write(p->cfg_port, OPL3SA2_PM, pm_mode);
871 /* wait a while for the clock oscillator to stabilise */
872 mdelay(10);
873
874 spin_unlock_irqrestore(&opl3sa2_lock,flags);
875 return 0;
876}
877
878static int opl3sa2_resume(struct pm_dev *pdev)
879{
880 unsigned long flags;
881 opl3sa2_state_t *p;
882
883 if (!pdev)
884 return -EINVAL;
885
886 p = (opl3sa2_state_t *) pdev->data;
887 spin_lock_irqsave(&opl3sa2_lock,flags);
888
889 /* I don't think this is necessary */
890 opl3sa2_write(p->cfg_port, OPL3SA2_PM, OPL3SA2_PM_MODE0);
891 opl3sa2_mixer_restore(p);
892 p->in_suspend = 0;
893
894 spin_unlock_irqrestore(&opl3sa2_lock,flags);
895 return 0;
896}
897
898static int opl3sa2_pm_callback(struct pm_dev *pdev, pm_request_t rqst, void *data)
899{
900 unsigned long mode = (unsigned long)data;
901
902 switch (rqst) {
903 case PM_SUSPEND:
904 return opl3sa2_suspend(pdev, mode);
905
906 case PM_RESUME:
907 return opl3sa2_resume(pdev);
908 }
909 return 0;
910}
911#endif /* CONFIG_PM_LEGACY */
912
913/* 813/*
914 * Install OPL3-SA2 based card(s). 814 * Install OPL3-SA2 based card(s).
915 * 815 *
@@ -1021,12 +921,6 @@ static int __init init_opl3sa2(void)
1021 921
1022 /* ewww =) */ 922 /* ewww =) */
1023 opl3sa2_state[card].card = card; 923 opl3sa2_state[card].card = card;
1024#ifdef CONFIG_PM_LEGACY
1025 /* register our power management capabilities */
1026 opl3sa2_state[card].pmdev = pm_register(PM_ISA_DEV, card, opl3sa2_pm_callback);
1027 if (opl3sa2_state[card].pmdev)
1028 opl3sa2_state[card].pmdev->data = &opl3sa2_state[card];
1029#endif /* CONFIG_PM_LEGACY */
1030 924
1031 /* 925 /*
1032 * Set the Yamaha 3D enhancement mode (aka Ymersion) if asked to and 926 * Set the Yamaha 3D enhancement mode (aka Ymersion) if asked to and
@@ -1083,10 +977,6 @@ static void __exit cleanup_opl3sa2(void)
1083 int card; 977 int card;
1084 978
1085 for(card = 0; card < opl3sa2_cards_num; card++) { 979 for(card = 0; card < opl3sa2_cards_num; card++) {
1086#ifdef CONFIG_PM_LEGACY
1087 if (opl3sa2_state[card].pmdev)
1088 pm_unregister(opl3sa2_state[card].pmdev);
1089#endif
1090 if (opl3sa2_state[card].cfg_mpu.slots[1] != -1) { 980 if (opl3sa2_state[card].cfg_mpu.slots[1] != -1) {
1091 unload_opl3sa2_mpu(&opl3sa2_state[card].cfg_mpu); 981 unload_opl3sa2_mpu(&opl3sa2_state[card].cfg_mpu);
1092 } 982 }