Skip to content

Commit 9295aea

Browse files
Krzysztof-Hperexg
authored andcommitted
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>
1 parent 740dc9c commit 9295aea

5 files changed

Lines changed: 47 additions & 39 deletions

File tree

‎sound/isa/Kconfig‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ config SND_AD1848_LIB
44
tristate
55
select SND_PCM
66

7-
config SND_CS4231_LIB
7+
config SND_WSS_LIB
88
tristate
99
select SND_PCM
1010

@@ -86,7 +86,7 @@ config SND_AZT2320
8686
select ISAPNP
8787
select SND_OPL3_LIB
8888
select SND_MPU401_UART
89-
select SND_CS4231_LIB
89+
select SND_WSS_LIB
9090
help
9191
Say Y here to include support for soundcards based on the
9292
Aztech Systems AZT2320 chip.
@@ -108,7 +108,7 @@ config SND_CMI8330
108108
config SND_CS4231
109109
tristate "Generic Cirrus Logic CS4231 driver"
110110
select SND_MPU401_UART
111-
select SND_CS4231_LIB
111+
select SND_WSS_LIB
112112
help
113113
Say Y here to include support for CS4231 chips from Cirrus
114114
Logic - Crystal Semiconductors.
@@ -120,7 +120,7 @@ config SND_CS4232
120120
tristate "Generic Cirrus Logic CS4232 driver"
121121
select SND_OPL3_LIB
122122
select SND_MPU401_UART
123-
select SND_CS4231_LIB
123+
select SND_WSS_LIB
124124
help
125125
Say Y here to include support for CS4232 chips from Cirrus
126126
Logic - Crystal Semiconductors.
@@ -132,7 +132,7 @@ config SND_CS4236
132132
tristate "Generic Cirrus Logic CS4236+ driver"
133133
select SND_OPL3_LIB
134134
select SND_MPU401_UART
135-
select SND_CS4231_LIB
135+
select SND_WSS_LIB
136136
help
137137
Say Y to include support for CS4235,CS4236,CS4237B,CS4238B,
138138
CS4239 chips from Cirrus Logic - Crystal Semiconductors.
@@ -228,7 +228,7 @@ config SND_GUSEXTREME
228228
config SND_GUSMAX
229229
tristate "Gravis UltraSound MAX"
230230
select SND_RAWMIDI
231-
select SND_CS4231_LIB
231+
select SND_WSS_LIB
232232
help
233233
Say Y here to include support for Gravis UltraSound MAX
234234
soundcards.
@@ -240,7 +240,7 @@ config SND_INTERWAVE
240240
tristate "AMD InterWave, Gravis UltraSound PnP"
241241
depends on PNP
242242
select SND_RAWMIDI
243-
select SND_CS4231_LIB
243+
select SND_WSS_LIB
244244
help
245245
Say Y here to include support for AMD InterWave based
246246
soundcards (Gravis UltraSound Plug & Play, STB SoundRage32,
@@ -253,7 +253,7 @@ config SND_INTERWAVE_STB
253253
tristate "AMD InterWave + TEA6330T (UltraSound 32-Pro)"
254254
depends on PNP
255255
select SND_RAWMIDI
256-
select SND_CS4231_LIB
256+
select SND_WSS_LIB
257257
help
258258
Say Y here to include support for AMD InterWave based
259259
soundcards with a TEA6330T bass and treble regulator
@@ -266,7 +266,7 @@ config SND_OPL3SA2
266266
tristate "Yamaha OPL3-SA2/SA3"
267267
select SND_OPL3_LIB
268268
select SND_MPU401_UART
269-
select SND_CS4231_LIB
269+
select SND_WSS_LIB
270270
help
271271
Say Y here to include support for Yamaha OPL3-SA2 and OPL3-SA3
272272
chips.
@@ -292,7 +292,7 @@ config SND_OPTI92X_CS4231
292292
select SND_OPL3_LIB
293293
select SND_OPL4_LIB
294294
select SND_MPU401_UART
295-
select SND_CS4231_LIB
295+
select SND_WSS_LIB
296296
help
297297
Say Y here to include support for soundcards based on Opti
298298
82C92x chips and using a CS4231 codec.
@@ -304,7 +304,7 @@ config SND_OPTI93X
304304
tristate "OPTi 82C93x"
305305
select SND_OPL3_LIB
306306
select SND_MPU401_UART
307-
select SND_CS4231_LIB
307+
select SND_WSS_LIB
308308
help
309309
Say Y here to include support for soundcards based on Opti
310310
82C93x chips.
@@ -315,7 +315,7 @@ config SND_OPTI93X
315315
config SND_MIRO
316316
tristate "Miro miroSOUND PCM1pro/PCM12/PCM20radio driver"
317317
select SND_OPL4_LIB
318-
select SND_CS4231_LIB
318+
select SND_WSS_LIB
319319
select SND_MPU401_UART
320320
select SND_PCM
321321
help
@@ -384,7 +384,7 @@ config SND_SSCAPE
384384
tristate "Ensoniq SoundScape PnP driver"
385385
select SND_HWDEP
386386
select SND_MPU401_UART
387-
select SND_CS4231_LIB
387+
select SND_WSS_LIB
388388
help
389389
Say Y here to include support for Ensoniq SoundScape PnP
390390
soundcards.
@@ -397,7 +397,7 @@ config SND_WAVEFRONT
397397
select FW_LOADER
398398
select SND_OPL3_LIB
399399
select SND_MPU401_UART
400-
select SND_CS4231_LIB
400+
select SND_WSS_LIB
401401
help
402402
Say Y here to include support for Turtle Beach Maui, Tropez
403403
and Tropez+ soundcards based on the Wavefront chip.

‎sound/isa/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ obj-$(CONFIG_SND_SGALAXY) += snd-sgalaxy.o
2727
obj-$(CONFIG_SND_SSCAPE) += snd-sscape.o
2828

2929
obj-$(CONFIG_SND) += ad1816a/ ad1848/ cs423x/ es1688/ gus/ opti9xx/ \
30-
sb/ wavefront/
30+
sb/ wavefront/ wss/

‎sound/isa/cs423x/Makefile‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@
33
# Copyright (c) 2001 by Jaroslav Kysela <perex@perex.cz>
44
#
55

6-
snd-cs4231-lib-objs := cs4231_lib.o
76
snd-cs4236-lib-objs := cs4236_lib.o
87
snd-cs4231-objs := cs4231.o
98
snd-cs4232-objs := cs4232.o
109
snd-cs4236-objs := cs4236.o
1110

1211
# Toplevel Module Dependency
13-
obj-$(CONFIG_SND_CS4231_LIB) += snd-cs4231-lib.o
1412
obj-$(CONFIG_SND_CS4231) += snd-cs4231.o
1513
obj-$(CONFIG_SND_CS4232) += snd-cs4232.o
1614
obj-$(CONFIG_SND_CS4236) += snd-cs4236.o snd-cs4236-lib.o

‎sound/isa/wss/Makefile‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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+
Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Routines for control of CS4231(A)/CS4232/InterWave & compatible chips
44
*
55
* Bugs:
6-
* - sometimes record brokes playback with WSS portion of
6+
* - sometimes record brokes playback with WSS portion of
77
* Yamaha OPL3-SA3 chip
88
* - CS4231 (GUS MAX) - still trouble with occasional noises
99
* - broken initialization?
@@ -176,7 +176,7 @@ static void snd_cs4231_wait(struct snd_cs4231 *chip)
176176
for (timeout = 250;
177177
timeout > 0 && (cs4231_inb(chip, CS4231P(REGSEL)) & CS4231_INIT);
178178
timeout--)
179-
udelay(100);
179+
udelay(100);
180180
}
181181

182182
static 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
205205
for (timeout = 250;
206206
timeout > 0 && (cs4231_inb(chip, CS4231P(REGSEL)) & CS4231_INIT);
207207
timeout--)
208-
udelay(10);
208+
udelay(10);
209209
cs4231_outb(chip, CS4231P(REGSEL), chip->mce_bit | reg);
210210
cs4231_outb(chip, CS4231P(REG), value);
211211
mb();
@@ -322,7 +322,7 @@ static void snd_cs4231_busy_wait(struct snd_cs4231 *chip)
322322
for (timeout = 250;
323323
timeout > 0 && (cs4231_inb(chip, CS4231P(REGSEL)) & CS4231_INIT);
324324
timeout--)
325-
udelay(10);
325+
udelay(10);
326326
}
327327

328328
void snd_cs4231_mce_up(struct snd_cs4231 *chip)
@@ -537,7 +537,7 @@ static void snd_cs4231_calibrate_mute(struct snd_cs4231 *chip, int mute)
537537
snd_cs4231_dout(chip, CS4231_MONO_CTRL, mute ? 0xc0 : chip->image[CS4231_MONO_CTRL]);
538538
if (chip->hardware == CS4231_HW_INTERWAVE) {
539539
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]);
541541
snd_cs4231_dout(chip, CS4231_LINE_LEFT_OUTPUT, mute ? 0x80 : chip->image[CS4231_LINE_LEFT_OUTPUT]);
542542
snd_cs4231_dout(chip, CS4231_LINE_RIGHT_OUTPUT, mute ? 0x80 : chip->image[CS4231_LINE_RIGHT_OUTPUT]);
543543
}
@@ -952,7 +952,7 @@ irqreturn_t snd_cs4231_interrupt(int irq, void *dev_id)
952952
if (status & CS4231_TIMER_IRQ) {
953953
if (chip->timer)
954954
snd_timer_interrupt(chip->timer, chip->timer->sticks);
955-
}
955+
}
956956
if (chip->single_dma && chip->hardware != CS4231_HW_INTERWAVE) {
957957
if (status & CS4231_PLAYBACK_IRQ) {
958958
if (chip->mode & CS4231_MODE_PLAY) {
@@ -1000,7 +1000,7 @@ static snd_pcm_uframes_t snd_cs4231_capture_pointer(struct snd_pcm_substream *su
10001000
{
10011001
struct snd_cs4231 *chip = snd_pcm_substream_chip(substream);
10021002
size_t ptr;
1003-
1003+
10041004
if (!(chip->image[CS4231_IFACE_CTRL] & CS4231_RECORD_ENABLE))
10051005
return 0;
10061006
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)
12341234

12351235
/* hardware bug in InterWave chipset */
12361236
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+
12391239
/* hardware limitation of cheap chips */
12401240
if (chip->hardware == CS4231_HW_CS4235 ||
12411241
chip->hardware == CS4231_HW_CS4239)
@@ -1319,7 +1319,7 @@ static void snd_cs4231_suspend(struct snd_cs4231 *chip)
13191319
{
13201320
int reg;
13211321
unsigned long flags;
1322-
1322+
13231323
snd_pcm_suspend_all(chip->pcm);
13241324
spin_lock_irqsave(&chip->reg_lock, flags);
13251325
for (reg = 0; reg < 32; reg++)
@@ -1333,7 +1333,7 @@ static void snd_cs4231_resume(struct snd_cs4231 *chip)
13331333
int reg;
13341334
unsigned long flags;
13351335
/* int timeout; */
1336-
1336+
13371337
snd_cs4231_mce_up(chip);
13381338
spin_lock_irqsave(&chip->reg_lock, flags);
13391339
for (reg = 0; reg < 32; reg++) {
@@ -1396,7 +1396,7 @@ static int snd_cs4231_free(struct snd_cs4231 *chip)
13961396
static int snd_cs4231_dev_free(struct snd_device *device)
13971397
{
13981398
struct snd_cs4231 *chip = device->device_data;
1399-
return snd_cs4231_free(chip);
1399+
return snd_cs4231_free(chip);
14001400
}
14011401

14021402
const char *snd_cs4231_chip_id(struct snd_cs4231 *chip)
@@ -1469,7 +1469,7 @@ int snd_cs4231_create(struct snd_card *card,
14691469
err = snd_cs4231_new(card, hardware, hwshare, &chip);
14701470
if (err < 0)
14711471
return err;
1472-
1472+
14731473
chip->irq = -1;
14741474
chip->dma1 = -1;
14751475
chip->dma2 = -1;
@@ -1575,7 +1575,7 @@ int snd_cs4231_pcm(struct snd_cs4231 *chip, int device, struct snd_pcm **rpcm)
15751575

15761576
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_cs4231_playback_ops);
15771577
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_cs4231_capture_ops);
1578-
1578+
15791579
/* global setup */
15801580
pcm->private_data = chip;
15811581
pcm->info_flags = 0;
@@ -1624,7 +1624,7 @@ int snd_cs4231_timer(struct snd_cs4231 *chip, int device, struct snd_timer **rti
16241624
*rtimer = timer;
16251625
return 0;
16261626
}
1627-
1627+
16281628
/*
16291629
* MIXER part
16301630
*/
@@ -1663,7 +1663,7 @@ static int snd_cs4231_get_mux(struct snd_kcontrol *kcontrol, struct snd_ctl_elem
16631663
{
16641664
struct snd_cs4231 *chip = snd_kcontrol_chip(kcontrol);
16651665
unsigned long flags;
1666-
1666+
16671667
spin_lock_irqsave(&chip->reg_lock, flags);
16681668
ucontrol->value.enumerated.item[0] = (chip->image[CS4231_LEFT_INPUT] & CS4231_MIXS_ALL) >> 6;
16691669
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
16771677
unsigned long flags;
16781678
unsigned short left, right;
16791679
int change;
1680-
1680+
16811681
if (ucontrol->value.enumerated.item[0] > 3 ||
16821682
ucontrol->value.enumerated.item[1] > 3)
16831683
return -EINVAL;
@@ -1713,7 +1713,7 @@ int snd_cs4231_get_single(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_val
17131713
int shift = (kcontrol->private_value >> 8) & 0xff;
17141714
int mask = (kcontrol->private_value >> 16) & 0xff;
17151715
int invert = (kcontrol->private_value >> 24) & 0xff;
1716-
1716+
17171717
spin_lock_irqsave(&chip->reg_lock, flags);
17181718
ucontrol->value.integer.value[0] = (chip->image[reg] >> shift) & mask;
17191719
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
17321732
int invert = (kcontrol->private_value >> 24) & 0xff;
17331733
int change;
17341734
unsigned short val;
1735-
1735+
17361736
val = (ucontrol->value.integer.value[0] & mask);
17371737
if (invert)
17381738
val = mask - val;
@@ -1766,7 +1766,7 @@ int snd_cs4231_get_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_val
17661766
int shift_right = (kcontrol->private_value >> 19) & 0x07;
17671767
int mask = (kcontrol->private_value >> 24) & 0xff;
17681768
int invert = (kcontrol->private_value >> 22) & 1;
1769-
1769+
17701770
spin_lock_irqsave(&chip->reg_lock, flags);
17711771
ucontrol->value.integer.value[0] = (chip->image[left_reg] >> shift_left) & mask;
17721772
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
17901790
int invert = (kcontrol->private_value >> 22) & 1;
17911791
int change;
17921792
unsigned short val1, val2;
1793-
1793+
17941794
val1 = ucontrol->value.integer.value[0] & mask;
17951795
val2 = ucontrol->value.integer.value[1] & mask;
17961796
if (invert) {
@@ -1834,7 +1834,7 @@ CS4231_DOUBLE("Mic Boost", 0, CS4231_LEFT_INPUT, CS4231_RIGHT_INPUT, 5, 5, 1, 0)
18341834
CS4231_SINGLE("Loopback Capture Switch", 0, CS4231_LOOPBACK, 0, 1, 0),
18351835
CS4231_SINGLE("Loopback Capture Volume", 0, CS4231_LOOPBACK, 2, 63, 1)
18361836
};
1837-
1837+
18381838
static struct snd_kcontrol_new snd_opti93x_controls[] = {
18391839
CS4231_DOUBLE("Master Playback Switch", 0,
18401840
OPTi93X_OUT_LEFT, OPTi93X_OUT_RIGHT, 7, 7, 1, 1),

0 commit comments

Comments
 (0)