diff options
author | Takashi Iwai <tiwai@suse.de> | 2010-08-18 09:17:30 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-08-18 09:17:30 -0400 |
commit | 6ab561c8aab2e4af535f09adbc6253f958536848 (patch) | |
tree | 37846adb4ea106485720d113e252d71d615c23ed /sound | |
parent | 4f4e8f69895c8696a4bcc751817d4b186023ac44 (diff) | |
parent | cbaa9f60d5d5c3af10f94e0d49789d5b82341a4a (diff) |
Merge branch 'topic/isa' into topic/misc
Diffstat (limited to 'sound')
-rw-r--r-- | sound/core/pcm_native.c | 13 | ||||
-rw-r--r-- | sound/drivers/Kconfig | 2 | ||||
-rw-r--r-- | sound/isa/Kconfig | 36 | ||||
-rw-r--r-- | sound/isa/Makefile | 4 | ||||
-rw-r--r-- | sound/isa/galaxy/Makefile | 10 | ||||
-rw-r--r-- | sound/isa/galaxy/azt1605.c | 91 | ||||
-rw-r--r-- | sound/isa/galaxy/azt2316.c | 111 | ||||
-rw-r--r-- | sound/isa/galaxy/galaxy.c | 652 | ||||
-rw-r--r-- | sound/isa/sgalaxy.c | 369 | ||||
-rw-r--r-- | sound/pci/trident/trident_main.c | 2 | ||||
-rw-r--r-- | sound/pcmcia/pdaudiocf/pdaudiocf.c | 9 | ||||
-rw-r--r-- | sound/pcmcia/pdaudiocf/pdaudiocf.h | 1 | ||||
-rw-r--r-- | sound/pcmcia/vx/vxpocket.c | 9 | ||||
-rw-r--r-- | sound/pcmcia/vx/vxpocket.h | 1 | ||||
-rw-r--r-- | sound/soc/fsl/mpc5200_psc_ac97.c | 22 | ||||
-rw-r--r-- | sound/soc/fsl/mpc8610_hpcd.c | 2 | ||||
-rw-r--r-- | sound/soc/imx/imx-ssi.c | 2 | ||||
-rw-r--r-- | sound/soc/soc-core.c | 2 | ||||
-rw-r--r-- | sound/sparc/amd7930.c | 6 | ||||
-rw-r--r-- | sound/sparc/cs4231.c | 18 | ||||
-rw-r--r-- | sound/sparc/dbri.c | 6 | ||||
-rw-r--r-- | sound/usb/pcm.c | 2 |
22 files changed, 945 insertions, 425 deletions
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index 303ac04ff6e4..a3b2a6479246 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c | |||
@@ -451,13 +451,11 @@ static int snd_pcm_hw_params(struct snd_pcm_substream *substream, | |||
451 | snd_pcm_timer_resolution_change(substream); | 451 | snd_pcm_timer_resolution_change(substream); |
452 | runtime->status->state = SNDRV_PCM_STATE_SETUP; | 452 | runtime->status->state = SNDRV_PCM_STATE_SETUP; |
453 | 453 | ||
454 | if (substream->latency_pm_qos_req) { | 454 | if (pm_qos_request_active(&substream->latency_pm_qos_req)) |
455 | pm_qos_remove_request(substream->latency_pm_qos_req); | 455 | pm_qos_remove_request(&substream->latency_pm_qos_req); |
456 | substream->latency_pm_qos_req = NULL; | ||
457 | } | ||
458 | if ((usecs = period_to_usecs(runtime)) >= 0) | 456 | if ((usecs = period_to_usecs(runtime)) >= 0) |
459 | substream->latency_pm_qos_req = pm_qos_add_request( | 457 | pm_qos_add_request(&substream->latency_pm_qos_req, |
460 | PM_QOS_CPU_DMA_LATENCY, usecs); | 458 | PM_QOS_CPU_DMA_LATENCY, usecs); |
461 | return 0; | 459 | return 0; |
462 | _error: | 460 | _error: |
463 | /* hardware might be unuseable from this time, | 461 | /* hardware might be unuseable from this time, |
@@ -512,8 +510,7 @@ static int snd_pcm_hw_free(struct snd_pcm_substream *substream) | |||
512 | if (substream->ops->hw_free) | 510 | if (substream->ops->hw_free) |
513 | result = substream->ops->hw_free(substream); | 511 | result = substream->ops->hw_free(substream); |
514 | runtime->status->state = SNDRV_PCM_STATE_OPEN; | 512 | runtime->status->state = SNDRV_PCM_STATE_OPEN; |
515 | pm_qos_remove_request(substream->latency_pm_qos_req); | 513 | pm_qos_remove_request(&substream->latency_pm_qos_req); |
516 | substream->latency_pm_qos_req = NULL; | ||
517 | return result; | 514 | return result; |
518 | } | 515 | } |
519 | 516 | ||
diff --git a/sound/drivers/Kconfig b/sound/drivers/Kconfig index 32646000ab90..480c38623da8 100644 --- a/sound/drivers/Kconfig +++ b/sound/drivers/Kconfig | |||
@@ -155,7 +155,7 @@ config SND_ML403_AC97CR | |||
155 | select SND_AC97_CODEC | 155 | select SND_AC97_CODEC |
156 | help | 156 | help |
157 | Say Y here to include support for the | 157 | Say Y here to include support for the |
158 | opb_ac97_controller_ref_v1_00_a ip core found in Xilinx' ML403 | 158 | opb_ac97_controller_ref_v1_00_a ip core found in Xilinx's ML403 |
159 | reference design. | 159 | reference design. |
160 | 160 | ||
161 | To compile this driver as a module, choose M here: the module | 161 | To compile this driver as a module, choose M here: the module |
diff --git a/sound/isa/Kconfig b/sound/isa/Kconfig index c6990c680796..52064cfa91f3 100644 --- a/sound/isa/Kconfig +++ b/sound/isa/Kconfig | |||
@@ -77,6 +77,32 @@ config SND_ALS100 | |||
77 | To compile this driver as a module, choose M here: the module | 77 | To compile this driver as a module, choose M here: the module |
78 | will be called snd-als100. | 78 | will be called snd-als100. |
79 | 79 | ||
80 | config SND_AZT1605 | ||
81 | tristate "Aztech AZT1605 Driver" | ||
82 | depends on SND | ||
83 | select SND_WSS_LIB | ||
84 | select SND_MPU401_UART | ||
85 | select SND_OPL3_LIB | ||
86 | help | ||
87 | Say Y here to include support for Aztech Sound Galaxy cards | ||
88 | based on the AZT1605 chipset. | ||
89 | |||
90 | To compile this driver as a module, choose M here: the module | ||
91 | will be called snd-azt1605. | ||
92 | |||
93 | config SND_AZT2316 | ||
94 | tristate "Aztech AZT2316 Driver" | ||
95 | depends on SND | ||
96 | select SND_WSS_LIB | ||
97 | select SND_MPU401_UART | ||
98 | select SND_OPL3_LIB | ||
99 | help | ||
100 | Say Y here to include support for Aztech Sound Galaxy cards | ||
101 | based on the AZT2316 chipset. | ||
102 | |||
103 | To compile this driver as a module, choose M here: the module | ||
104 | will be called snd-azt2316. | ||
105 | |||
80 | config SND_AZT2320 | 106 | config SND_AZT2320 |
81 | tristate "Aztech Systems AZT2320" | 107 | tristate "Aztech Systems AZT2320" |
82 | depends on PNP | 108 | depends on PNP |
@@ -351,16 +377,6 @@ config SND_SB16_CSP | |||
351 | coprocessor can do variable tasks like various compression and | 377 | coprocessor can do variable tasks like various compression and |
352 | decompression algorithms. | 378 | decompression algorithms. |
353 | 379 | ||
354 | config SND_SGALAXY | ||
355 | tristate "Aztech Sound Galaxy" | ||
356 | select SND_WSS_LIB | ||
357 | help | ||
358 | Say Y here to include support for Aztech Sound Galaxy | ||
359 | soundcards. | ||
360 | |||
361 | To compile this driver as a module, choose M here: the module | ||
362 | will be called snd-sgalaxy. | ||
363 | |||
364 | config SND_SSCAPE | 380 | config SND_SSCAPE |
365 | tristate "Ensoniq SoundScape driver" | 381 | tristate "Ensoniq SoundScape driver" |
366 | select SND_MPU401_UART | 382 | select SND_MPU401_UART |
diff --git a/sound/isa/Makefile b/sound/isa/Makefile index c73d30c4f462..8d781e419e2e 100644 --- a/sound/isa/Makefile +++ b/sound/isa/Makefile | |||
@@ -10,7 +10,6 @@ snd-cmi8330-objs := cmi8330.o | |||
10 | snd-es18xx-objs := es18xx.o | 10 | snd-es18xx-objs := es18xx.o |
11 | snd-opl3sa2-objs := opl3sa2.o | 11 | snd-opl3sa2-objs := opl3sa2.o |
12 | snd-sc6000-objs := sc6000.o | 12 | snd-sc6000-objs := sc6000.o |
13 | snd-sgalaxy-objs := sgalaxy.o | ||
14 | snd-sscape-objs := sscape.o | 13 | snd-sscape-objs := sscape.o |
15 | 14 | ||
16 | # Toplevel Module Dependency | 15 | # Toplevel Module Dependency |
@@ -21,8 +20,7 @@ obj-$(CONFIG_SND_CMI8330) += snd-cmi8330.o | |||
21 | obj-$(CONFIG_SND_ES18XX) += snd-es18xx.o | 20 | obj-$(CONFIG_SND_ES18XX) += snd-es18xx.o |
22 | obj-$(CONFIG_SND_OPL3SA2) += snd-opl3sa2.o | 21 | obj-$(CONFIG_SND_OPL3SA2) += snd-opl3sa2.o |
23 | obj-$(CONFIG_SND_SC6000) += snd-sc6000.o | 22 | obj-$(CONFIG_SND_SC6000) += snd-sc6000.o |
24 | obj-$(CONFIG_SND_SGALAXY) += snd-sgalaxy.o | ||
25 | obj-$(CONFIG_SND_SSCAPE) += snd-sscape.o | 23 | obj-$(CONFIG_SND_SSCAPE) += snd-sscape.o |
26 | 24 | ||
27 | obj-$(CONFIG_SND) += ad1816a/ ad1848/ cs423x/ es1688/ gus/ msnd/ opti9xx/ \ | 25 | obj-$(CONFIG_SND) += ad1816a/ ad1848/ cs423x/ es1688/ galaxy/ gus/ msnd/ opti9xx/ \ |
28 | sb/ wavefront/ wss/ | 26 | sb/ wavefront/ wss/ |
diff --git a/sound/isa/galaxy/Makefile b/sound/isa/galaxy/Makefile new file mode 100644 index 000000000000..e307066d4315 --- /dev/null +++ b/sound/isa/galaxy/Makefile | |||
@@ -0,0 +1,10 @@ | |||
1 | # | ||
2 | # Makefile for ALSA | ||
3 | # Copyright (c) 2001 by Jaroslav Kysela <perex@suse.cz> | ||
4 | # | ||
5 | |||
6 | snd-azt1605-objs := azt1605.o | ||
7 | snd-azt2316-objs := azt2316.o | ||
8 | |||
9 | obj-$(CONFIG_SND_AZT1605) += snd-azt1605.o | ||
10 | obj-$(CONFIG_SND_AZT2316) += snd-azt2316.o | ||
diff --git a/sound/isa/galaxy/azt1605.c b/sound/isa/galaxy/azt1605.c new file mode 100644 index 000000000000..9a97643cb713 --- /dev/null +++ b/sound/isa/galaxy/azt1605.c | |||
@@ -0,0 +1,91 @@ | |||
1 | /* | ||
2 | * Aztech AZT1605 Driver | ||
3 | * Copyright (C) 2007,2010 Rene Herman | ||
4 | * | ||
5 | * This program is free software: you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation, either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
17 | * | ||
18 | */ | ||
19 | |||
20 | #define AZT1605 | ||
21 | |||
22 | #define CRD_NAME "Aztech AZT1605" | ||
23 | #define DRV_NAME "AZT1605" | ||
24 | #define DEV_NAME "azt1605" | ||
25 | |||
26 | #define GALAXY_DSP_MAJOR 2 | ||
27 | #define GALAXY_DSP_MINOR 1 | ||
28 | |||
29 | #define GALAXY_CONFIG_SIZE 3 | ||
30 | |||
31 | /* | ||
32 | * 24-bit config register | ||
33 | */ | ||
34 | |||
35 | #define GALAXY_CONFIG_SBA_220 (0 << 0) | ||
36 | #define GALAXY_CONFIG_SBA_240 (1 << 0) | ||
37 | #define GALAXY_CONFIG_SBA_260 (2 << 0) | ||
38 | #define GALAXY_CONFIG_SBA_280 (3 << 0) | ||
39 | #define GALAXY_CONFIG_SBA_MASK GALAXY_CONFIG_SBA_280 | ||
40 | |||
41 | #define GALAXY_CONFIG_MPUA_300 (0 << 2) | ||
42 | #define GALAXY_CONFIG_MPUA_330 (1 << 2) | ||
43 | |||
44 | #define GALAXY_CONFIG_MPU_ENABLE (1 << 3) | ||
45 | |||
46 | #define GALAXY_CONFIG_GAME_ENABLE (1 << 4) | ||
47 | |||
48 | #define GALAXY_CONFIG_CD_PANASONIC (1 << 5) | ||
49 | #define GALAXY_CONFIG_CD_MITSUMI (1 << 6) | ||
50 | #define GALAXY_CONFIG_CD_MASK (\ | ||
51 | GALAXY_CONFIG_CD_PANASONIC | GALAXY_CONFIG_CD_MITSUMI) | ||
52 | |||
53 | #define GALAXY_CONFIG_UNUSED (1 << 7) | ||
54 | #define GALAXY_CONFIG_UNUSED_MASK GALAXY_CONFIG_UNUSED | ||
55 | |||
56 | #define GALAXY_CONFIG_SBIRQ_2 (1 << 8) | ||
57 | #define GALAXY_CONFIG_SBIRQ_3 (1 << 9) | ||
58 | #define GALAXY_CONFIG_SBIRQ_5 (1 << 10) | ||
59 | #define GALAXY_CONFIG_SBIRQ_7 (1 << 11) | ||
60 | |||
61 | #define GALAXY_CONFIG_MPUIRQ_2 (1 << 12) | ||
62 | #define GALAXY_CONFIG_MPUIRQ_3 (1 << 13) | ||
63 | #define GALAXY_CONFIG_MPUIRQ_5 (1 << 14) | ||
64 | #define GALAXY_CONFIG_MPUIRQ_7 (1 << 15) | ||
65 | |||
66 | #define GALAXY_CONFIG_WSSA_530 (0 << 16) | ||
67 | #define GALAXY_CONFIG_WSSA_604 (1 << 16) | ||
68 | #define GALAXY_CONFIG_WSSA_E80 (2 << 16) | ||
69 | #define GALAXY_CONFIG_WSSA_F40 (3 << 16) | ||
70 | |||
71 | #define GALAXY_CONFIG_WSS_ENABLE (1 << 18) | ||
72 | |||
73 | #define GALAXY_CONFIG_CDIRQ_11 (1 << 19) | ||
74 | #define GALAXY_CONFIG_CDIRQ_12 (1 << 20) | ||
75 | #define GALAXY_CONFIG_CDIRQ_15 (1 << 21) | ||
76 | #define GALAXY_CONFIG_CDIRQ_MASK (\ | ||
77 | GALAXY_CONFIG_CDIRQ_11 | GALAXY_CONFIG_CDIRQ_12 |\ | ||
78 | GALAXY_CONFIG_CDIRQ_15) | ||
79 | |||
80 | #define GALAXY_CONFIG_CDDMA_DISABLE (0 << 22) | ||
81 | #define GALAXY_CONFIG_CDDMA_0 (1 << 22) | ||
82 | #define GALAXY_CONFIG_CDDMA_1 (2 << 22) | ||
83 | #define GALAXY_CONFIG_CDDMA_3 (3 << 22) | ||
84 | #define GALAXY_CONFIG_CDDMA_MASK GALAXY_CONFIG_CDDMA_3 | ||
85 | |||
86 | #define GALAXY_CONFIG_MASK (\ | ||
87 | GALAXY_CONFIG_SBA_MASK | GALAXY_CONFIG_CD_MASK |\ | ||
88 | GALAXY_CONFIG_UNUSED_MASK | GALAXY_CONFIG_CDIRQ_MASK |\ | ||
89 | GALAXY_CONFIG_CDDMA_MASK) | ||
90 | |||
91 | #include "galaxy.c" | ||
diff --git a/sound/isa/galaxy/azt2316.c b/sound/isa/galaxy/azt2316.c new file mode 100644 index 000000000000..189441141df6 --- /dev/null +++ b/sound/isa/galaxy/azt2316.c | |||
@@ -0,0 +1,111 @@ | |||
1 | /* | ||
2 | * Aztech AZT2316 Driver | ||
3 | * Copyright (C) 2007,2010 Rene Herman | ||
4 | * | ||
5 | * This program is free software: you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation, either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
17 | * | ||
18 | */ | ||
19 | |||
20 | #define AZT2316 | ||
21 | |||
22 | #define CRD_NAME "Aztech AZT2316" | ||
23 | #define DRV_NAME "AZT2316" | ||
24 | #define DEV_NAME "azt2316" | ||
25 | |||
26 | #define GALAXY_DSP_MAJOR 3 | ||
27 | #define GALAXY_DSP_MINOR 1 | ||
28 | |||
29 | #define GALAXY_CONFIG_SIZE 4 | ||
30 | |||
31 | /* | ||
32 | * 32-bit config register | ||
33 | */ | ||
34 | |||
35 | #define GALAXY_CONFIG_SBA_220 (0 << 0) | ||
36 | #define GALAXY_CONFIG_SBA_240 (1 << 0) | ||
37 | #define GALAXY_CONFIG_SBA_260 (2 << 0) | ||
38 | #define GALAXY_CONFIG_SBA_280 (3 << 0) | ||
39 | #define GALAXY_CONFIG_SBA_MASK GALAXY_CONFIG_SBA_280 | ||
40 | |||
41 | #define GALAXY_CONFIG_SBIRQ_2 (1 << 2) | ||
42 | #define GALAXY_CONFIG_SBIRQ_5 (1 << 3) | ||
43 | #define GALAXY_CONFIG_SBIRQ_7 (1 << 4) | ||
44 | #define GALAXY_CONFIG_SBIRQ_10 (1 << 5) | ||
45 | |||
46 | #define GALAXY_CONFIG_SBDMA_DISABLE (0 << 6) | ||
47 | #define GALAXY_CONFIG_SBDMA_0 (1 << 6) | ||
48 | #define GALAXY_CONFIG_SBDMA_1 (2 << 6) | ||
49 | #define GALAXY_CONFIG_SBDMA_3 (3 << 6) | ||
50 | |||
51 | #define GALAXY_CONFIG_WSSA_530 (0 << 8) | ||
52 | #define GALAXY_CONFIG_WSSA_604 (1 << 8) | ||
53 | #define GALAXY_CONFIG_WSSA_E80 (2 << 8) | ||
54 | #define GALAXY_CONFIG_WSSA_F40 (3 << 8) | ||
55 | |||
56 | #define GALAXY_CONFIG_WSS_ENABLE (1 << 10) | ||
57 | |||
58 | #define GALAXY_CONFIG_GAME_ENABLE (1 << 11) | ||
59 | |||
60 | #define GALAXY_CONFIG_MPUA_300 (0 << 12) | ||
61 | #define GALAXY_CONFIG_MPUA_330 (1 << 12) | ||
62 | |||
63 | #define GALAXY_CONFIG_MPU_ENABLE (1 << 13) | ||
64 | |||
65 | #define GALAXY_CONFIG_CDA_310 (0 << 14) | ||
66 | #define GALAXY_CONFIG_CDA_320 (1 << 14) | ||
67 | #define GALAXY_CONFIG_CDA_340 (2 << 14) | ||
68 | #define GALAXY_CONFIG_CDA_350 (3 << 14) | ||
69 | #define GALAXY_CONFIG_CDA_MASK GALAXY_CONFIG_CDA_350 | ||
70 | |||
71 | #define GALAXY_CONFIG_CD_DISABLE (0 << 16) | ||
72 | #define GALAXY_CONFIG_CD_PANASONIC (1 << 16) | ||
73 | #define GALAXY_CONFIG_CD_SONY (2 << 16) | ||
74 | #define GALAXY_CONFIG_CD_MITSUMI (3 << 16) | ||
75 | #define GALAXY_CONFIG_CD_AZTECH (4 << 16) | ||
76 | #define GALAXY_CONFIG_CD_UNUSED_5 (5 << 16) | ||
77 | #define GALAXY_CONFIG_CD_UNUSED_6 (6 << 16) | ||
78 | #define GALAXY_CONFIG_CD_UNUSED_7 (7 << 16) | ||
79 | #define GALAXY_CONFIG_CD_MASK GALAXY_CONFIG_CD_UNUSED_7 | ||
80 | |||
81 | #define GALAXY_CONFIG_CDDMA8_DISABLE (0 << 20) | ||
82 | #define GALAXY_CONFIG_CDDMA8_0 (1 << 20) | ||
83 | #define GALAXY_CONFIG_CDDMA8_1 (2 << 20) | ||
84 | #define GALAXY_CONFIG_CDDMA8_3 (3 << 20) | ||
85 | #define GALAXY_CONFIG_CDDMA8_MASK GALAXY_CONFIG_CDDMA8_3 | ||
86 | |||
87 | #define GALAXY_CONFIG_CDDMA16_DISABLE (0 << 22) | ||
88 | #define GALAXY_CONFIG_CDDMA16_5 (1 << 22) | ||
89 | #define GALAXY_CONFIG_CDDMA16_6 (2 << 22) | ||
90 | #define GALAXY_CONFIG_CDDMA16_7 (3 << 22) | ||
91 | #define GALAXY_CONFIG_CDDMA16_MASK GALAXY_CONFIG_CDDMA16_7 | ||
92 | |||
93 | #define GALAXY_CONFIG_MPUIRQ_2 (1 << 24) | ||
94 | #define GALAXY_CONFIG_MPUIRQ_5 (1 << 25) | ||
95 | #define GALAXY_CONFIG_MPUIRQ_7 (1 << 26) | ||
96 | #define GALAXY_CONFIG_MPUIRQ_10 (1 << 27) | ||
97 | |||
98 | #define GALAXY_CONFIG_CDIRQ_5 (1 << 28) | ||
99 | #define GALAXY_CONFIG_CDIRQ_11 (1 << 29) | ||
100 | #define GALAXY_CONFIG_CDIRQ_12 (1 << 30) | ||
101 | #define GALAXY_CONFIG_CDIRQ_15 (1 << 31) | ||
102 | #define GALAXY_CONFIG_CDIRQ_MASK (\ | ||
103 | GALAXY_CONFIG_CDIRQ_5 | GALAXY_CONFIG_CDIRQ_11 |\ | ||
104 | GALAXY_CONFIG_CDIRQ_12 | GALAXY_CONFIG_CDIRQ_15) | ||
105 | |||
106 | #define GALAXY_CONFIG_MASK (\ | ||
107 | GALAXY_CONFIG_SBA_MASK | GALAXY_CONFIG_CDA_MASK |\ | ||
108 | GALAXY_CONFIG_CD_MASK | GALAXY_CONFIG_CDDMA16_MASK |\ | ||
109 | GALAXY_CONFIG_CDDMA8_MASK | GALAXY_CONFIG_CDIRQ_MASK) | ||
110 | |||
111 | #include "galaxy.c" | ||
diff --git a/sound/isa/galaxy/galaxy.c b/sound/isa/galaxy/galaxy.c new file mode 100644 index 000000000000..ee54df082b9c --- /dev/null +++ b/sound/isa/galaxy/galaxy.c | |||
@@ -0,0 +1,652 @@ | |||
1 | /* | ||
2 | * Aztech AZT1605/AZT2316 Driver | ||
3 | * Copyright (C) 2007,2010 Rene Herman | ||
4 | * | ||
5 | * This program is free software: you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation, either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
17 | * | ||
18 | */ | ||
19 | |||
20 | #include <linux/kernel.h> | ||
21 | #include <linux/module.h> | ||
22 | #include <linux/isa.h> | ||
23 | #include <linux/delay.h> | ||
24 | #include <linux/io.h> | ||
25 | #include <asm/processor.h> | ||
26 | #include <sound/core.h> | ||
27 | #include <sound/initval.h> | ||
28 | #include <sound/wss.h> | ||
29 | #include <sound/mpu401.h> | ||
30 | #include <sound/opl3.h> | ||
31 | |||
32 | MODULE_DESCRIPTION(CRD_NAME); | ||
33 | MODULE_AUTHOR("Rene Herman"); | ||
34 | MODULE_LICENSE("GPL"); | ||
35 | |||
36 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; | ||
37 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; | ||
38 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; | ||
39 | |||
40 | module_param_array(index, int, NULL, 0444); | ||
41 | MODULE_PARM_DESC(index, "Index value for " CRD_NAME " soundcard."); | ||
42 | module_param_array(id, charp, NULL, 0444); | ||
43 | MODULE_PARM_DESC(id, "ID string for " CRD_NAME " soundcard."); | ||
44 | module_param_array(enable, bool, NULL, 0444); | ||
45 | MODULE_PARM_DESC(enable, "Enable " CRD_NAME " soundcard."); | ||
46 | |||
47 | static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; | ||
48 | static long wss_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; | ||
49 | static long mpu_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; | ||
50 | static long fm_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; | ||
51 | static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; | ||
52 | static int mpu_irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; | ||
53 | static int dma1[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; | ||
54 | static int dma2[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; | ||
55 | |||
56 | module_param_array(port, long, NULL, 0444); | ||
57 | MODULE_PARM_DESC(port, "Port # for " CRD_NAME " driver."); | ||
58 | module_param_array(wss_port, long, NULL, 0444); | ||
59 | MODULE_PARM_DESC(wss_port, "WSS port # for " CRD_NAME " driver."); | ||
60 | module_param_array(mpu_port, long, NULL, 0444); | ||
61 | MODULE_PARM_DESC(mpu_port, "MPU-401 port # for " CRD_NAME " driver."); | ||
62 | module_param_array(fm_port, long, NULL, 0444); | ||
63 | MODULE_PARM_DESC(fm_port, "FM port # for " CRD_NAME " driver."); | ||
64 | module_param_array(irq, int, NULL, 0444); | ||
65 | MODULE_PARM_DESC(irq, "IRQ # for " CRD_NAME " driver."); | ||
66 | module_param_array(mpu_irq, int, NULL, 0444); | ||
67 | MODULE_PARM_DESC(mpu_irq, "MPU-401 IRQ # for " CRD_NAME " driver."); | ||
68 | module_param_array(dma1, int, NULL, 0444); | ||
69 | MODULE_PARM_DESC(dma1, "Playback DMA # for " CRD_NAME " driver."); | ||
70 | module_param_array(dma2, int, NULL, 0444); | ||
71 | MODULE_PARM_DESC(dma2, "Capture DMA # for " CRD_NAME " driver."); | ||
72 | |||
73 | /* | ||
74 | * Generic SB DSP support routines | ||
75 | */ | ||
76 | |||
77 | #define DSP_PORT_RESET 0x6 | ||
78 | #define DSP_PORT_READ 0xa | ||
79 | #define DSP_PORT_COMMAND 0xc | ||
80 | #define DSP_PORT_STATUS 0xc | ||
81 | #define DSP_PORT_DATA_AVAIL 0xe | ||
82 | |||
83 | #define DSP_SIGNATURE 0xaa | ||
84 | |||
85 | #define DSP_COMMAND_GET_VERSION 0xe1 | ||
86 | |||
87 | static int __devinit dsp_get_byte(void __iomem *port, u8 *val) | ||
88 | { | ||
89 | int loops = 1000; | ||
90 | |||
91 | while (!(ioread8(port + DSP_PORT_DATA_AVAIL) & 0x80)) { | ||
92 | if (!loops--) | ||
93 | return -EIO; | ||
94 | cpu_relax(); | ||
95 | } | ||
96 | *val = ioread8(port + DSP_PORT_READ); | ||
97 | return 0; | ||
98 | } | ||
99 | |||
100 | static int __devinit dsp_reset(void __iomem *port) | ||
101 | { | ||
102 | u8 val; | ||
103 | |||
104 | iowrite8(1, port + DSP_PORT_RESET); | ||
105 | udelay(10); | ||
106 | iowrite8(0, port + DSP_PORT_RESET); | ||
107 | |||
108 | if (dsp_get_byte(port, &val) < 0 || val != DSP_SIGNATURE) | ||
109 | return -ENODEV; | ||
110 | |||
111 | return 0; | ||
112 | } | ||
113 | |||
114 | static int __devinit dsp_command(void __iomem *port, u8 cmd) | ||
115 | { | ||
116 | int loops = 1000; | ||
117 | |||
118 | while (ioread8(port + DSP_PORT_STATUS) & 0x80) { | ||
119 | if (!loops--) | ||
120 | return -EIO; | ||
121 | cpu_relax(); | ||
122 | } | ||
123 | iowrite8(cmd, port + DSP_PORT_COMMAND); | ||
124 | return 0; | ||
125 | } | ||
126 | |||
127 | static int __devinit dsp_get_version(void __iomem *port, u8 *major, u8 *minor) | ||
128 | { | ||
129 | int err; | ||
130 | |||
131 | err = dsp_command(port, DSP_COMMAND_GET_VERSION); | ||
132 | if (err < 0) | ||
133 | return err; | ||
134 | |||
135 | err = dsp_get_byte(port, major); | ||
136 | if (err < 0) | ||
137 | return err; | ||
138 | |||
139 | err = dsp_get_byte(port, minor); | ||
140 | if (err < 0) | ||
141 | return err; | ||
142 | |||
143 | return 0; | ||
144 | } | ||
145 | |||
146 | /* | ||
147 | * Generic WSS support routines | ||
148 | */ | ||
149 | |||
150 | #define WSS_CONFIG_DMA_0 (1 << 0) | ||
151 | #define WSS_CONFIG_DMA_1 (2 << 0) | ||
152 | #define WSS_CONFIG_DMA_3 (3 << 0) | ||
153 | #define WSS_CONFIG_DUPLEX (1 << 2) | ||
154 | #define WSS_CONFIG_IRQ_7 (1 << 3) | ||
155 | #define WSS_CONFIG_IRQ_9 (2 << 3) | ||
156 | #define WSS_CONFIG_IRQ_10 (3 << 3) | ||
157 | #define WSS_CONFIG_IRQ_11 (4 << 3) | ||
158 | |||
159 | #define WSS_PORT_CONFIG 0 | ||
160 | #define WSS_PORT_SIGNATURE 3 | ||
161 | |||
162 | #define WSS_SIGNATURE 4 | ||
163 | |||
164 | static int __devinit wss_detect(void __iomem *wss_port) | ||
165 | { | ||
166 | if ((ioread8(wss_port + WSS_PORT_SIGNATURE) & 0x3f) != WSS_SIGNATURE) | ||
167 | return -ENODEV; | ||
168 | |||
169 | return 0; | ||
170 | } | ||
171 | |||
172 | static void wss_set_config(void __iomem *wss_port, u8 wss_config) | ||
173 | { | ||
174 | iowrite8(wss_config, wss_port + WSS_PORT_CONFIG); | ||
175 | } | ||
176 | |||
177 | /* | ||
178 | * Aztech Sound Galaxy specifics | ||
179 | */ | ||
180 | |||
181 | #define GALAXY_PORT_CONFIG 1024 | ||
182 | #define CONFIG_PORT_SET 4 | ||
183 | |||
184 | #define DSP_COMMAND_GALAXY_8 8 | ||
185 | #define GALAXY_COMMAND_GET_TYPE 5 | ||
186 | |||
187 | #define DSP_COMMAND_GALAXY_9 9 | ||
188 | #define GALAXY_COMMAND_WSSMODE 0 | ||
189 | #define GALAXY_COMMAND_SB8MODE 1 | ||
190 | |||
191 | #define GALAXY_MODE_WSS GALAXY_COMMAND_WSSMODE | ||
192 | #define GALAXY_MODE_SB8 GALAXY_COMMAND_SB8MODE | ||
193 | |||
194 | struct snd_galaxy { | ||
195 | void __iomem *port; | ||
196 | void __iomem *config_port; | ||
197 | void __iomem *wss_port; | ||
198 | u32 config; | ||
199 | struct resource *res_port; | ||
200 | struct resource *res_config_port; | ||
201 | struct resource *res_wss_port; | ||
202 | }; | ||
203 | |||
204 | static u32 config[SNDRV_CARDS]; | ||
205 | static u8 wss_config[SNDRV_CARDS]; | ||
206 | |||
207 | static int __devinit snd_galaxy_match(struct device *dev, unsigned int n) | ||
208 | { | ||
209 | if (!enable[n]) | ||
210 | return 0; | ||
211 | |||
212 | switch (port[n]) { | ||
213 | case SNDRV_AUTO_PORT: | ||
214 | dev_err(dev, "please specify port\n"); | ||
215 | return 0; | ||
216 | case 0x220: | ||
217 | config[n] |= GALAXY_CONFIG_SBA_220; | ||
218 | break; | ||
219 | case 0x240: | ||
220 | config[n] |= GALAXY_CONFIG_SBA_240; | ||
221 | break; | ||
222 | case 0x260: | ||
223 | config[n] |= GALAXY_CONFIG_SBA_260; | ||
224 | break; | ||
225 | case 0x280: | ||
226 | config[n] |= GALAXY_CONFIG_SBA_280; | ||
227 | break; | ||
228 | default: | ||
229 | dev_err(dev, "invalid port %#lx\n", port[n]); | ||
230 | return 0; | ||
231 | } | ||
232 | |||
233 | switch (wss_port[n]) { | ||
234 | case SNDRV_AUTO_PORT: | ||
235 | dev_err(dev, "please specify wss_port\n"); | ||
236 | return 0; | ||
237 | case 0x530: | ||
238 | config[n] |= GALAXY_CONFIG_WSS_ENABLE | GALAXY_CONFIG_WSSA_530; | ||
239 | break; | ||
240 | case 0x604: | ||
241 | config[n] |= GALAXY_CONFIG_WSS_ENABLE | GALAXY_CONFIG_WSSA_604; | ||
242 | break; | ||
243 | case 0xe80: | ||
244 | config[n] |= GALAXY_CONFIG_WSS_ENABLE | GALAXY_CONFIG_WSSA_E80; | ||
245 | break; | ||
246 | case 0xf40: | ||
247 | config[n] |= GALAXY_CONFIG_WSS_ENABLE | GALAXY_CONFIG_WSSA_F40; | ||
248 | break; | ||
249 | default: | ||
250 | dev_err(dev, "invalid WSS port %#lx\n", wss_port[n]); | ||
251 | return 0; | ||
252 | } | ||
253 | |||
254 | switch (irq[n]) { | ||
255 | case SNDRV_AUTO_IRQ: | ||
256 | dev_err(dev, "please specify irq\n"); | ||
257 | return 0; | ||
258 | case 7: | ||
259 | wss_config[n] |= WSS_CONFIG_IRQ_7; | ||
260 | break; | ||
261 | case 2: | ||
262 | irq[n] = 9; | ||
263 | case 9: | ||
264 | wss_config[n] |= WSS_CONFIG_IRQ_9; | ||
265 | break; | ||
266 | case 10: | ||
267 | wss_config[n] |= WSS_CONFIG_IRQ_10; | ||
268 | break; | ||
269 | case 11: | ||
270 | wss_config[n] |= WSS_CONFIG_IRQ_11; | ||
271 | break; | ||
272 | default: | ||
273 | dev_err(dev, "invalid IRQ %d\n", irq[n]); | ||
274 | return 0; | ||
275 | } | ||
276 | |||
277 | switch (dma1[n]) { | ||
278 | case SNDRV_AUTO_DMA: | ||
279 | dev_err(dev, "please specify dma1\n"); | ||
280 | return 0; | ||
281 | case 0: | ||
282 | wss_config[n] |= WSS_CONFIG_DMA_0; | ||
283 | break; | ||
284 | case 1: | ||
285 | wss_config[n] |= WSS_CONFIG_DMA_1; | ||
286 | break; | ||
287 | case 3: | ||
288 | wss_config[n] |= WSS_CONFIG_DMA_3; | ||
289 | break; | ||
290 | default: | ||
291 | dev_err(dev, "invalid playback DMA %d\n", dma1[n]); | ||
292 | return 0; | ||
293 | } | ||
294 | |||
295 | if (dma2[n] == SNDRV_AUTO_DMA || dma2[n] == dma1[n]) { | ||
296 | dma2[n] = -1; | ||
297 | goto mpu; | ||
298 | } | ||
299 | |||
300 | wss_config[n] |= WSS_CONFIG_DUPLEX; | ||
301 | switch (dma2[n]) { | ||
302 | case 0: | ||
303 | break; | ||
304 | case 1: | ||
305 | if (dma1[n] == 0) | ||
306 | break; | ||
307 | default: | ||
308 | dev_err(dev, "invalid capture DMA %d\n", dma2[n]); | ||
309 | return 0; | ||
310 | } | ||
311 | |||
312 | mpu: | ||
313 | switch (mpu_port[n]) { | ||
314 | case SNDRV_AUTO_PORT: | ||
315 | dev_warn(dev, "mpu_port not specified; not using MPU-401\n"); | ||
316 | mpu_port[n] = -1; | ||
317 | goto fm; | ||
318 | case 0x300: | ||
319 | config[n] |= GALAXY_CONFIG_MPU_ENABLE | GALAXY_CONFIG_MPUA_300; | ||
320 | break; | ||
321 | case 0x330: | ||
322 | config[n] |= GALAXY_CONFIG_MPU_ENABLE | GALAXY_CONFIG_MPUA_330; | ||
323 | break; | ||
324 | default: | ||
325 | dev_err(dev, "invalid MPU port %#lx\n", mpu_port[n]); | ||
326 | return 0; | ||
327 | } | ||
328 | |||
329 | switch (mpu_irq[n]) { | ||
330 | case SNDRV_AUTO_IRQ: | ||
331 | dev_warn(dev, "mpu_irq not specified: using polling mode\n"); | ||
332 | mpu_irq[n] = -1; | ||
333 | break; | ||
334 | case 2: | ||
335 | mpu_irq[n] = 9; | ||
336 | case 9: | ||
337 | config[n] |= GALAXY_CONFIG_MPUIRQ_2; | ||
338 | break; | ||
339 | #ifdef AZT1605 | ||
340 | case 3: | ||
341 | config[n] |= GALAXY_CONFIG_MPUIRQ_3; | ||
342 | break; | ||
343 | #endif | ||
344 | case 5: | ||
345 | config[n] |= GALAXY_CONFIG_MPUIRQ_5; | ||
346 | break; | ||
347 | case 7: | ||
348 | config[n] |= GALAXY_CONFIG_MPUIRQ_7; | ||
349 | break; | ||
350 | #ifdef AZT2316 | ||
351 | case 10: | ||
352 | config[n] |= GALAXY_CONFIG_MPUIRQ_10; | ||
353 | break; | ||
354 | #endif | ||
355 | default: | ||
356 | dev_err(dev, "invalid MPU IRQ %d\n", mpu_irq[n]); | ||
357 | return 0; | ||
358 | } | ||
359 | |||
360 | if (mpu_irq[n] == irq[n]) { | ||
361 | dev_err(dev, "cannot share IRQ between WSS and MPU-401\n"); | ||
362 | return 0; | ||
363 | } | ||
364 | |||
365 | fm: | ||
366 | switch (fm_port[n]) { | ||
367 | case SNDRV_AUTO_PORT: | ||
368 | dev_warn(dev, "fm_port not specified: not using OPL3\n"); | ||
369 | fm_port[n] = -1; | ||
370 | break; | ||
371 | case 0x388: | ||
372 | break; | ||
373 | default: | ||
374 | dev_err(dev, "illegal FM port %#lx\n", fm_port[n]); | ||
375 | return 0; | ||
376 | } | ||
377 | |||
378 | config[n] |= GALAXY_CONFIG_GAME_ENABLE; | ||
379 | return 1; | ||
380 | } | ||
381 | |||
382 | static int __devinit galaxy_init(struct snd_galaxy *galaxy, u8 *type) | ||
383 | { | ||
384 | u8 major; | ||
385 | u8 minor; | ||
386 | int err; | ||
387 | |||
388 | err = dsp_reset(galaxy->port); | ||
389 | if (err < 0) | ||
390 | return err; | ||
391 | |||
392 | err = dsp_get_version(galaxy->port, &major, &minor); | ||
393 | if (err < 0) | ||
394 | return err; | ||
395 | |||
396 | if (major != GALAXY_DSP_MAJOR || minor != GALAXY_DSP_MINOR) | ||
397 | return -ENODEV; | ||
398 | |||
399 | err = dsp_command(galaxy->port, DSP_COMMAND_GALAXY_8); | ||
400 | if (err < 0) | ||
401 | return err; | ||
402 | |||
403 | err = dsp_command(galaxy->port, GALAXY_COMMAND_GET_TYPE); | ||
404 | if (err < 0) | ||
405 | return err; | ||
406 | |||
407 | err = dsp_get_byte(galaxy->port, type); | ||
408 | if (err < 0) | ||
409 | return err; | ||
410 | |||
411 | return 0; | ||
412 | } | ||
413 | |||
414 | static int __devinit galaxy_set_mode(struct snd_galaxy *galaxy, u8 mode) | ||
415 | { | ||
416 | int err; | ||
417 | |||
418 | err = dsp_command(galaxy->port, DSP_COMMAND_GALAXY_9); | ||
419 | if (err < 0) | ||
420 | return err; | ||
421 | |||
422 | err = dsp_command(galaxy->port, mode); | ||
423 | if (err < 0) | ||
424 | return err; | ||
425 | |||
426 | #ifdef AZT1605 | ||
427 | /* | ||
428 | * Needed for MPU IRQ on AZT1605, but AZT2316 loses WSS again | ||
429 | */ | ||
430 | err = dsp_reset(galaxy->port); | ||
431 | if (err < 0) | ||
432 | return err; | ||
433 | #endif | ||
434 | |||
435 | return 0; | ||
436 | } | ||
437 | |||
438 | static void galaxy_set_config(struct snd_galaxy *galaxy, u32 config) | ||
439 | { | ||
440 | u8 tmp = ioread8(galaxy->config_port + CONFIG_PORT_SET); | ||
441 | int i; | ||
442 | |||
443 | iowrite8(tmp | 0x80, galaxy->config_port + CONFIG_PORT_SET); | ||
444 | for (i = 0; i < GALAXY_CONFIG_SIZE; i++) { | ||
445 | iowrite8(config, galaxy->config_port + i); | ||
446 | config >>= 8; | ||
447 | } | ||
448 | iowrite8(tmp & 0x7f, galaxy->config_port + CONFIG_PORT_SET); | ||
449 | msleep(10); | ||
450 | } | ||
451 | |||
452 | static void __devinit galaxy_config(struct snd_galaxy *galaxy, u32 config) | ||
453 | { | ||
454 | int i; | ||
455 | |||
456 | for (i = GALAXY_CONFIG_SIZE; i; i--) { | ||
457 | u8 tmp = ioread8(galaxy->config_port + i - 1); | ||
458 | galaxy->config = (galaxy->config << 8) | tmp; | ||
459 | } | ||
460 | config |= galaxy->config & GALAXY_CONFIG_MASK; | ||
461 | galaxy_set_config(galaxy, config); | ||
462 | } | ||
463 | |||
464 | static int __devinit galaxy_wss_config(struct snd_galaxy *galaxy, u8 wss_config) | ||
465 | { | ||
466 | int err; | ||
467 | |||
468 | err = wss_detect(galaxy->wss_port); | ||
469 | if (err < 0) | ||
470 | return err; | ||
471 | |||
472 | wss_set_config(galaxy->wss_port, wss_config); | ||
473 | |||
474 | err = galaxy_set_mode(galaxy, GALAXY_MODE_WSS); | ||
475 | if (err < 0) | ||
476 | return err; | ||
477 | |||
478 | return 0; | ||
479 | } | ||
480 | |||
481 | static void snd_galaxy_free(struct snd_card *card) | ||
482 | { | ||
483 | struct snd_galaxy *galaxy = card->private_data; | ||
484 | |||
485 | if (galaxy->wss_port) { | ||
486 | wss_set_config(galaxy->wss_port, 0); | ||
487 | ioport_unmap(galaxy->wss_port); | ||
488 | release_and_free_resource(galaxy->res_wss_port); | ||
489 | } | ||
490 | if (galaxy->config_port) { | ||
491 | galaxy_set_config(galaxy, galaxy->config); | ||
492 | ioport_unmap(galaxy->config_port); | ||
493 | release_and_free_resource(galaxy->res_config_port); | ||
494 | } | ||
495 | if (galaxy->port) { | ||
496 | ioport_unmap(galaxy->port); | ||
497 | release_and_free_resource(galaxy->res_port); | ||
498 | } | ||
499 | } | ||
500 | |||
501 | static int __devinit snd_galaxy_probe(struct device *dev, unsigned int n) | ||
502 | { | ||
503 | struct snd_galaxy *galaxy; | ||
504 | struct snd_wss *chip; | ||
505 | struct snd_card *card; | ||
506 | u8 type; | ||
507 | int err; | ||
508 | |||
509 | err = snd_card_create(index[n], id[n], THIS_MODULE, sizeof *galaxy, | ||
510 | &card); | ||
511 | if (err < 0) | ||
512 | return err; | ||
513 | |||
514 | snd_card_set_dev(card, dev); | ||
515 | |||
516 | card->private_free = snd_galaxy_free; | ||
517 | galaxy = card->private_data; | ||
518 | |||
519 | galaxy->res_port = request_region(port[n], 16, DRV_NAME); | ||
520 | if (!galaxy->res_port) { | ||
521 | dev_err(dev, "could not grab ports %#lx-%#lx\n", port[n], | ||
522 | port[n] + 15); | ||
523 | err = -EBUSY; | ||
524 | goto error; | ||
525 | } | ||
526 | galaxy->port = ioport_map(port[n], 16); | ||
527 | |||
528 | err = galaxy_init(galaxy, &type); | ||
529 | if (err < 0) { | ||
530 | dev_err(dev, "did not find a Sound Galaxy at %#lx\n", port[n]); | ||
531 | goto error; | ||
532 | } | ||
533 | dev_info(dev, "Sound Galaxy (type %d) found at %#lx\n", type, port[n]); | ||
534 | |||
535 | galaxy->res_config_port = request_region(port[n] + GALAXY_PORT_CONFIG, | ||
536 | 16, DRV_NAME); | ||
537 | if (!galaxy->res_config_port) { | ||
538 | dev_err(dev, "could not grab ports %#lx-%#lx\n", | ||
539 | port[n] + GALAXY_PORT_CONFIG, | ||
540 | port[n] + GALAXY_PORT_CONFIG + 15); | ||
541 | err = -EBUSY; | ||
542 | goto error; | ||
543 | } | ||
544 | galaxy->config_port = ioport_map(port[n] + GALAXY_PORT_CONFIG, 16); | ||
545 | |||
546 | galaxy_config(galaxy, config[n]); | ||
547 | |||
548 | galaxy->res_wss_port = request_region(wss_port[n], 4, DRV_NAME); | ||
549 | if (!galaxy->res_wss_port) { | ||
550 | dev_err(dev, "could not grab ports %#lx-%#lx\n", wss_port[n], | ||
551 | wss_port[n] + 3); | ||
552 | err = -EBUSY; | ||
553 | goto error; | ||
554 | } | ||
555 | galaxy->wss_port = ioport_map(wss_port[n], 4); | ||
556 | |||
557 | err = galaxy_wss_config(galaxy, wss_config[n]); | ||
558 | if (err < 0) { | ||
559 | dev_err(dev, "could not configure WSS\n"); | ||
560 | goto error; | ||
561 | } | ||
562 | |||
563 | strcpy(card->driver, DRV_NAME); | ||
564 | strcpy(card->shortname, DRV_NAME); | ||
565 | sprintf(card->longname, "%s at %#lx/%#lx, irq %d, dma %d/%d", | ||
566 | card->shortname, port[n], wss_port[n], irq[n], dma1[n], | ||
567 | dma2[n]); | ||
568 | |||
569 | err = snd_wss_create(card, wss_port[n] + 4, -1, irq[n], dma1[n], | ||
570 | dma2[n], WSS_HW_DETECT, 0, &chip); | ||
571 | if (err < 0) | ||
572 | goto error; | ||
573 | |||
574 | err = snd_wss_pcm(chip, 0, NULL); | ||
575 | if (err < 0) | ||
576 | goto error; | ||
577 | |||
578 | err = snd_wss_mixer(chip); | ||
579 | if (err < 0) | ||
580 | goto error; | ||
581 | |||
582 | err = snd_wss_timer(chip, 0, NULL); | ||
583 | if (err < 0) | ||
584 | goto error; | ||
585 | |||
586 | if (mpu_port[n] >= 0) { | ||
587 | err = snd_mpu401_uart_new(card, 0, MPU401_HW_MPU401, | ||
588 | mpu_port[n], 0, mpu_irq[n], | ||
589 | IRQF_DISABLED, NULL); | ||
590 | if (err < 0) | ||
591 | goto error; | ||
592 | } | ||
593 | |||
594 | if (fm_port[n] >= 0) { | ||
595 | struct snd_opl3 *opl3; | ||
596 | |||
597 | err = snd_opl3_create(card, fm_port[n], fm_port[n] + 2, | ||
598 | OPL3_HW_AUTO, 0, &opl3); | ||
599 | if (err < 0) { | ||
600 | dev_err(dev, "no OPL device at %#lx\n", fm_port[n]); | ||
601 | goto error; | ||
602 | } | ||
603 | err = snd_opl3_timer_new(opl3, 1, 2); | ||
604 | if (err < 0) | ||
605 | goto error; | ||
606 | |||
607 | err = snd_opl3_hwdep_new(opl3, 0, 1, NULL); | ||
608 | if (err < 0) | ||
609 | goto error; | ||
610 | } | ||
611 | |||
612 | err = snd_card_register(card); | ||
613 | if (err < 0) | ||
614 | goto error; | ||
615 | |||
616 | dev_set_drvdata(dev, card); | ||
617 | return 0; | ||
618 | |||
619 | error: | ||
620 | snd_card_free(card); | ||
621 | return err; | ||
622 | } | ||
623 | |||
624 | static int __devexit snd_galaxy_remove(struct device *dev, unsigned int n) | ||
625 | { | ||
626 | snd_card_free(dev_get_drvdata(dev)); | ||
627 | dev_set_drvdata(dev, NULL); | ||
628 | return 0; | ||
629 | } | ||
630 | |||
631 | static struct isa_driver snd_galaxy_driver = { | ||
632 | .match = snd_galaxy_match, | ||
633 | .probe = snd_galaxy_probe, | ||
634 | .remove = __devexit_p(snd_galaxy_remove), | ||
635 | |||
636 | .driver = { | ||
637 | .name = DEV_NAME | ||
638 | } | ||
639 | }; | ||
640 | |||
641 | static int __init alsa_card_galaxy_init(void) | ||
642 | { | ||
643 | return isa_register_driver(&snd_galaxy_driver, SNDRV_CARDS); | ||
644 | } | ||
645 | |||
646 | static void __exit alsa_card_galaxy_exit(void) | ||
647 | { | ||
648 | isa_unregister_driver(&snd_galaxy_driver); | ||
649 | } | ||
650 | |||
651 | module_init(alsa_card_galaxy_init); | ||
652 | module_exit(alsa_card_galaxy_exit); | ||
diff --git a/sound/isa/sgalaxy.c b/sound/isa/sgalaxy.c deleted file mode 100644 index 6fe27b9d9440..000000000000 --- a/sound/isa/sgalaxy.c +++ /dev/null | |||
@@ -1,369 +0,0 @@ | |||
1 | /* | ||
2 | * Driver for Aztech Sound Galaxy cards | ||
3 | * Copyright (c) by Christopher Butler <chrisb@sandy.force9.co.uk. | ||
4 | * | ||
5 | * I don't have documentation for this card, I based this driver on the | ||
6 | * driver for OSS/Free included in the kernel source (drivers/sound/sgalaxy.c) | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
21 | * | ||
22 | */ | ||
23 | |||
24 | #include <linux/init.h> | ||
25 | #include <linux/err.h> | ||
26 | #include <linux/isa.h> | ||
27 | #include <linux/delay.h> | ||
28 | #include <linux/time.h> | ||
29 | #include <linux/interrupt.h> | ||
30 | #include <linux/moduleparam.h> | ||
31 | #include <asm/dma.h> | ||
32 | #include <sound/core.h> | ||
33 | #include <sound/sb.h> | ||
34 | #include <sound/wss.h> | ||
35 | #include <sound/control.h> | ||
36 | #define SNDRV_LEGACY_FIND_FREE_IRQ | ||
37 | #define SNDRV_LEGACY_FIND_FREE_DMA | ||
38 | #include <sound/initval.h> | ||
39 | |||
40 | MODULE_AUTHOR("Christopher Butler <chrisb@sandy.force9.co.uk>"); | ||
41 | MODULE_DESCRIPTION("Aztech Sound Galaxy"); | ||
42 | MODULE_LICENSE("GPL"); | ||
43 | MODULE_SUPPORTED_DEVICE("{{Aztech Systems,Sound Galaxy}}"); | ||
44 | |||
45 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | ||
46 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | ||
47 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */ | ||
48 | static long sbport[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x240 */ | ||
49 | static long wssport[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x530,0xe80,0xf40,0x604 */ | ||
50 | static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 7,9,10,11 */ | ||
51 | static int dma1[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 0,1,3 */ | ||
52 | |||
53 | module_param_array(index, int, NULL, 0444); | ||
54 | MODULE_PARM_DESC(index, "Index value for Sound Galaxy soundcard."); | ||
55 | module_param_array(id, charp, NULL, 0444); | ||
56 | MODULE_PARM_DESC(id, "ID string for Sound Galaxy soundcard."); | ||
57 | module_param_array(sbport, long, NULL, 0444); | ||
58 | MODULE_PARM_DESC(sbport, "Port # for Sound Galaxy SB driver."); | ||
59 | module_param_array(wssport, long, NULL, 0444); | ||
60 | MODULE_PARM_DESC(wssport, "Port # for Sound Galaxy WSS driver."); | ||
61 | module_param_array(irq, int, NULL, 0444); | ||
62 | MODULE_PARM_DESC(irq, "IRQ # for Sound Galaxy driver."); | ||
63 | module_param_array(dma1, int, NULL, 0444); | ||
64 | MODULE_PARM_DESC(dma1, "DMA1 # for Sound Galaxy driver."); | ||
65 | |||
66 | #define SGALAXY_AUXC_LEFT 18 | ||
67 | #define SGALAXY_AUXC_RIGHT 19 | ||
68 | |||
69 | #define PFX "sgalaxy: " | ||
70 | |||
71 | /* | ||
72 | |||
73 | */ | ||
74 | |||
75 | #define AD1848P1( port, x ) ( port + c_d_c_AD1848##x ) | ||
76 | |||
77 | /* from lowlevel/sb/sb.c - to avoid having to allocate a struct snd_sb for the */ | ||
78 | /* short time we actually need it.. */ | ||
79 | |||
80 | static int snd_sgalaxy_sbdsp_reset(unsigned long port) | ||
81 | { | ||
82 | int i; | ||
83 | |||
84 | outb(1, SBP1(port, RESET)); | ||
85 | udelay(10); | ||
86 | outb(0, SBP1(port, RESET)); | ||
87 | udelay(30); | ||
88 | for (i = 0; i < 1000 && !(inb(SBP1(port, DATA_AVAIL)) & 0x80); i++); | ||
89 | if (inb(SBP1(port, READ)) != 0xaa) { | ||
90 | snd_printd("sb_reset: failed at 0x%lx!!!\n", port); | ||
91 | return -ENODEV; | ||
92 | } | ||
93 | return 0; | ||
94 | } | ||
95 | |||
96 | static int __devinit snd_sgalaxy_sbdsp_command(unsigned long port, | ||
97 | unsigned char val) | ||
98 | { | ||
99 | int i; | ||
100 | |||
101 | for (i = 10000; i; i--) | ||
102 | if ((inb(SBP1(port, STATUS)) & 0x80) == 0) { | ||
103 | outb(val, SBP1(port, COMMAND)); | ||
104 | return 1; | ||
105 | } | ||
106 | |||
107 | return 0; | ||
108 | } | ||
109 | |||
110 | static irqreturn_t snd_sgalaxy_dummy_interrupt(int irq, void *dev_id) | ||
111 | { | ||
112 | return IRQ_NONE; | ||
113 | } | ||
114 | |||
115 | static int __devinit snd_sgalaxy_setup_wss(unsigned long port, int irq, int dma) | ||
116 | { | ||
117 | static int interrupt_bits[] = {-1, -1, -1, -1, -1, -1, -1, 0x08, -1, | ||
118 | 0x10, 0x18, 0x20, -1, -1, -1, -1}; | ||
119 | static int dma_bits[] = {1, 2, 0, 3}; | ||
120 | int tmp, tmp1; | ||
121 | |||
122 | if ((tmp = inb(port + 3)) == 0xff) | ||
123 | { | ||
124 | snd_printdd("I/O address dead (0x%lx)\n", port); | ||
125 | return 0; | ||
126 | } | ||
127 | #if 0 | ||
128 | snd_printdd("WSS signature = 0x%x\n", tmp); | ||
129 | #endif | ||
130 | |||
131 | if ((tmp & 0x3f) != 0x04 && | ||
132 | (tmp & 0x3f) != 0x0f && | ||
133 | (tmp & 0x3f) != 0x00) { | ||
134 | snd_printdd("No WSS signature detected on port 0x%lx\n", | ||
135 | port + 3); | ||
136 | return 0; | ||
137 | } | ||
138 | |||
139 | #if 0 | ||
140 | snd_printdd(PFX "setting up IRQ/DMA for WSS\n"); | ||
141 | #endif | ||
142 | |||
143 | /* initialize IRQ for WSS codec */ | ||
144 | tmp = interrupt_bits[irq % 16]; | ||
145 | if (tmp < 0) | ||
146 | return -EINVAL; | ||
147 | |||
148 | if (request_irq(irq, snd_sgalaxy_dummy_interrupt, IRQF_DISABLED, "sgalaxy", NULL)) { | ||
149 | snd_printk(KERN_ERR "sgalaxy: can't grab irq %d\n", irq); | ||
150 | return -EIO; | ||
151 | } | ||
152 | |||
153 | outb(tmp | 0x40, port); | ||
154 | tmp1 = dma_bits[dma % 4]; | ||
155 | outb(tmp | tmp1, port); | ||
156 | |||
157 | free_irq(irq, NULL); | ||
158 | |||
159 | return 0; | ||
160 | } | ||
161 | |||
162 | static int __devinit snd_sgalaxy_detect(int dev, int irq, int dma) | ||
163 | { | ||
164 | #if 0 | ||
165 | snd_printdd(PFX "switching to WSS mode\n"); | ||
166 | #endif | ||
167 | |||
168 | /* switch to WSS mode */ | ||
169 | snd_sgalaxy_sbdsp_reset(sbport[dev]); | ||
170 | |||
171 | snd_sgalaxy_sbdsp_command(sbport[dev], 9); | ||
172 | snd_sgalaxy_sbdsp_command(sbport[dev], 0); | ||
173 | |||
174 | udelay(400); | ||
175 | return snd_sgalaxy_setup_wss(wssport[dev], irq, dma); | ||
176 | } | ||
177 | |||
178 | static struct snd_kcontrol_new snd_sgalaxy_controls[] = { | ||
179 | WSS_DOUBLE("Aux Playback Switch", 0, | ||
180 | SGALAXY_AUXC_LEFT, SGALAXY_AUXC_RIGHT, 7, 7, 1, 1), | ||
181 | WSS_DOUBLE("Aux Playback Volume", 0, | ||
182 | SGALAXY_AUXC_LEFT, SGALAXY_AUXC_RIGHT, 0, 0, 31, 0) | ||
183 | }; | ||
184 | |||
185 | static int __devinit snd_sgalaxy_mixer(struct snd_wss *chip) | ||
186 | { | ||
187 | struct snd_card *card = chip->card; | ||
188 | struct snd_ctl_elem_id id1, id2; | ||
189 | unsigned int idx; | ||
190 | int err; | ||
191 | |||
192 | memset(&id1, 0, sizeof(id1)); | ||
193 | memset(&id2, 0, sizeof(id2)); | ||
194 | id1.iface = id2.iface = SNDRV_CTL_ELEM_IFACE_MIXER; | ||
195 | /* reassign AUX0 to LINE */ | ||
196 | strcpy(id1.name, "Aux Playback Switch"); | ||
197 | strcpy(id2.name, "Line Playback Switch"); | ||
198 | if ((err = snd_ctl_rename_id(card, &id1, &id2)) < 0) | ||
199 | return err; | ||
200 | strcpy(id1.name, "Aux Playback Volume"); | ||
201 | strcpy(id2.name, "Line Playback Volume"); | ||
202 | if ((err = snd_ctl_rename_id(card, &id1, &id2)) < 0) | ||
203 | return err; | ||
204 | /* reassign AUX1 to FM */ | ||
205 | strcpy(id1.name, "Aux Playback Switch"); id1.index = 1; | ||
206 | strcpy(id2.name, "FM Playback Switch"); | ||
207 | if ((err = snd_ctl_rename_id(card, &id1, &id2)) < 0) | ||
208 | return err; | ||
209 | strcpy(id1.name, "Aux Playback Volume"); | ||
210 | strcpy(id2.name, "FM Playback Volume"); | ||
211 | if ((err = snd_ctl_rename_id(card, &id1, &id2)) < 0) | ||
212 | return err; | ||
213 | /* build AUX2 input */ | ||
214 | for (idx = 0; idx < ARRAY_SIZE(snd_sgalaxy_controls); idx++) { | ||
215 | err = snd_ctl_add(card, | ||
216 | snd_ctl_new1(&snd_sgalaxy_controls[idx], chip)); | ||
217 | if (err < 0) | ||
218 | return err; | ||
219 | } | ||
220 | return 0; | ||
221 | } | ||
222 | |||
223 | static int __devinit snd_sgalaxy_match(struct device *devptr, unsigned int dev) | ||
224 | { | ||
225 | if (!enable[dev]) | ||
226 | return 0; | ||
227 | if (sbport[dev] == SNDRV_AUTO_PORT) { | ||
228 | snd_printk(KERN_ERR PFX "specify SB port\n"); | ||
229 | return 0; | ||
230 | } | ||
231 | if (wssport[dev] == SNDRV_AUTO_PORT) { | ||
232 | snd_printk(KERN_ERR PFX "specify WSS port\n"); | ||
233 | return 0; | ||
234 | } | ||
235 | return 1; | ||
236 | } | ||
237 | |||
238 | static int __devinit snd_sgalaxy_probe(struct device *devptr, unsigned int dev) | ||
239 | { | ||
240 | static int possible_irqs[] = {7, 9, 10, 11, -1}; | ||
241 | static int possible_dmas[] = {1, 3, 0, -1}; | ||
242 | int err, xirq, xdma1; | ||
243 | struct snd_card *card; | ||
244 | struct snd_wss *chip; | ||
245 | |||
246 | err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card); | ||
247 | if (err < 0) | ||
248 | return err; | ||
249 | |||
250 | xirq = irq[dev]; | ||
251 | if (xirq == SNDRV_AUTO_IRQ) { | ||
252 | if ((xirq = snd_legacy_find_free_irq(possible_irqs)) < 0) { | ||
253 | snd_printk(KERN_ERR PFX "unable to find a free IRQ\n"); | ||
254 | err = -EBUSY; | ||
255 | goto _err; | ||
256 | } | ||
257 | } | ||
258 | xdma1 = dma1[dev]; | ||
259 | if (xdma1 == SNDRV_AUTO_DMA) { | ||
260 | if ((xdma1 = snd_legacy_find_free_dma(possible_dmas)) < 0) { | ||
261 | snd_printk(KERN_ERR PFX "unable to find a free DMA\n"); | ||
262 | err = -EBUSY; | ||
263 | goto _err; | ||
264 | } | ||
265 | } | ||
266 | |||
267 | if ((err = snd_sgalaxy_detect(dev, xirq, xdma1)) < 0) | ||
268 | goto _err; | ||
269 | |||
270 | err = snd_wss_create(card, wssport[dev] + 4, -1, | ||
271 | xirq, xdma1, -1, | ||
272 | WSS_HW_DETECT, 0, &chip); | ||
273 | if (err < 0) | ||
274 | goto _err; | ||
275 | card->private_data = chip; | ||
276 | |||
277 | err = snd_wss_pcm(chip, 0, NULL); | ||
278 | if (err < 0) { | ||
279 | snd_printdd(PFX "error creating new WSS PCM device\n"); | ||
280 | goto _err; | ||
281 | } | ||
282 | err = snd_wss_mixer(chip); | ||
283 | if (err < 0) { | ||
284 | snd_printdd(PFX "error creating new WSS mixer\n"); | ||
285 | goto _err; | ||
286 | } | ||
287 | if ((err = snd_sgalaxy_mixer(chip)) < 0) { | ||
288 | snd_printdd(PFX "the mixer rewrite failed\n"); | ||
289 | goto _err; | ||
290 | } | ||
291 | |||
292 | strcpy(card->driver, "Sound Galaxy"); | ||
293 | strcpy(card->shortname, "Sound Galaxy"); | ||
294 | sprintf(card->longname, "Sound Galaxy at 0x%lx, irq %d, dma %d", | ||
295 | wssport[dev], xirq, xdma1); | ||
296 | |||
297 | snd_card_set_dev(card, devptr); | ||
298 | |||
299 | if ((err = snd_card_register(card)) < 0) | ||
300 | goto _err; | ||
301 | |||
302 | dev_set_drvdata(devptr, card); | ||
303 | return 0; | ||
304 | |||
305 | _err: | ||
306 | snd_card_free(card); | ||
307 | return err; | ||
308 | } | ||
309 | |||
310 | static int __devexit snd_sgalaxy_remove(struct device *devptr, unsigned int dev) | ||
311 | { | ||
312 | snd_card_free(dev_get_drvdata(devptr)); | ||
313 | dev_set_drvdata(devptr, NULL); | ||
314 | return 0; | ||
315 | } | ||
316 | |||
317 | #ifdef CONFIG_PM | ||
318 | static int snd_sgalaxy_suspend(struct device *pdev, unsigned int n, | ||
319 | pm_message_t state) | ||
320 | { | ||
321 | struct snd_card *card = dev_get_drvdata(pdev); | ||
322 | struct snd_wss *chip = card->private_data; | ||
323 | |||
324 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); | ||
325 | chip->suspend(chip); | ||
326 | return 0; | ||
327 | } | ||
328 | |||
329 | static int snd_sgalaxy_resume(struct device *pdev, unsigned int n) | ||
330 | { | ||
331 | struct snd_card *card = dev_get_drvdata(pdev); | ||
332 | struct snd_wss *chip = card->private_data; | ||
333 | |||
334 | chip->resume(chip); | ||
335 | snd_wss_out(chip, SGALAXY_AUXC_LEFT, chip->image[SGALAXY_AUXC_LEFT]); | ||
336 | snd_wss_out(chip, SGALAXY_AUXC_RIGHT, chip->image[SGALAXY_AUXC_RIGHT]); | ||
337 | |||
338 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); | ||
339 | return 0; | ||
340 | } | ||
341 | #endif | ||
342 | |||
343 | #define DEV_NAME "sgalaxy" | ||
344 | |||
345 | static struct isa_driver snd_sgalaxy_driver = { | ||
346 | .match = snd_sgalaxy_match, | ||
347 | .probe = snd_sgalaxy_probe, | ||
348 | .remove = __devexit_p(snd_sgalaxy_remove), | ||
349 | #ifdef CONFIG_PM | ||
350 | .suspend = snd_sgalaxy_suspend, | ||
351 | .resume = snd_sgalaxy_resume, | ||
352 | #endif | ||
353 | .driver = { | ||
354 | .name = DEV_NAME | ||
355 | }, | ||
356 | }; | ||
357 | |||
358 | static int __init alsa_card_sgalaxy_init(void) | ||
359 | { | ||
360 | return isa_register_driver(&snd_sgalaxy_driver, SNDRV_CARDS); | ||
361 | } | ||
362 | |||
363 | static void __exit alsa_card_sgalaxy_exit(void) | ||
364 | { | ||
365 | isa_unregister_driver(&snd_sgalaxy_driver); | ||
366 | } | ||
367 | |||
368 | module_init(alsa_card_sgalaxy_init) | ||
369 | module_exit(alsa_card_sgalaxy_exit) | ||
diff --git a/sound/pci/trident/trident_main.c b/sound/pci/trident/trident_main.c index 6d943f6f6b70..2870a4fdc130 100644 --- a/sound/pci/trident/trident_main.c +++ b/sound/pci/trident/trident_main.c | |||
@@ -1055,7 +1055,7 @@ static int snd_trident_capture_prepare(struct snd_pcm_substream *substream) | |||
1055 | 1055 | ||
1056 | spin_lock_irq(&trident->reg_lock); | 1056 | spin_lock_irq(&trident->reg_lock); |
1057 | 1057 | ||
1058 | // Initilize the channel and set channel Mode | 1058 | // Initialize the channel and set channel Mode |
1059 | outb(0, TRID_REG(trident, LEGACY_DMAR15)); | 1059 | outb(0, TRID_REG(trident, LEGACY_DMAR15)); |
1060 | 1060 | ||
1061 | // Set DMA channel operation mode register | 1061 | // Set DMA channel operation mode register |
diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf.c b/sound/pcmcia/pdaudiocf/pdaudiocf.c index df110df52a8b..7ab9174a8a84 100644 --- a/sound/pcmcia/pdaudiocf/pdaudiocf.c +++ b/sound/pcmcia/pdaudiocf/pdaudiocf.c | |||
@@ -139,8 +139,8 @@ static int snd_pdacf_probe(struct pcmcia_device *link) | |||
139 | pdacf->p_dev = link; | 139 | pdacf->p_dev = link; |
140 | link->priv = pdacf; | 140 | link->priv = pdacf; |
141 | 141 | ||
142 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; | 142 | link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO; |
143 | link->io.NumPorts1 = 16; | 143 | link->resource[0]->end = 16; |
144 | 144 | ||
145 | link->conf.Attributes = CONF_ENABLE_IRQ | CONF_ENABLE_PULSE_IRQ; | 145 | link->conf.Attributes = CONF_ENABLE_IRQ | CONF_ENABLE_PULSE_IRQ; |
146 | link->conf.IntType = INT_MEMORY_AND_IO; | 146 | link->conf.IntType = INT_MEMORY_AND_IO; |
@@ -219,7 +219,7 @@ static int pdacf_config(struct pcmcia_device *link) | |||
219 | snd_printdd(KERN_DEBUG "pdacf_config called\n"); | 219 | snd_printdd(KERN_DEBUG "pdacf_config called\n"); |
220 | link->conf.ConfigIndex = 0x5; | 220 | link->conf.ConfigIndex = 0x5; |
221 | 221 | ||
222 | ret = pcmcia_request_io(link, &link->io); | 222 | ret = pcmcia_request_io(link); |
223 | if (ret) | 223 | if (ret) |
224 | goto failed; | 224 | goto failed; |
225 | 225 | ||
@@ -231,7 +231,8 @@ static int pdacf_config(struct pcmcia_device *link) | |||
231 | if (ret) | 231 | if (ret) |
232 | goto failed; | 232 | goto failed; |
233 | 233 | ||
234 | if (snd_pdacf_assign_resources(pdacf, link->io.BasePort1, link->irq) < 0) | 234 | if (snd_pdacf_assign_resources(pdacf, link->resource[0]->start, |
235 | link->irq) < 0) | ||
235 | goto failed; | 236 | goto failed; |
236 | 237 | ||
237 | return 0; | 238 | return 0; |
diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf.h b/sound/pcmcia/pdaudiocf/pdaudiocf.h index a0a7ec64222a..5cc3e4573074 100644 --- a/sound/pcmcia/pdaudiocf/pdaudiocf.h +++ b/sound/pcmcia/pdaudiocf/pdaudiocf.h | |||
@@ -24,7 +24,6 @@ | |||
24 | #include <sound/pcm.h> | 24 | #include <sound/pcm.h> |
25 | #include <asm/io.h> | 25 | #include <asm/io.h> |
26 | #include <linux/interrupt.h> | 26 | #include <linux/interrupt.h> |
27 | #include <pcmcia/cs_types.h> | ||
28 | #include <pcmcia/cs.h> | 27 | #include <pcmcia/cs.h> |
29 | #include <pcmcia/cistpl.h> | 28 | #include <pcmcia/cistpl.h> |
30 | #include <pcmcia/ds.h> | 29 | #include <pcmcia/ds.h> |
diff --git a/sound/pcmcia/vx/vxpocket.c b/sound/pcmcia/vx/vxpocket.c index 624b47a85f0a..a6edfc3be29a 100644 --- a/sound/pcmcia/vx/vxpocket.c +++ b/sound/pcmcia/vx/vxpocket.c | |||
@@ -159,8 +159,8 @@ static int snd_vxpocket_new(struct snd_card *card, int ibl, | |||
159 | vxp->p_dev = link; | 159 | vxp->p_dev = link; |
160 | link->priv = chip; | 160 | link->priv = chip; |
161 | 161 | ||
162 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; | 162 | link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO; |
163 | link->io.NumPorts1 = 16; | 163 | link->resource[0]->end = 16; |
164 | 164 | ||
165 | link->conf.Attributes = CONF_ENABLE_IRQ; | 165 | link->conf.Attributes = CONF_ENABLE_IRQ; |
166 | link->conf.IntType = INT_MEMORY_AND_IO; | 166 | link->conf.IntType = INT_MEMORY_AND_IO; |
@@ -226,7 +226,7 @@ static int vxpocket_config(struct pcmcia_device *link) | |||
226 | strcpy(chip->card->driver, vxp440_hw.name); | 226 | strcpy(chip->card->driver, vxp440_hw.name); |
227 | } | 227 | } |
228 | 228 | ||
229 | ret = pcmcia_request_io(link, &link->io); | 229 | ret = pcmcia_request_io(link); |
230 | if (ret) | 230 | if (ret) |
231 | goto failed; | 231 | goto failed; |
232 | 232 | ||
@@ -241,7 +241,8 @@ static int vxpocket_config(struct pcmcia_device *link) | |||
241 | chip->dev = &link->dev; | 241 | chip->dev = &link->dev; |
242 | snd_card_set_dev(chip->card, chip->dev); | 242 | snd_card_set_dev(chip->card, chip->dev); |
243 | 243 | ||
244 | if (snd_vxpocket_assign_resources(chip, link->io.BasePort1, link->irq) < 0) | 244 | if (snd_vxpocket_assign_resources(chip, link->resource[0]->start, |
245 | link->irq) < 0) | ||
245 | goto failed; | 246 | goto failed; |
246 | 247 | ||
247 | return 0; | 248 | return 0; |
diff --git a/sound/pcmcia/vx/vxpocket.h b/sound/pcmcia/vx/vxpocket.h index ea4df16a28ef..d9110669d042 100644 --- a/sound/pcmcia/vx/vxpocket.h +++ b/sound/pcmcia/vx/vxpocket.h | |||
@@ -23,7 +23,6 @@ | |||
23 | 23 | ||
24 | #include <sound/vx_core.h> | 24 | #include <sound/vx_core.h> |
25 | 25 | ||
26 | #include <pcmcia/cs_types.h> | ||
27 | #include <pcmcia/cs.h> | 26 | #include <pcmcia/cs.h> |
28 | #include <pcmcia/cistpl.h> | 27 | #include <pcmcia/cistpl.h> |
29 | #include <pcmcia/ds.h> | 28 | #include <pcmcia/ds.h> |
diff --git a/sound/soc/fsl/mpc5200_psc_ac97.c b/sound/soc/fsl/mpc5200_psc_ac97.c index e2ee220bfb7e..e7f5d50ed084 100644 --- a/sound/soc/fsl/mpc5200_psc_ac97.c +++ b/sound/soc/fsl/mpc5200_psc_ac97.c | |||
@@ -20,6 +20,7 @@ | |||
20 | 20 | ||
21 | #include <asm/time.h> | 21 | #include <asm/time.h> |
22 | #include <asm/delay.h> | 22 | #include <asm/delay.h> |
23 | #include <asm/mpc52xx.h> | ||
23 | #include <asm/mpc52xx_psc.h> | 24 | #include <asm/mpc52xx_psc.h> |
24 | 25 | ||
25 | #include "mpc5200_dma.h" | 26 | #include "mpc5200_dma.h" |
@@ -100,19 +101,32 @@ static void psc_ac97_warm_reset(struct snd_ac97 *ac97) | |||
100 | { | 101 | { |
101 | struct mpc52xx_psc __iomem *regs = psc_dma->psc_regs; | 102 | struct mpc52xx_psc __iomem *regs = psc_dma->psc_regs; |
102 | 103 | ||
104 | mutex_lock(&psc_dma->mutex); | ||
105 | |||
103 | out_be32(®s->sicr, psc_dma->sicr | MPC52xx_PSC_SICR_AWR); | 106 | out_be32(®s->sicr, psc_dma->sicr | MPC52xx_PSC_SICR_AWR); |
104 | udelay(3); | 107 | udelay(3); |
105 | out_be32(®s->sicr, psc_dma->sicr); | 108 | out_be32(®s->sicr, psc_dma->sicr); |
109 | |||
110 | mutex_unlock(&psc_dma->mutex); | ||
106 | } | 111 | } |
107 | 112 | ||
108 | static void psc_ac97_cold_reset(struct snd_ac97 *ac97) | 113 | static void psc_ac97_cold_reset(struct snd_ac97 *ac97) |
109 | { | 114 | { |
110 | struct mpc52xx_psc __iomem *regs = psc_dma->psc_regs; | 115 | struct mpc52xx_psc __iomem *regs = psc_dma->psc_regs; |
111 | 116 | ||
112 | /* Do a cold reset */ | 117 | mutex_lock(&psc_dma->mutex); |
113 | out_8(®s->op1, MPC52xx_PSC_OP_RES); | 118 | dev_dbg(psc_dma->dev, "cold reset\n"); |
114 | udelay(10); | 119 | |
115 | out_8(®s->op0, MPC52xx_PSC_OP_RES); | 120 | mpc5200_psc_ac97_gpio_reset(psc_dma->id); |
121 | |||
122 | /* Notify the PSC that a reset has occurred */ | ||
123 | out_be32(®s->sicr, psc_dma->sicr | MPC52xx_PSC_SICR_ACRB); | ||
124 | |||
125 | /* Re-enable RX and TX */ | ||
126 | out_8(®s->command, MPC52xx_PSC_TX_ENABLE | MPC52xx_PSC_RX_ENABLE); | ||
127 | |||
128 | mutex_unlock(&psc_dma->mutex); | ||
129 | |||
116 | msleep(1); | 130 | msleep(1); |
117 | psc_ac97_warm_reset(ac97); | 131 | psc_ac97_warm_reset(ac97); |
118 | } | 132 | } |
diff --git a/sound/soc/fsl/mpc8610_hpcd.c b/sound/soc/fsl/mpc8610_hpcd.c index 6a2764ee8203..3a501062c244 100644 --- a/sound/soc/fsl/mpc8610_hpcd.c +++ b/sound/soc/fsl/mpc8610_hpcd.c | |||
@@ -46,7 +46,7 @@ struct mpc8610_hpcd_data { | |||
46 | }; | 46 | }; |
47 | 47 | ||
48 | /** | 48 | /** |
49 | * mpc8610_hpcd_machine_probe: initalize the board | 49 | * mpc8610_hpcd_machine_probe: initialize the board |
50 | * | 50 | * |
51 | * This function is called when platform_device_add() is called. It is used | 51 | * This function is called when platform_device_add() is called. It is used |
52 | * to initialize the board-specific hardware. | 52 | * to initialize the board-specific hardware. |
diff --git a/sound/soc/imx/imx-ssi.c b/sound/soc/imx/imx-ssi.c index 50f51624c535..a11daa1e905b 100644 --- a/sound/soc/imx/imx-ssi.c +++ b/sound/soc/imx/imx-ssi.c | |||
@@ -23,7 +23,7 @@ | |||
23 | * between pcm data and GPIO status data changes. Our FIQ handler is not | 23 | * between pcm data and GPIO status data changes. Our FIQ handler is not |
24 | * able to handle this, hence this driver only works with 48000Hz sampling | 24 | * able to handle this, hence this driver only works with 48000Hz sampling |
25 | * rate. | 25 | * rate. |
26 | * Reading and writing AC97 registers is another challange. The core | 26 | * Reading and writing AC97 registers is another challenge. The core |
27 | * provides us status bits when the read register is updated with *another* | 27 | * provides us status bits when the read register is updated with *another* |
28 | * value. When we read the same register two times (and the register still | 28 | * value. When we read the same register two times (and the register still |
29 | * contains the same value) these status bits are not set. We work | 29 | * contains the same value) these status bits are not set. We work |
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 5299932db0b6..844ae8221a3a 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -1319,7 +1319,7 @@ cpu_dai_err: | |||
1319 | } | 1319 | } |
1320 | 1320 | ||
1321 | /* | 1321 | /* |
1322 | * Attempt to initialise any uninitalised cards. Must be called with | 1322 | * Attempt to initialise any uninitialised cards. Must be called with |
1323 | * client_mutex. | 1323 | * client_mutex. |
1324 | */ | 1324 | */ |
1325 | static void snd_soc_instantiate_cards(void) | 1325 | static void snd_soc_instantiate_cards(void) |
diff --git a/sound/sparc/amd7930.c b/sound/sparc/amd7930.c index 71221fd20944..9eb1a4e0363b 100644 --- a/sound/sparc/amd7930.c +++ b/sound/sparc/amd7930.c | |||
@@ -1010,7 +1010,7 @@ static int __devinit amd7930_sbus_probe(struct of_device *op, const struct of_de | |||
1010 | struct snd_amd7930 *amd; | 1010 | struct snd_amd7930 *amd; |
1011 | int err, irq; | 1011 | int err, irq; |
1012 | 1012 | ||
1013 | irq = op->irqs[0]; | 1013 | irq = op->archdata.irqs[0]; |
1014 | 1014 | ||
1015 | if (dev_num >= SNDRV_CARDS) | 1015 | if (dev_num >= SNDRV_CARDS) |
1016 | return -ENODEV; | 1016 | return -ENODEV; |
@@ -1075,7 +1075,7 @@ static struct of_platform_driver amd7930_sbus_driver = { | |||
1075 | 1075 | ||
1076 | static int __init amd7930_init(void) | 1076 | static int __init amd7930_init(void) |
1077 | { | 1077 | { |
1078 | return of_register_driver(&amd7930_sbus_driver, &of_bus_type); | 1078 | return of_register_platform_driver(&amd7930_sbus_driver); |
1079 | } | 1079 | } |
1080 | 1080 | ||
1081 | static void __exit amd7930_exit(void) | 1081 | static void __exit amd7930_exit(void) |
@@ -1092,7 +1092,7 @@ static void __exit amd7930_exit(void) | |||
1092 | 1092 | ||
1093 | amd7930_list = NULL; | 1093 | amd7930_list = NULL; |
1094 | 1094 | ||
1095 | of_unregister_driver(&amd7930_sbus_driver); | 1095 | of_unregister_platform_driver(&amd7930_sbus_driver); |
1096 | } | 1096 | } |
1097 | 1097 | ||
1098 | module_init(amd7930_init); | 1098 | module_init(amd7930_init); |
diff --git a/sound/sparc/cs4231.c b/sound/sparc/cs4231.c index fb4c6f2f29e5..68570ee2c9bb 100644 --- a/sound/sparc/cs4231.c +++ b/sound/sparc/cs4231.c | |||
@@ -1832,14 +1832,14 @@ static int __devinit snd_cs4231_sbus_create(struct snd_card *card, | |||
1832 | chip->c_dma.request = sbus_dma_request; | 1832 | chip->c_dma.request = sbus_dma_request; |
1833 | chip->c_dma.address = sbus_dma_addr; | 1833 | chip->c_dma.address = sbus_dma_addr; |
1834 | 1834 | ||
1835 | if (request_irq(op->irqs[0], snd_cs4231_sbus_interrupt, | 1835 | if (request_irq(op->archdata.irqs[0], snd_cs4231_sbus_interrupt, |
1836 | IRQF_SHARED, "cs4231", chip)) { | 1836 | IRQF_SHARED, "cs4231", chip)) { |
1837 | snd_printdd("cs4231-%d: Unable to grab SBUS IRQ %d\n", | 1837 | snd_printdd("cs4231-%d: Unable to grab SBUS IRQ %d\n", |
1838 | dev, op->irqs[0]); | 1838 | dev, op->archdata.irqs[0]); |
1839 | snd_cs4231_sbus_free(chip); | 1839 | snd_cs4231_sbus_free(chip); |
1840 | return -EBUSY; | 1840 | return -EBUSY; |
1841 | } | 1841 | } |
1842 | chip->irq[0] = op->irqs[0]; | 1842 | chip->irq[0] = op->archdata.irqs[0]; |
1843 | 1843 | ||
1844 | if (snd_cs4231_probe(chip) < 0) { | 1844 | if (snd_cs4231_probe(chip) < 0) { |
1845 | snd_cs4231_sbus_free(chip); | 1845 | snd_cs4231_sbus_free(chip); |
@@ -1870,7 +1870,7 @@ static int __devinit cs4231_sbus_probe(struct of_device *op, const struct of_dev | |||
1870 | card->shortname, | 1870 | card->shortname, |
1871 | rp->flags & 0xffL, | 1871 | rp->flags & 0xffL, |
1872 | (unsigned long long)rp->start, | 1872 | (unsigned long long)rp->start, |
1873 | op->irqs[0]); | 1873 | op->archdata.irqs[0]); |
1874 | 1874 | ||
1875 | err = snd_cs4231_sbus_create(card, op, dev); | 1875 | err = snd_cs4231_sbus_create(card, op, dev); |
1876 | if (err < 0) { | 1876 | if (err < 0) { |
@@ -1979,12 +1979,12 @@ static int __devinit snd_cs4231_ebus_create(struct snd_card *card, | |||
1979 | chip->c_dma.ebus_info.flags = EBUS_DMA_FLAG_USE_EBDMA_HANDLER; | 1979 | chip->c_dma.ebus_info.flags = EBUS_DMA_FLAG_USE_EBDMA_HANDLER; |
1980 | chip->c_dma.ebus_info.callback = snd_cs4231_ebus_capture_callback; | 1980 | chip->c_dma.ebus_info.callback = snd_cs4231_ebus_capture_callback; |
1981 | chip->c_dma.ebus_info.client_cookie = chip; | 1981 | chip->c_dma.ebus_info.client_cookie = chip; |
1982 | chip->c_dma.ebus_info.irq = op->irqs[0]; | 1982 | chip->c_dma.ebus_info.irq = op->archdata.irqs[0]; |
1983 | strcpy(chip->p_dma.ebus_info.name, "cs4231(play)"); | 1983 | strcpy(chip->p_dma.ebus_info.name, "cs4231(play)"); |
1984 | chip->p_dma.ebus_info.flags = EBUS_DMA_FLAG_USE_EBDMA_HANDLER; | 1984 | chip->p_dma.ebus_info.flags = EBUS_DMA_FLAG_USE_EBDMA_HANDLER; |
1985 | chip->p_dma.ebus_info.callback = snd_cs4231_ebus_play_callback; | 1985 | chip->p_dma.ebus_info.callback = snd_cs4231_ebus_play_callback; |
1986 | chip->p_dma.ebus_info.client_cookie = chip; | 1986 | chip->p_dma.ebus_info.client_cookie = chip; |
1987 | chip->p_dma.ebus_info.irq = op->irqs[1]; | 1987 | chip->p_dma.ebus_info.irq = op->archdata.irqs[1]; |
1988 | 1988 | ||
1989 | chip->p_dma.prepare = _ebus_dma_prepare; | 1989 | chip->p_dma.prepare = _ebus_dma_prepare; |
1990 | chip->p_dma.enable = _ebus_dma_enable; | 1990 | chip->p_dma.enable = _ebus_dma_enable; |
@@ -2060,7 +2060,7 @@ static int __devinit cs4231_ebus_probe(struct of_device *op, const struct of_dev | |||
2060 | sprintf(card->longname, "%s at 0x%llx, irq %d", | 2060 | sprintf(card->longname, "%s at 0x%llx, irq %d", |
2061 | card->shortname, | 2061 | card->shortname, |
2062 | op->resource[0].start, | 2062 | op->resource[0].start, |
2063 | op->irqs[0]); | 2063 | op->archdata.irqs[0]); |
2064 | 2064 | ||
2065 | err = snd_cs4231_ebus_create(card, op, dev); | 2065 | err = snd_cs4231_ebus_create(card, op, dev); |
2066 | if (err < 0) { | 2066 | if (err < 0) { |
@@ -2120,12 +2120,12 @@ static struct of_platform_driver cs4231_driver = { | |||
2120 | 2120 | ||
2121 | static int __init cs4231_init(void) | 2121 | static int __init cs4231_init(void) |
2122 | { | 2122 | { |
2123 | return of_register_driver(&cs4231_driver, &of_bus_type); | 2123 | return of_register_platform_driver(&cs4231_driver); |
2124 | } | 2124 | } |
2125 | 2125 | ||
2126 | static void __exit cs4231_exit(void) | 2126 | static void __exit cs4231_exit(void) |
2127 | { | 2127 | { |
2128 | of_unregister_driver(&cs4231_driver); | 2128 | of_unregister_platform_driver(&cs4231_driver); |
2129 | } | 2129 | } |
2130 | 2130 | ||
2131 | module_init(cs4231_init); | 2131 | module_init(cs4231_init); |
diff --git a/sound/sparc/dbri.c b/sound/sparc/dbri.c index 1557bf132e73..c421901c48d0 100644 --- a/sound/sparc/dbri.c +++ b/sound/sparc/dbri.c | |||
@@ -2608,7 +2608,7 @@ static int __devinit dbri_probe(struct of_device *op, const struct of_device_id | |||
2608 | return -ENOENT; | 2608 | return -ENOENT; |
2609 | } | 2609 | } |
2610 | 2610 | ||
2611 | irq = op->irqs[0]; | 2611 | irq = op->archdata.irqs[0]; |
2612 | if (irq <= 0) { | 2612 | if (irq <= 0) { |
2613 | printk(KERN_ERR "DBRI-%d: No IRQ.\n", dev); | 2613 | printk(KERN_ERR "DBRI-%d: No IRQ.\n", dev); |
2614 | return -ENODEV; | 2614 | return -ENODEV; |
@@ -2699,12 +2699,12 @@ static struct of_platform_driver dbri_sbus_driver = { | |||
2699 | /* Probe for the dbri chip and then attach the driver. */ | 2699 | /* Probe for the dbri chip and then attach the driver. */ |
2700 | static int __init dbri_init(void) | 2700 | static int __init dbri_init(void) |
2701 | { | 2701 | { |
2702 | return of_register_driver(&dbri_sbus_driver, &of_bus_type); | 2702 | return of_register_platform_driver(&dbri_sbus_driver); |
2703 | } | 2703 | } |
2704 | 2704 | ||
2705 | static void __exit dbri_exit(void) | 2705 | static void __exit dbri_exit(void) |
2706 | { | 2706 | { |
2707 | of_unregister_driver(&dbri_sbus_driver); | 2707 | of_unregister_platform_driver(&dbri_sbus_driver); |
2708 | } | 2708 | } |
2709 | 2709 | ||
2710 | module_init(dbri_init); | 2710 | module_init(dbri_init); |
diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c index ebd09acd186e..58ed6820a8cf 100644 --- a/sound/usb/pcm.c +++ b/sound/usb/pcm.c | |||
@@ -636,7 +636,7 @@ static int hw_rule_period_time(struct snd_pcm_hw_params *params, | |||
636 | min_datainterval = min(min_datainterval, fp->datainterval); | 636 | min_datainterval = min(min_datainterval, fp->datainterval); |
637 | } | 637 | } |
638 | if (min_datainterval == 0xff) { | 638 | if (min_datainterval == 0xff) { |
639 | hwc_debug(" --> get emtpy\n"); | 639 | hwc_debug(" --> get empty\n"); |
640 | it->empty = 1; | 640 | it->empty = 1; |
641 | return -EINVAL; | 641 | return -EINVAL; |
642 | } | 642 | } |