xref: /linux/sound/pci/echoaudio/indigodjx.c (revision 8dd06ef34b6e2f41b29fbf5fc1663780f2524285)
1873e65bcSThomas Gleixner // SPDX-License-Identifier: GPL-2.0-only
2a2328d02SGiuliano Pochini /*
3a2328d02SGiuliano Pochini  *  ALSA driver for Echoaudio soundcards.
4a2328d02SGiuliano Pochini  *  Copyright (C) 2009 Giuliano Pochini <pochini@shiny.it>
5a2328d02SGiuliano Pochini  */
6a2328d02SGiuliano Pochini 
7a2328d02SGiuliano Pochini #define INDIGO_FAMILY
8a2328d02SGiuliano Pochini #define ECHOCARD_INDIGO_DJX
9a2328d02SGiuliano Pochini #define ECHOCARD_NAME "Indigo DJx"
10a2328d02SGiuliano Pochini #define ECHOCARD_HAS_SUPER_INTERLEAVE
11a2328d02SGiuliano Pochini #define ECHOCARD_HAS_VMIXER
12a2328d02SGiuliano Pochini #define ECHOCARD_HAS_STEREO_BIG_ENDIAN32
13a2328d02SGiuliano Pochini 
14a2328d02SGiuliano Pochini /* Pipe indexes */
15a2328d02SGiuliano Pochini #define PX_ANALOG_OUT	0	/* 8 */
16a2328d02SGiuliano Pochini #define PX_DIGITAL_OUT	8	/* 0 */
17a2328d02SGiuliano Pochini #define PX_ANALOG_IN	8	/* 0 */
18a2328d02SGiuliano Pochini #define PX_DIGITAL_IN	8	/* 0 */
19a2328d02SGiuliano Pochini #define PX_NUM		8
20a2328d02SGiuliano Pochini 
21a2328d02SGiuliano Pochini /* Bus indexes */
22a2328d02SGiuliano Pochini #define BX_ANALOG_OUT	0	/* 4 */
23a2328d02SGiuliano Pochini #define BX_DIGITAL_OUT	4	/* 0 */
24a2328d02SGiuliano Pochini #define BX_ANALOG_IN	4	/* 0 */
25a2328d02SGiuliano Pochini #define BX_DIGITAL_IN	4	/* 0 */
26a2328d02SGiuliano Pochini #define BX_NUM		4
27a2328d02SGiuliano Pochini 
28a2328d02SGiuliano Pochini 
29a2328d02SGiuliano Pochini #include <linux/delay.h>
30a2328d02SGiuliano Pochini #include <linux/init.h>
31a2328d02SGiuliano Pochini #include <linux/interrupt.h>
32a2328d02SGiuliano Pochini #include <linux/pci.h>
3365a77217SPaul Gortmaker #include <linux/module.h>
34a2328d02SGiuliano Pochini #include <linux/firmware.h>
35a2328d02SGiuliano Pochini #include <linux/io.h>
365a0e3ad6STejun Heo #include <linux/slab.h>
37a2328d02SGiuliano Pochini #include <sound/core.h>
38a2328d02SGiuliano Pochini #include <sound/info.h>
39a2328d02SGiuliano Pochini #include <sound/control.h>
40a2328d02SGiuliano Pochini #include <sound/tlv.h>
41a2328d02SGiuliano Pochini #include <sound/pcm.h>
42a2328d02SGiuliano Pochini #include <sound/pcm_params.h>
43a2328d02SGiuliano Pochini #include <sound/asoundef.h>
44a2328d02SGiuliano Pochini #include <sound/initval.h>
4560063497SArun Sharma #include <linux/atomic.h>
46a2328d02SGiuliano Pochini #include "echoaudio.h"
47a2328d02SGiuliano Pochini 
48a2328d02SGiuliano Pochini MODULE_FIRMWARE("ea/loader_dsp.fw");
49a2328d02SGiuliano Pochini MODULE_FIRMWARE("ea/indigo_djx_dsp.fw");
50a2328d02SGiuliano Pochini 
51a2328d02SGiuliano Pochini #define FW_361_LOADER		0
52a2328d02SGiuliano Pochini #define FW_INDIGO_DJX_DSP	1
53a2328d02SGiuliano Pochini 
54a2328d02SGiuliano Pochini static const struct firmware card_fw[] = {
55a2328d02SGiuliano Pochini 	{0, "loader_dsp.fw"},
56a2328d02SGiuliano Pochini 	{0, "indigo_djx_dsp.fw"}
57a2328d02SGiuliano Pochini };
58a2328d02SGiuliano Pochini 
599baa3c34SBenoit Taine static const struct pci_device_id snd_echo_ids[] = {
60a2328d02SGiuliano Pochini 	{0x1057, 0x3410, 0xECC0, 0x00E0, 0, 0, 0},	/* Indigo DJx*/
61a2328d02SGiuliano Pochini 	{0,}
62a2328d02SGiuliano Pochini };
63a2328d02SGiuliano Pochini 
64*c1c3981fSTakashi Iwai static const struct snd_pcm_hardware pcm_hardware_skel = {
65a2328d02SGiuliano Pochini 	.info = SNDRV_PCM_INFO_MMAP |
66a2328d02SGiuliano Pochini 		SNDRV_PCM_INFO_INTERLEAVED |
67a2328d02SGiuliano Pochini 		SNDRV_PCM_INFO_BLOCK_TRANSFER |
68a2328d02SGiuliano Pochini 		SNDRV_PCM_INFO_MMAP_VALID |
69a2328d02SGiuliano Pochini 		SNDRV_PCM_INFO_PAUSE |
70a2328d02SGiuliano Pochini 		SNDRV_PCM_INFO_SYNC_START,
71a2328d02SGiuliano Pochini 	.formats =	SNDRV_PCM_FMTBIT_U8 |
72a2328d02SGiuliano Pochini 			SNDRV_PCM_FMTBIT_S16_LE |
73a2328d02SGiuliano Pochini 			SNDRV_PCM_FMTBIT_S24_3LE |
74a2328d02SGiuliano Pochini 			SNDRV_PCM_FMTBIT_S32_LE |
75a2328d02SGiuliano Pochini 			SNDRV_PCM_FMTBIT_S32_BE,
76a2328d02SGiuliano Pochini 	.rates = 	SNDRV_PCM_RATE_32000 |
77a2328d02SGiuliano Pochini 			SNDRV_PCM_RATE_44100 |
78a2328d02SGiuliano Pochini 			SNDRV_PCM_RATE_48000 |
793f68165eSGiuliano Pochini 			SNDRV_PCM_RATE_64000 |
80a2328d02SGiuliano Pochini 			SNDRV_PCM_RATE_88200 |
81a2328d02SGiuliano Pochini 			SNDRV_PCM_RATE_96000,
82a2328d02SGiuliano Pochini 	.rate_min = 32000,
83a2328d02SGiuliano Pochini 	.rate_max = 96000,
84a2328d02SGiuliano Pochini 	.channels_min = 1,
85a2328d02SGiuliano Pochini 	.channels_max = 4,
86a2328d02SGiuliano Pochini 	.buffer_bytes_max = 262144,
87a2328d02SGiuliano Pochini 	.period_bytes_min = 32,
88a2328d02SGiuliano Pochini 	.period_bytes_max = 131072,
89a2328d02SGiuliano Pochini 	.periods_min = 2,
90a2328d02SGiuliano Pochini 	.periods_max = 220,
91a2328d02SGiuliano Pochini };
92a2328d02SGiuliano Pochini 
93a2328d02SGiuliano Pochini #include "indigodjx_dsp.c"
94a2328d02SGiuliano Pochini #include "indigo_express_dsp.c"
95a2328d02SGiuliano Pochini #include "echoaudio_dsp.c"
96a2328d02SGiuliano Pochini #include "echoaudio.c"
97