aboutsummaryrefslogtreecommitdiffstats
path: root/sound/oss/ad1848.c
diff options
context:
space:
mode:
authorPatrick Mochel <mochel@digitalimplant.org>2006-01-06 03:15:07 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-06 11:33:41 -0500
commite7c045c14bffcab2d329e86b80dc8ff7d528e05b (patch)
tree58e195896bcf597e19459aa24322eeb6520cf79b /sound/oss/ad1848.c
parente5e2fa7857f6bf46605c77d949fa6698b9b0bc28 (diff)
[PATCH] oss: remove deprecated PM interface from ad1848 driver
This change removes the old, deprecated interface from the ad1848 driver, including the pm_{,un}register() calls, the local storage of the pmdev object and the reference to the old header files. This change is done to assist in eradicating the users of the legacy interface so as to help facilitate the removal of the interface itself. Signed-off-by: Patrick Mochel <mochel@linux.intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'sound/oss/ad1848.c')
-rw-r--r--sound/oss/ad1848.c92
1 files changed, 0 insertions, 92 deletions
diff --git a/sound/oss/ad1848.c b/sound/oss/ad1848.c
index 3f30c57676c1..49796be955f3 100644
--- a/sound/oss/ad1848.c
+++ b/sound/oss/ad1848.c
@@ -46,8 +46,6 @@
46#include <linux/interrupt.h> 46#include <linux/interrupt.h>
47#include <linux/module.h> 47#include <linux/module.h>
48#include <linux/stddef.h> 48#include <linux/stddef.h>
49#include <linux/pm.h>
50#include <linux/pm_legacy.h>
51#include <linux/isapnp.h> 49#include <linux/isapnp.h>
52#include <linux/pnp.h> 50#include <linux/pnp.h>
53#include <linux/spinlock.h> 51#include <linux/spinlock.h>
@@ -105,9 +103,6 @@ typedef struct
105 int irq_ok; 103 int irq_ok;
106 mixer_ents *mix_devices; 104 mixer_ents *mix_devices;
107 int mixer_output_port; 105 int mixer_output_port;
108
109 /* Power management */
110 struct pm_dev *pmdev;
111} ad1848_info; 106} ad1848_info;
112 107
113typedef struct ad1848_port_info 108typedef struct ad1848_port_info
@@ -201,7 +196,6 @@ static void ad1848_halt(int dev);
201static void ad1848_halt_input(int dev); 196static void ad1848_halt_input(int dev);
202static void ad1848_halt_output(int dev); 197static void ad1848_halt_output(int dev);
203static void ad1848_trigger(int dev, int bits); 198static void ad1848_trigger(int dev, int bits);
204static int ad1848_pm_callback(struct pm_dev *dev, pm_request_t rqst, void *data);
205 199
206#ifndef EXCLUDE_TIMERS 200#ifndef EXCLUDE_TIMERS
207static int ad1848_tmr_install(int dev); 201static int ad1848_tmr_install(int dev);
@@ -2027,10 +2021,6 @@ int ad1848_init (char *name, struct resource *ports, int irq, int dma_playback,
2027 2021
2028 nr_ad1848_devs++; 2022 nr_ad1848_devs++;
2029 2023
2030 devc->pmdev = pm_register(PM_ISA_DEV, my_dev, ad1848_pm_callback);
2031 if (devc->pmdev)
2032 devc->pmdev->data = devc;
2033
2034 ad1848_init_hw(devc); 2024 ad1848_init_hw(devc);
2035 2025
2036 if (irq > 0) 2026 if (irq > 0)
@@ -2197,9 +2187,6 @@ void ad1848_unload(int io_base, int irq, int dma_playback, int dma_capture, int
2197 if(mixer>=0) 2187 if(mixer>=0)
2198 sound_unload_mixerdev(mixer); 2188 sound_unload_mixerdev(mixer);
2199 2189
2200 if (devc->pmdev)
2201 pm_unregister(devc->pmdev);
2202
2203 nr_ad1848_devs--; 2190 nr_ad1848_devs--;
2204 for ( ; i < nr_ad1848_devs ; i++) 2191 for ( ; i < nr_ad1848_devs ; i++)
2205 adev_info[i] = adev_info[i+1]; 2192 adev_info[i] = adev_info[i+1];
@@ -2811,85 +2798,6 @@ static int ad1848_tmr_install(int dev)
2811} 2798}
2812#endif /* EXCLUDE_TIMERS */ 2799#endif /* EXCLUDE_TIMERS */
2813 2800
2814static int ad1848_suspend(ad1848_info *devc)
2815{
2816 unsigned long flags;
2817
2818 spin_lock_irqsave(&devc->lock,flags);
2819
2820 ad_mute(devc);
2821
2822 spin_unlock_irqrestore(&devc->lock,flags);
2823 return 0;
2824}
2825
2826static int ad1848_resume(ad1848_info *devc)
2827{
2828 int mixer_levels[32], i;
2829
2830 /* Thinkpad is a bit more of PITA than normal. The BIOS tends to
2831 restore it in a different config to the one we use. Need to
2832 fix this somehow */
2833
2834 /* store old mixer levels */
2835 memcpy(mixer_levels, devc->levels, sizeof (mixer_levels));
2836 ad1848_init_hw(devc);
2837
2838 /* restore mixer levels */
2839 for (i = 0; i < 32; i++)
2840 ad1848_mixer_set(devc, devc->dev_no, mixer_levels[i]);
2841
2842 if (!devc->subtype) {
2843 static signed char interrupt_bits[12] = { -1, -1, -1, -1, -1, 0x00, -1, 0x08, -1, 0x10, 0x18, 0x20 };
2844 static char dma_bits[4] = { 1, 2, 0, 3 };
2845 unsigned long flags;
2846 signed char bits;
2847 char dma2_bit = 0;
2848
2849 int config_port = devc->base + 0;
2850
2851 bits = interrupt_bits[devc->irq];
2852 if (bits == -1) {
2853 printk(KERN_ERR "MSS: Bad IRQ %d\n", devc->irq);
2854 return -1;
2855 }
2856
2857 spin_lock_irqsave(&devc->lock,flags);
2858
2859 outb((bits | 0x40), config_port);
2860
2861 if (devc->dma2 != -1 && devc->dma2 != devc->dma1)
2862 if ( (devc->dma1 == 0 && devc->dma2 == 1) ||
2863 (devc->dma1 == 1 && devc->dma2 == 0) ||
2864 (devc->dma1 == 3 && devc->dma2 == 0))
2865 dma2_bit = 0x04;
2866
2867 outb((bits | dma_bits[devc->dma1] | dma2_bit), config_port);
2868 spin_unlock_irqrestore(&devc->lock,flags);
2869 }
2870
2871 return 0;
2872}
2873
2874static int ad1848_pm_callback(struct pm_dev *dev, pm_request_t rqst, void *data)
2875{
2876 ad1848_info *devc = dev->data;
2877 if (devc) {
2878 DEB(printk("ad1848: pm event received: 0x%x\n", rqst));
2879
2880 switch (rqst) {
2881 case PM_SUSPEND:
2882 ad1848_suspend(devc);
2883 break;
2884 case PM_RESUME:
2885 ad1848_resume(devc);
2886 break;
2887 }
2888 }
2889 return 0;
2890}
2891
2892
2893EXPORT_SYMBOL(ad1848_detect); 2801EXPORT_SYMBOL(ad1848_detect);
2894EXPORT_SYMBOL(ad1848_init); 2802EXPORT_SYMBOL(ad1848_init);
2895EXPORT_SYMBOL(ad1848_unload); 2803EXPORT_SYMBOL(ad1848_unload);