blob: ae816e78f5991fd115d0a605d99d58ca8acdf277 [file] [log] [blame]
Thomas Gleixner873e65b2019-05-27 08:55:15 +02001// SPDX-License-Identifier: GPL-2.0-only
Giuliano Pochinidd7b2542006-06-28 13:53:41 +02002/*
3 * ALSA driver for Echoaudio soundcards.
4 * Copyright (C) 2003-2004 Giuliano Pochini <pochini@shiny.it>
Giuliano Pochinidd7b2542006-06-28 13:53:41 +02005 */
6
7#define ECHOGALS_FAMILY
8#define ECHOCARD_DARLA24
9#define ECHOCARD_NAME "Darla24"
10#define ECHOCARD_HAS_MONITOR
11#define ECHOCARD_HAS_INPUT_NOMINAL_LEVEL
12#define ECHOCARD_HAS_OUTPUT_NOMINAL_LEVEL
13#define ECHOCARD_HAS_EXTERNAL_CLOCK
14#define ECHOCARD_HAS_SUPER_INTERLEAVE
15
16/* Pipe indexes */
17#define PX_ANALOG_OUT 0 /* 8 */
18#define PX_DIGITAL_OUT 8 /* 0 */
19#define PX_ANALOG_IN 8 /* 2 */
20#define PX_DIGITAL_IN 10 /* 0 */
21#define PX_NUM 10
22
23/* Bus indexes */
24#define BX_ANALOG_OUT 0 /* 8 */
25#define BX_DIGITAL_OUT 8 /* 0 */
26#define BX_ANALOG_IN 8 /* 2 */
27#define BX_DIGITAL_IN 10 /* 0 */
28#define BX_NUM 10
29
30
Giuliano Pochinidd7b2542006-06-28 13:53:41 +020031#include <linux/delay.h>
32#include <linux/init.h>
33#include <linux/interrupt.h>
34#include <linux/pci.h>
Paul Gortmaker65a77212011-07-15 13:13:37 -040035#include <linux/module.h>
Giuliano Pochinidd7b2542006-06-28 13:53:41 +020036#include <linux/firmware.h>
Tejun Heo5a0e3ad2010-03-24 17:04:11 +090037#include <linux/slab.h>
Takashi Iwai6cbbfe12015-01-28 16:49:33 +010038#include <linux/io.h>
Giuliano Pochinidd7b2542006-06-28 13:53:41 +020039#include <sound/core.h>
40#include <sound/info.h>
41#include <sound/control.h>
Giuliano Pochini048b9452006-11-24 13:03:58 +010042#include <sound/tlv.h>
Giuliano Pochinidd7b2542006-06-28 13:53:41 +020043#include <sound/pcm.h>
44#include <sound/pcm_params.h>
45#include <sound/asoundef.h>
46#include <sound/initval.h>
Arun Sharma600634972011-07-26 16:09:06 -070047#include <linux/atomic.h>
Giuliano Pochinidd7b2542006-06-28 13:53:41 +020048#include "echoaudio.h"
49
Clemens Ladisch7e0af292007-05-03 17:59:54 +020050MODULE_FIRMWARE("ea/darla24_dsp.fw");
51
Giuliano Pochinidd7b2542006-06-28 13:53:41 +020052#define FW_DARLA24_DSP 0
53
54static const struct firmware card_fw[] = {
55 {0, "darla24_dsp.fw"}
56};
57
Benoit Taine9baa3c32014-08-08 15:56:03 +020058static const struct pci_device_id snd_echo_ids[] = {
Giuliano Pochinidd7b2542006-06-28 13:53:41 +020059 {0x1057, 0x1801, 0xECC0, 0x0040, 0, 0, 0}, /* DSP 56301 Darla24 rev.0 */
60 {0x1057, 0x1801, 0xECC0, 0x0041, 0, 0, 0}, /* DSP 56301 Darla24 rev.1 */
61 {0,}
62};
63
Takashi Iwaic1c39812020-01-03 09:16:17 +010064static const struct snd_pcm_hardware pcm_hardware_skel = {
Giuliano Pochinidd7b2542006-06-28 13:53:41 +020065 .info = SNDRV_PCM_INFO_MMAP |
66 SNDRV_PCM_INFO_INTERLEAVED |
67 SNDRV_PCM_INFO_BLOCK_TRANSFER |
68 SNDRV_PCM_INFO_MMAP_VALID |
69 SNDRV_PCM_INFO_PAUSE |
70 SNDRV_PCM_INFO_SYNC_START,
71 .formats = SNDRV_PCM_FMTBIT_U8 |
72 SNDRV_PCM_FMTBIT_S16_LE |
73 SNDRV_PCM_FMTBIT_S24_3LE |
74 SNDRV_PCM_FMTBIT_S32_LE |
75 SNDRV_PCM_FMTBIT_S32_BE,
76 .rates = SNDRV_PCM_RATE_8000_48000 |
77 SNDRV_PCM_RATE_88200 |
78 SNDRV_PCM_RATE_96000,
79 .rate_min = 8000,
80 .rate_max = 96000,
81 .channels_min = 1,
82 .channels_max = 8,
83 .buffer_bytes_max = 262144,
84 .period_bytes_min = 32,
85 .period_bytes_max = 131072,
86 .periods_min = 2,
87 .periods_max = 220,
88 /* One page (4k) contains 512 instructions. I don't know if the hw
89 supports lists longer than this. In this case periods_max=220 is a
90 safe limit to make sure the list never exceeds 512 instructions. */
91};
92
93
94#include "darla24_dsp.c"
95#include "echoaudio_dsp.c"
96#include "echoaudio.c"