Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA: wss_lib: move cs4231_lib into wss_lib

Move the file sound/isa/cs423x/cs4231_lib.c
into sound/isa/cs423x/wss_lib.c
This is the first step toward merging all libraries
for Windows Sound System compatible chips
into a single library.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Reviewed-by: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>

authored by

Krzysztof Helt and committed by
Jaroslav Kysela
9295aea1 740dc9c4

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