20 #include <linux/kernel.h>
22 #include <linux/poll.h>
24 #include <linux/slab.h>
26 #include <linux/export.h>
34 #define G723_INTR_ORDER 0
35 #define G723_FDMA_PAGES 32
36 #define G723_PERIOD_BYTES 48
37 #define G723_PERIOD_BLOCK 1024
38 #define G723_FRAMES_PER_PAGE 48
41 #define OUTMODE_MASK 0x300
43 #define SAMPLERATE 8000
49 #define MAX_BUFFER (G723_PERIOD_BYTES * PERIODS_MAX)
51 #define PERIODS_MIN (1 << IRQ_PAGES)
52 #define PERIODS_MAX G723_FDMA_PAGES
141 solo_pcm = kzalloc(
sizeof(*solo_pcm),
GFP_KERNEL);
142 if (solo_pcm ==
NULL)
147 ss->
runtime->hw = snd_solo_pcm_hw;
167 struct solo_dev *solo_dev = solo_pcm->
solo_dev;
170 spin_lock(&solo_pcm->
lock);
174 if (solo_pcm->
on == 0) {
193 spin_unlock(&solo_pcm->
lock);
206 struct solo_dev *solo_dev = solo_pcm->
solo_dev;
217 struct solo_dev *solo_dev = solo_pcm->
solo_dev;
233 solo_pcm->
g723_buf, G723_PERIOD_BYTES);
243 .open = snd_solo_pcm_open,
244 .close = snd_solo_pcm_close,
246 .hw_params = snd_solo_hw_params,
247 .hw_free = snd_solo_hw_free,
248 .prepare = snd_solo_pcm_prepare,
249 .trigger = snd_solo_pcm_trigger,
250 .pointer = snd_solo_pcm_pointer,
251 .copy = snd_solo_pcm_copy,
254 static int snd_solo_capture_volume_info(
struct snd_kcontrol *kcontrol,
266 static int snd_solo_capture_volume_get(
struct snd_kcontrol *kcontrol,
270 u8 ch = value->
id.numid - 1;
277 static int snd_solo_capture_volume_put(
struct snd_kcontrol *kcontrol,
281 u8 ch = value->
id.numid - 1;
285 if (old_val == value->
value.integer.value[0])
295 .name =
"Capture Volume",
296 .info = snd_solo_capture_volume_info,
297 .get = snd_solo_capture_volume_get,
298 .put = snd_solo_capture_volume_put,
301 static int solo_snd_pcm_init(
struct solo_dev *solo_dev)
322 ss; ss = ss->
next, i++)
348 sprintf(name,
"Softlogic%d", solo_dev->
vfd->num);
360 pci_name(solo_dev->
pdev), solo_dev->
pdev->irq);
369 kctl = snd_solo_capture_volume;
375 ret = solo_snd_pcm_init(solo_dev);
383 solo_g723_config(solo_dev);
385 dev_info(&solo_dev->
pdev->dev,
"Alsa sound card as %s\n", name);