aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa
diff options
context:
space:
mode:
Diffstat (limited to 'sound/isa')
-rw-r--r--sound/isa/Kconfig28
-rw-r--r--sound/isa/Makefile2
-rw-r--r--sound/isa/cs423x/Makefile2
-rw-r--r--sound/isa/wss/Makefile10
-rw-r--r--sound/isa/wss/wss_lib.c (renamed from sound/isa/cs423x/cs4231_lib.c)44
5 files changed, 47 insertions, 39 deletions
diff --git a/sound/isa/Kconfig b/sound/isa/Kconfig
index 5769a13c1d9..87055568ccd 100644
--- a/sound/isa/Kconfig
+++ b/sound/isa/Kconfig
@@ -4,7 +4,7 @@ config SND_AD1848_LIB
4 tristate 4 tristate
5 select SND_PCM 5 select SND_PCM
6 6
7config SND_CS4231_LIB 7config SND_WSS_LIB
8 tristate 8 tristate
9 select SND_PCM 9 select SND_PCM
10 10
@@ -86,7 +86,7 @@ config SND_AZT2320
86 select ISAPNP 86 select ISAPNP
87 select SND_OPL3_LIB 87 select SND_OPL3_LIB
88 select SND_MPU401_UART 88 select SND_MPU401_UART
89 select SND_CS4231_LIB 89 select SND_WSS_LIB
90 help 90 help
91 Say Y here to include support for soundcards based on the 91 Say Y here to include support for soundcards based on the
92 Aztech Systems AZT2320 chip. 92 Aztech Systems AZT2320 chip.
@@ -108,7 +108,7 @@ config SND_CMI8330
108config SND_CS4231 108config SND_CS4231
109 tristate "Generic Cirrus Logic CS4231 driver" 109 tristate "Generic Cirrus Logic CS4231 driver"
110 select SND_MPU401_UART 110 select SND_MPU401_UART
111 select SND_CS4231_LIB 111 select SND_WSS_LIB
112 help 112 help
113 Say Y here to include support for CS4231 chips from Cirrus 113 Say Y here to include support for CS4231 chips from Cirrus
114 Logic - Crystal Semiconductors. 114 Logic - Crystal Semiconductors.
@@ -120,7 +120,7 @@ config SND_CS4232
120 tristate "Generic Cirrus Logic CS4232 driver" 120 tristate "Generic Cirrus Logic CS4232 driver"
121 select SND_OPL3_LIB 121 select SND_OPL3_LIB
122 select SND_MPU401_UART 122 select SND_MPU401_UART
123 select SND_CS4231_LIB 123 select SND_WSS_LIB
124 help 124 help
125 Say Y here to include support for CS4232 chips from Cirrus 125 Say Y here to include support for CS4232 chips from Cirrus
126 Logic - Crystal Semiconductors. 126 Logic - Crystal Semiconductors.
@@ -132,7 +132,7 @@ config SND_CS4236
132 tristate "Generic Cirrus Logic CS4236+ driver" 132 tristate "Generic Cirrus Logic CS4236+ driver"
133 select SND_OPL3_LIB 133 select SND_OPL3_LIB
134 select SND_MPU401_UART 134 select SND_MPU401_UART
135 select SND_CS4231_LIB 135 select SND_WSS_LIB
136 help 136 help
137 Say Y to include support for CS4235,CS4236,CS4237B,CS4238B, 137 Say Y to include support for CS4235,CS4236,CS4237B,CS4238B,
138 CS4239 chips from Cirrus Logic - Crystal Semiconductors. 138 CS4239 chips from Cirrus Logic - Crystal Semiconductors.
@@ -228,7 +228,7 @@ config SND_GUSEXTREME
228config SND_GUSMAX 228config SND_GUSMAX
229 tristate "Gravis UltraSound MAX" 229 tristate "Gravis UltraSound MAX"
230 select SND_RAWMIDI 230 select SND_RAWMIDI
231 select SND_CS4231_LIB 231 select SND_WSS_LIB
232 help 232 help
233 Say Y here to include support for Gravis UltraSound MAX 233 Say Y here to include support for Gravis UltraSound MAX
234 soundcards. 234 soundcards.
@@ -240,7 +240,7 @@ config SND_INTERWAVE
240 tristate "AMD InterWave, Gravis UltraSound PnP" 240 tristate "AMD InterWave, Gravis UltraSound PnP"
241 depends on PNP 241 depends on PNP
242 select SND_RAWMIDI 242 select SND_RAWMIDI
243 select SND_CS4231_LIB 243 select SND_WSS_LIB
244 help 244 help
245 Say Y here to include support for AMD InterWave based 245 Say Y here to include support for AMD InterWave based
246 soundcards (Gravis UltraSound Plug & Play, STB SoundRage32, 246 soundcards (Gravis UltraSound Plug & Play, STB SoundRage32,
@@ -253,7 +253,7 @@ config SND_INTERWAVE_STB
253 tristate "AMD InterWave + TEA6330T (UltraSound 32-Pro)" 253 tristate "AMD InterWave + TEA6330T (UltraSound 32-Pro)"
254 depends on PNP 254 depends on PNP
255 select SND_RAWMIDI 255 select SND_RAWMIDI
256 select SND_CS4231_LIB 256 select SND_WSS_LIB
257 help 257 help
258 Say Y here to include support for AMD InterWave based 258 Say Y here to include support for AMD InterWave based
259 soundcards with a TEA6330T bass and treble regulator 259 soundcards with a TEA6330T bass and treble regulator
@@ -266,7 +266,7 @@ config SND_OPL3SA2
266 tristate "Yamaha OPL3-SA2/SA3" 266 tristate "Yamaha OPL3-SA2/SA3"
267 select SND_OPL3_LIB 267 select SND_OPL3_LIB
268 select SND_MPU401_UART 268 select SND_MPU401_UART
269 select SND_CS4231_LIB 269 select SND_WSS_LIB
270 help 270 help
271 Say Y here to include support for Yamaha OPL3-SA2 and OPL3-SA3 271 Say Y here to include support for Yamaha OPL3-SA2 and OPL3-SA3
272 chips. 272 chips.
@@ -292,7 +292,7 @@ config SND_OPTI92X_CS4231
292 select SND_OPL3_LIB 292 select SND_OPL3_LIB
293 select SND_OPL4_LIB 293 select SND_OPL4_LIB
294 select SND_MPU401_UART 294 select SND_MPU401_UART
295 select SND_CS4231_LIB 295 select SND_WSS_LIB
296 help 296 help
297 Say Y here to include support for soundcards based on Opti 297 Say Y here to include support for soundcards based on Opti
298 82C92x chips and using a CS4231 codec. 298 82C92x chips and using a CS4231 codec.
@@ -304,7 +304,7 @@ config SND_OPTI93X
304 tristate "OPTi 82C93x" 304 tristate "OPTi 82C93x"
305 select SND_OPL3_LIB 305 select SND_OPL3_LIB
306 select SND_MPU401_UART 306 select SND_MPU401_UART
307 select SND_CS4231_LIB 307 select SND_WSS_LIB
308 help 308 help
309 Say Y here to include support for soundcards based on Opti 309 Say Y here to include support for soundcards based on Opti
310 82C93x chips. 310 82C93x chips.
@@ -315,7 +315,7 @@ config SND_OPTI93X
315config SND_MIRO 315config SND_MIRO
316 tristate "Miro miroSOUND PCM1pro/PCM12/PCM20radio driver" 316 tristate "Miro miroSOUND PCM1pro/PCM12/PCM20radio driver"
317 select SND_OPL4_LIB 317 select SND_OPL4_LIB
318 select SND_CS4231_LIB 318 select SND_WSS_LIB
319 select SND_MPU401_UART 319 select SND_MPU401_UART
320 select SND_PCM 320 select SND_PCM
321 help 321 help
@@ -384,7 +384,7 @@ config SND_SSCAPE
384 tristate "Ensoniq SoundScape PnP driver" 384 tristate "Ensoniq SoundScape PnP driver"
385 select SND_HWDEP 385 select SND_HWDEP
386 select SND_MPU401_UART 386 select SND_MPU401_UART
387 select SND_CS4231_LIB 387 select SND_WSS_LIB
388 help 388 help
389 Say Y here to include support for Ensoniq SoundScape PnP 389 Say Y here to include support for Ensoniq SoundScape PnP
390 soundcards. 390 soundcards.
@@ -397,7 +397,7 @@ config SND_WAVEFRONT
397 select FW_LOADER 397 select FW_LOADER
398 select SND_OPL3_LIB 398 select SND_OPL3_LIB
399 select SND_MPU401_UART 399 select SND_MPU401_UART
400 select SND_CS4231_LIB 400 select SND_WSS_LIB
401 help 401 help
402 Say Y here to include support for Turtle Beach Maui, Tropez 402 Say Y here to include support for Turtle Beach Maui, Tropez
403 and Tropez+ soundcards based on the Wavefront chip. 403 and Tropez+ soundcards based on the Wavefront chip.
diff --git a/sound/isa/Makefile b/sound/isa/Makefile
index c0ce7db2a1b..63af13d901a 100644
--- a/sound/isa/Makefile
+++ b/sound/isa/Makefile
@@ -27,4 +27,4 @@ obj-$(CONFIG_SND_SGALAXY) += snd-sgalaxy.o
27obj-$(CONFIG_SND_SSCAPE) += snd-sscape.o 27obj-$(CONFIG_SND_SSCAPE) += snd-sscape.o
28 28
29obj-$(CONFIG_SND) += ad1816a/ ad1848/ cs423x/ es1688/ gus/ opti9xx/ \ 29obj-$(CONFIG_SND) += ad1816a/ ad1848/ cs423x/ es1688/ gus/ opti9xx/ \
30 sb/ wavefront/ 30 sb/ wavefront/ wss/
diff --git a/sound/isa/cs423x/Makefile b/sound/isa/cs423x/Makefile
index 5067ee00193..5870ca21ab5 100644
--- a/sound/isa/cs423x/Makefile
+++ b/sound/isa/cs423x/Makefile
@@ -3,14 +3,12 @@
3# Copyright (c) 2001 by Jaroslav Kysela <perex@perex.cz> 3# Copyright (c) 2001 by Jaroslav Kysela <perex@perex.cz>
4# 4#
5 5
6snd-cs4231-lib-objs := cs4231_lib.o
7snd-cs4236-lib-objs := cs4236_lib.o 6snd-cs4236-lib-objs := cs4236_lib.o
8snd-cs4231-objs := cs4231.o 7snd-cs4231-objs := cs4231.o
9snd-cs4232-objs := cs4232.o 8snd-cs4232-objs := cs4232.o
10snd-cs4236-objs := cs4236.o 9snd-cs4236-objs := cs4236.o
11 10
12# Toplevel Module Dependency 11# Toplevel Module Dependency
13obj-$(CONFIG_SND_CS4231_LIB) += snd-cs4231-lib.o
14obj-$(CONFIG_SND_CS4231) += snd-cs4231.o 12obj-$(CONFIG_SND_CS4231) += snd-cs4231.o
15obj-$(CONFIG_SND_CS4232) += snd-cs4232.o 13obj-$(CONFIG_SND_CS4232) += snd-cs4232.o
16obj-$(CONFIG_SND_CS4236) += snd-cs4236.o snd-cs4236-lib.o 14obj-$(CONFIG_SND_CS4236) += snd-cs4236.o snd-cs4236-lib.o
diff --git a/sound/isa/wss/Makefile b/sound/isa/wss/Makefile
new file mode 100644
index 00000000000..454fee769a3
--- /dev/null
+++ b/sound/isa/wss/Makefile
@@ -0,0 +1,10 @@
1#
2# Makefile for ALSA
3# Copyright (c) 2008 by Jaroslav Kysela <perex@perex.cz>
4#
5
6snd-wss-lib-objs := wss_lib.o
7
8# Toplevel Module Dependency
9obj-$(CONFIG_SND_WSS_LIB) += snd-wss-lib.o
10
diff --git a/sound/isa/cs423x/cs4231_lib.c b/sound/isa/wss/wss_lib.c
index 521db705d17..c5795f32ed3 100644
--- a/sound/isa/cs423x/cs4231_lib.c
+++ b/sound/isa/wss/wss_lib.c
@@ -3,7 +3,7 @@
3 * Routines for control of CS4231(A)/CS4232/InterWave & compatible chips 3 * Routines for control of CS4231(A)/CS4232/InterWave & compatible chips
4 * 4 *
5 * Bugs: 5 * Bugs:
6 * - sometimes record brokes playback with WSS portion of 6 * - sometimes record brokes playback with WSS portion of
7 * Yamaha OPL3-SA3 chip 7 * Yamaha OPL3-SA3 chip
8 * - CS4231 (GUS MAX) - still trouble with occasional noises 8 * - CS4231 (GUS MAX) - still trouble with occasional noises
9 * - broken initialization? 9 * - broken initialization?
@@ -176,7 +176,7 @@ static void snd_cs4231_wait(struct snd_cs4231 *chip)
176 for (timeout = 250; 176 for (timeout = 250;
177 timeout > 0 && (cs4231_inb(chip, CS4231P(REGSEL)) & CS4231_INIT); 177 timeout > 0 && (cs4231_inb(chip, CS4231P(REGSEL)) & CS4231_INIT);
178 timeout--) 178 timeout--)
179 udelay(100); 179 udelay(100);
180} 180}
181 181
182static void snd_cs4231_outm(struct snd_cs4231 *chip, unsigned char reg, 182static void snd_cs4231_outm(struct snd_cs4231 *chip, unsigned char reg,
@@ -205,7 +205,7 @@ static void snd_cs4231_dout(struct snd_cs4231 *chip, unsigned char reg, unsigned
205 for (timeout = 250; 205 for (timeout = 250;
206 timeout > 0 && (cs4231_inb(chip, CS4231P(REGSEL)) & CS4231_INIT); 206 timeout > 0 && (cs4231_inb(chip, CS4231P(REGSEL)) & CS4231_INIT);
207 timeout--) 207 timeout--)
208 udelay(10); 208 udelay(10);
209 cs4231_outb(chip, CS4231P(REGSEL), chip->mce_bit | reg); 209 cs4231_outb(chip, CS4231P(REGSEL), chip->mce_bit | reg);
210 cs4231_outb(chip, CS4231P(REG), value); 210 cs4231_outb(chip, CS4231P(REG), value);
211 mb(); 211 mb();
@@ -322,7 +322,7 @@ static void snd_cs4231_busy_wait(struct snd_cs4231 *chip)
322 for (timeout = 250; 322 for (timeout = 250;
323 timeout > 0 && (cs4231_inb(chip, CS4231P(REGSEL)) & CS4231_INIT); 323 timeout > 0 && (cs4231_inb(chip, CS4231P(REGSEL)) & CS4231_INIT);
324 timeout--) 324 timeout--)
325 udelay(10); 325 udelay(10);
326} 326}
327 327
328void snd_cs4231_mce_up(struct snd_cs4231 *chip) 328void snd_cs4231_mce_up(struct snd_cs4231 *chip)
@@ -537,7 +537,7 @@ static void snd_cs4231_calibrate_mute(struct snd_cs4231 *chip, int mute)
537 snd_cs4231_dout(chip, CS4231_MONO_CTRL, mute ? 0xc0 : chip->image[CS4231_MONO_CTRL]); 537 snd_cs4231_dout(chip, CS4231_MONO_CTRL, mute ? 0xc0 : chip->image[CS4231_MONO_CTRL]);
538 if (chip->hardware == CS4231_HW_INTERWAVE) { 538 if (chip->hardware == CS4231_HW_INTERWAVE) {
539 snd_cs4231_dout(chip, CS4231_LEFT_MIC_INPUT, mute ? 0x80 : chip->image[CS4231_LEFT_MIC_INPUT]); 539 snd_cs4231_dout(chip, CS4231_LEFT_MIC_INPUT, mute ? 0x80 : chip->image[CS4231_LEFT_MIC_INPUT]);
540 snd_cs4231_dout(chip, CS4231_RIGHT_MIC_INPUT, mute ? 0x80 : chip->image[CS4231_RIGHT_MIC_INPUT]); 540 snd_cs4231_dout(chip, CS4231_RIGHT_MIC_INPUT, mute ? 0x80 : chip->image[CS4231_RIGHT_MIC_INPUT]);
541 snd_cs4231_dout(chip, CS4231_LINE_LEFT_OUTPUT, mute ? 0x80 : chip->image[CS4231_LINE_LEFT_OUTPUT]); 541 snd_cs4231_dout(chip, CS4231_LINE_LEFT_OUTPUT, mute ? 0x80 : chip->image[CS4231_LINE_LEFT_OUTPUT]);
542 snd_cs4231_dout(chip, CS4231_LINE_RIGHT_OUTPUT, mute ? 0x80 : chip->image[CS4231_LINE_RIGHT_OUTPUT]); 542 snd_cs4231_dout(chip, CS4231_LINE_RIGHT_OUTPUT, mute ? 0x80 : chip->image[CS4231_LINE_RIGHT_OUTPUT]);
543 } 543 }
@@ -952,7 +952,7 @@ irqreturn_t snd_cs4231_interrupt(int irq, void *dev_id)
952 if (status & CS4231_TIMER_IRQ) { 952 if (status & CS4231_TIMER_IRQ) {
953 if (chip->timer) 953 if (chip->timer)
954 snd_timer_interrupt(chip->timer, chip->timer->sticks); 954 snd_timer_interrupt(chip->timer, chip->timer->sticks);
955 } 955 }
956 if (chip->single_dma && chip->hardware != CS4231_HW_INTERWAVE) { 956 if (chip->single_dma && chip->hardware != CS4231_HW_INTERWAVE) {
957 if (status & CS4231_PLAYBACK_IRQ) { 957 if (status & CS4231_PLAYBACK_IRQ) {
958 if (chip->mode & CS4231_MODE_PLAY) { 958 if (chip->mode & CS4231_MODE_PLAY) {
@@ -1000,7 +1000,7 @@ static snd_pcm_uframes_t snd_cs4231_capture_pointer(struct snd_pcm_substream *su
1000{ 1000{
1001 struct snd_cs4231 *chip = snd_pcm_substream_chip(substream); 1001 struct snd_cs4231 *chip = snd_pcm_substream_chip(substream);
1002 size_t ptr; 1002 size_t ptr;
1003 1003
1004 if (!(chip->image[CS4231_IFACE_CTRL] & CS4231_RECORD_ENABLE)) 1004 if (!(chip->image[CS4231_IFACE_CTRL] & CS4231_RECORD_ENABLE))
1005 return 0; 1005 return 0;
1006 ptr = snd_dma_pointer(chip->dma2, chip->c_dma_size); 1006 ptr = snd_dma_pointer(chip->dma2, chip->c_dma_size);
@@ -1234,8 +1234,8 @@ static int snd_cs4231_playback_open(struct snd_pcm_substream *substream)
1234 1234
1235 /* hardware bug in InterWave chipset */ 1235 /* hardware bug in InterWave chipset */
1236 if (chip->hardware == CS4231_HW_INTERWAVE && chip->dma1 > 3) 1236 if (chip->hardware == CS4231_HW_INTERWAVE && chip->dma1 > 3)
1237 runtime->hw.formats &= ~SNDRV_PCM_FMTBIT_MU_LAW; 1237 runtime->hw.formats &= ~SNDRV_PCM_FMTBIT_MU_LAW;
1238 1238
1239 /* hardware limitation of cheap chips */ 1239 /* hardware limitation of cheap chips */
1240 if (chip->hardware == CS4231_HW_CS4235 || 1240 if (chip->hardware == CS4231_HW_CS4235 ||
1241 chip->hardware == CS4231_HW_CS4239) 1241 chip->hardware == CS4231_HW_CS4239)
@@ -1319,7 +1319,7 @@ static void snd_cs4231_suspend(struct snd_cs4231 *chip)
1319{ 1319{
1320 int reg; 1320 int reg;
1321 unsigned long flags; 1321 unsigned long flags;
1322 1322
1323 snd_pcm_suspend_all(chip->pcm); 1323 snd_pcm_suspend_all(chip->pcm);
1324 spin_lock_irqsave(&chip->reg_lock, flags); 1324 spin_lock_irqsave(&chip->reg_lock, flags);
1325 for (reg = 0; reg < 32; reg++) 1325 for (reg = 0; reg < 32; reg++)
@@ -1333,7 +1333,7 @@ static void snd_cs4231_resume(struct snd_cs4231 *chip)
1333 int reg; 1333 int reg;
1334 unsigned long flags; 1334 unsigned long flags;
1335 /* int timeout; */ 1335 /* int timeout; */
1336 1336
1337 snd_cs4231_mce_up(chip); 1337 snd_cs4231_mce_up(chip);
1338 spin_lock_irqsave(&chip->reg_lock, flags); 1338 spin_lock_irqsave(&chip->reg_lock, flags);
1339 for (reg = 0; reg < 32; reg++) { 1339 for (reg = 0; reg < 32; reg++) {
@@ -1396,7 +1396,7 @@ static int snd_cs4231_free(struct snd_cs4231 *chip)
1396static int snd_cs4231_dev_free(struct snd_device *device) 1396static int snd_cs4231_dev_free(struct snd_device *device)
1397{ 1397{
1398 struct snd_cs4231 *chip = device->device_data; 1398 struct snd_cs4231 *chip = device->device_data;
1399 return snd_cs4231_free(chip); 1399 return snd_cs4231_free(chip);
1400} 1400}
1401 1401
1402const char *snd_cs4231_chip_id(struct snd_cs4231 *chip) 1402const char *snd_cs4231_chip_id(struct snd_cs4231 *chip)
@@ -1469,7 +1469,7 @@ int snd_cs4231_create(struct snd_card *card,
1469 err = snd_cs4231_new(card, hardware, hwshare, &chip); 1469 err = snd_cs4231_new(card, hardware, hwshare, &chip);
1470 if (err < 0) 1470 if (err < 0)
1471 return err; 1471 return err;
1472 1472
1473 chip->irq = -1; 1473 chip->irq = -1;
1474 chip->dma1 = -1; 1474 chip->dma1 = -1;
1475 chip->dma2 = -1; 1475 chip->dma2 = -1;
@@ -1575,7 +1575,7 @@ int snd_cs4231_pcm(struct snd_cs4231 *chip, int device, struct snd_pcm **rpcm)
1575 1575
1576 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_cs4231_playback_ops); 1576 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_cs4231_playback_ops);
1577 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_cs4231_capture_ops); 1577 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_cs4231_capture_ops);
1578 1578
1579 /* global setup */ 1579 /* global setup */
1580 pcm->private_data = chip; 1580 pcm->private_data = chip;
1581 pcm->info_flags = 0; 1581 pcm->info_flags = 0;
@@ -1624,7 +1624,7 @@ int snd_cs4231_timer(struct snd_cs4231 *chip, int device, struct snd_timer **rti
1624 *rtimer = timer; 1624 *rtimer = timer;
1625 return 0; 1625 return 0;
1626} 1626}
1627 1627
1628/* 1628/*
1629 * MIXER part 1629 * MIXER part
1630 */ 1630 */
@@ -1663,7 +1663,7 @@ static int snd_cs4231_get_mux(struct snd_kcontrol *kcontrol, struct snd_ctl_elem
1663{ 1663{
1664 struct snd_cs4231 *chip = snd_kcontrol_chip(kcontrol); 1664 struct snd_cs4231 *chip = snd_kcontrol_chip(kcontrol);
1665 unsigned long flags; 1665 unsigned long flags;
1666 1666
1667 spin_lock_irqsave(&chip->reg_lock, flags); 1667 spin_lock_irqsave(&chip->reg_lock, flags);
1668 ucontrol->value.enumerated.item[0] = (chip->image[CS4231_LEFT_INPUT] & CS4231_MIXS_ALL) >> 6; 1668 ucontrol->value.enumerated.item[0] = (chip->image[CS4231_LEFT_INPUT] & CS4231_MIXS_ALL) >> 6;
1669 ucontrol->value.enumerated.item[1] = (chip->image[CS4231_RIGHT_INPUT] & CS4231_MIXS_ALL) >> 6; 1669 ucontrol->value.enumerated.item[1] = (chip->image[CS4231_RIGHT_INPUT] & CS4231_MIXS_ALL) >> 6;
@@ -1677,7 +1677,7 @@ static int snd_cs4231_put_mux(struct snd_kcontrol *kcontrol, struct snd_ctl_elem
1677 unsigned long flags; 1677 unsigned long flags;
1678 unsigned short left, right; 1678 unsigned short left, right;
1679 int change; 1679 int change;
1680 1680
1681 if (ucontrol->value.enumerated.item[0] > 3 || 1681 if (ucontrol->value.enumerated.item[0] > 3 ||
1682 ucontrol->value.enumerated.item[1] > 3) 1682 ucontrol->value.enumerated.item[1] > 3)
1683 return -EINVAL; 1683 return -EINVAL;
@@ -1713,7 +1713,7 @@ int snd_cs4231_get_single(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_val
1713 int shift = (kcontrol->private_value >> 8) & 0xff; 1713 int shift = (kcontrol->private_value >> 8) & 0xff;
1714 int mask = (kcontrol->private_value >> 16) & 0xff; 1714 int mask = (kcontrol->private_value >> 16) & 0xff;
1715 int invert = (kcontrol->private_value >> 24) & 0xff; 1715 int invert = (kcontrol->private_value >> 24) & 0xff;
1716 1716
1717 spin_lock_irqsave(&chip->reg_lock, flags); 1717 spin_lock_irqsave(&chip->reg_lock, flags);
1718 ucontrol->value.integer.value[0] = (chip->image[reg] >> shift) & mask; 1718 ucontrol->value.integer.value[0] = (chip->image[reg] >> shift) & mask;
1719 spin_unlock_irqrestore(&chip->reg_lock, flags); 1719 spin_unlock_irqrestore(&chip->reg_lock, flags);
@@ -1732,7 +1732,7 @@ int snd_cs4231_put_single(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_val
1732 int invert = (kcontrol->private_value >> 24) & 0xff; 1732 int invert = (kcontrol->private_value >> 24) & 0xff;
1733 int change; 1733 int change;
1734 unsigned short val; 1734 unsigned short val;
1735 1735
1736 val = (ucontrol->value.integer.value[0] & mask); 1736 val = (ucontrol->value.integer.value[0] & mask);
1737 if (invert) 1737 if (invert)
1738 val = mask - val; 1738 val = mask - val;
@@ -1766,7 +1766,7 @@ int snd_cs4231_get_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_val
1766 int shift_right = (kcontrol->private_value >> 19) & 0x07; 1766 int shift_right = (kcontrol->private_value >> 19) & 0x07;
1767 int mask = (kcontrol->private_value >> 24) & 0xff; 1767 int mask = (kcontrol->private_value >> 24) & 0xff;
1768 int invert = (kcontrol->private_value >> 22) & 1; 1768 int invert = (kcontrol->private_value >> 22) & 1;
1769 1769
1770 spin_lock_irqsave(&chip->reg_lock, flags); 1770 spin_lock_irqsave(&chip->reg_lock, flags);
1771 ucontrol->value.integer.value[0] = (chip->image[left_reg] >> shift_left) & mask; 1771 ucontrol->value.integer.value[0] = (chip->image[left_reg] >> shift_left) & mask;
1772 ucontrol->value.integer.value[1] = (chip->image[right_reg] >> shift_right) & mask; 1772 ucontrol->value.integer.value[1] = (chip->image[right_reg] >> shift_right) & mask;
@@ -1790,7 +1790,7 @@ int snd_cs4231_put_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_val
1790 int invert = (kcontrol->private_value >> 22) & 1; 1790 int invert = (kcontrol->private_value >> 22) & 1;
1791 int change; 1791 int change;
1792 unsigned short val1, val2; 1792 unsigned short val1, val2;
1793 1793
1794 val1 = ucontrol->value.integer.value[0] & mask; 1794 val1 = ucontrol->value.integer.value[0] & mask;
1795 val2 = ucontrol->value.integer.value[1] & mask; 1795 val2 = ucontrol->value.integer.value[1] & mask;
1796 if (invert) { 1796 if (invert) {
@@ -1834,7 +1834,7 @@ CS4231_DOUBLE("Mic Boost", 0, CS4231_LEFT_INPUT, CS4231_RIGHT_INPUT, 5, 5, 1, 0)
1834CS4231_SINGLE("Loopback Capture Switch", 0, CS4231_LOOPBACK, 0, 1, 0), 1834CS4231_SINGLE("Loopback Capture Switch", 0, CS4231_LOOPBACK, 0, 1, 0),
1835CS4231_SINGLE("Loopback Capture Volume", 0, CS4231_LOOPBACK, 2, 63, 1) 1835CS4231_SINGLE("Loopback Capture Volume", 0, CS4231_LOOPBACK, 2, 63, 1)
1836}; 1836};
1837 1837
1838static struct snd_kcontrol_new snd_opti93x_controls[] = { 1838static struct snd_kcontrol_new snd_opti93x_controls[] = {
1839CS4231_DOUBLE("Master Playback Switch", 0, 1839CS4231_DOUBLE("Master Playback Switch", 0,
1840 OPTi93X_OUT_LEFT, OPTi93X_OUT_RIGHT, 7, 7, 1, 1), 1840 OPTi93X_OUT_LEFT, OPTi93X_OUT_RIGHT, 7, 7, 1, 1),