1873e65bcSThomas Gleixner // SPDX-License-Identifier: GPL-2.0-only 2dd7b254dSGiuliano Pochini /* 3dd7b254dSGiuliano Pochini * ALSA driver for Echoaudio soundcards. 4dd7b254dSGiuliano Pochini * Copyright (C) 2003-2004 Giuliano Pochini <pochini@shiny.it> 5dd7b254dSGiuliano Pochini */ 6dd7b254dSGiuliano Pochini 7dd7b254dSGiuliano Pochini #define ECHOGALS_FAMILY 8dd7b254dSGiuliano Pochini #define ECHOCARD_DARLA24 9dd7b254dSGiuliano Pochini #define ECHOCARD_NAME "Darla24" 10dd7b254dSGiuliano Pochini #define ECHOCARD_HAS_MONITOR 11dd7b254dSGiuliano Pochini #define ECHOCARD_HAS_INPUT_NOMINAL_LEVEL 12dd7b254dSGiuliano Pochini #define ECHOCARD_HAS_OUTPUT_NOMINAL_LEVEL 13dd7b254dSGiuliano Pochini #define ECHOCARD_HAS_EXTERNAL_CLOCK 14dd7b254dSGiuliano Pochini #define ECHOCARD_HAS_SUPER_INTERLEAVE 15dd7b254dSGiuliano Pochini 16dd7b254dSGiuliano Pochini /* Pipe indexes */ 17dd7b254dSGiuliano Pochini #define PX_ANALOG_OUT 0 /* 8 */ 18dd7b254dSGiuliano Pochini #define PX_DIGITAL_OUT 8 /* 0 */ 19dd7b254dSGiuliano Pochini #define PX_ANALOG_IN 8 /* 2 */ 20dd7b254dSGiuliano Pochini #define PX_DIGITAL_IN 10 /* 0 */ 21dd7b254dSGiuliano Pochini #define PX_NUM 10 22dd7b254dSGiuliano Pochini 23dd7b254dSGiuliano Pochini /* Bus indexes */ 24dd7b254dSGiuliano Pochini #define BX_ANALOG_OUT 0 /* 8 */ 25dd7b254dSGiuliano Pochini #define BX_DIGITAL_OUT 8 /* 0 */ 26dd7b254dSGiuliano Pochini #define BX_ANALOG_IN 8 /* 2 */ 27dd7b254dSGiuliano Pochini #define BX_DIGITAL_IN 10 /* 0 */ 28dd7b254dSGiuliano Pochini #define BX_NUM 10 29dd7b254dSGiuliano Pochini 30dd7b254dSGiuliano Pochini 31dd7b254dSGiuliano Pochini #include <linux/delay.h> 32dd7b254dSGiuliano Pochini #include <linux/init.h> 33dd7b254dSGiuliano Pochini #include <linux/interrupt.h> 34dd7b254dSGiuliano Pochini #include <linux/pci.h> 3565a77217SPaul Gortmaker #include <linux/module.h> 36dd7b254dSGiuliano Pochini #include <linux/firmware.h> 375a0e3ad6STejun Heo #include <linux/slab.h> 386cbbfe1cSTakashi Iwai #include <linux/io.h> 39dd7b254dSGiuliano Pochini #include <sound/core.h> 40dd7b254dSGiuliano Pochini #include <sound/info.h> 41dd7b254dSGiuliano Pochini #include <sound/control.h> 42048b9450SGiuliano Pochini #include <sound/tlv.h> 43dd7b254dSGiuliano Pochini #include <sound/pcm.h> 44dd7b254dSGiuliano Pochini #include <sound/pcm_params.h> 45dd7b254dSGiuliano Pochini #include <sound/asoundef.h> 46dd7b254dSGiuliano Pochini #include <sound/initval.h> 4760063497SArun Sharma #include <linux/atomic.h> 48dd7b254dSGiuliano Pochini #include "echoaudio.h" 49dd7b254dSGiuliano Pochini 507e0af29dSClemens Ladisch MODULE_FIRMWARE("ea/darla24_dsp.fw"); 517e0af29dSClemens Ladisch 52dd7b254dSGiuliano Pochini #define FW_DARLA24_DSP 0 53dd7b254dSGiuliano Pochini 54dd7b254dSGiuliano Pochini static const struct firmware card_fw[] = { 55dd7b254dSGiuliano Pochini {0, "darla24_dsp.fw"} 56dd7b254dSGiuliano Pochini }; 57dd7b254dSGiuliano Pochini 589baa3c34SBenoit Taine static const struct pci_device_id snd_echo_ids[] = { 59dd7b254dSGiuliano Pochini {0x1057, 0x1801, 0xECC0, 0x0040, 0, 0, 0}, /* DSP 56301 Darla24 rev.0 */ 60dd7b254dSGiuliano Pochini {0x1057, 0x1801, 0xECC0, 0x0041, 0, 0, 0}, /* DSP 56301 Darla24 rev.1 */ 61dd7b254dSGiuliano Pochini {0,} 62dd7b254dSGiuliano Pochini }; 63dd7b254dSGiuliano Pochini 64*c1c3981fSTakashi Iwai static const struct snd_pcm_hardware pcm_hardware_skel = { 65dd7b254dSGiuliano Pochini .info = SNDRV_PCM_INFO_MMAP | 66dd7b254dSGiuliano Pochini SNDRV_PCM_INFO_INTERLEAVED | 67dd7b254dSGiuliano Pochini SNDRV_PCM_INFO_BLOCK_TRANSFER | 68dd7b254dSGiuliano Pochini SNDRV_PCM_INFO_MMAP_VALID | 69dd7b254dSGiuliano Pochini SNDRV_PCM_INFO_PAUSE | 70dd7b254dSGiuliano Pochini SNDRV_PCM_INFO_SYNC_START, 71dd7b254dSGiuliano Pochini .formats = SNDRV_PCM_FMTBIT_U8 | 72dd7b254dSGiuliano Pochini SNDRV_PCM_FMTBIT_S16_LE | 73dd7b254dSGiuliano Pochini SNDRV_PCM_FMTBIT_S24_3LE | 74dd7b254dSGiuliano Pochini SNDRV_PCM_FMTBIT_S32_LE | 75dd7b254dSGiuliano Pochini SNDRV_PCM_FMTBIT_S32_BE, 76dd7b254dSGiuliano Pochini .rates = SNDRV_PCM_RATE_8000_48000 | 77dd7b254dSGiuliano Pochini SNDRV_PCM_RATE_88200 | 78dd7b254dSGiuliano Pochini SNDRV_PCM_RATE_96000, 79dd7b254dSGiuliano Pochini .rate_min = 8000, 80dd7b254dSGiuliano Pochini .rate_max = 96000, 81dd7b254dSGiuliano Pochini .channels_min = 1, 82dd7b254dSGiuliano Pochini .channels_max = 8, 83dd7b254dSGiuliano Pochini .buffer_bytes_max = 262144, 84dd7b254dSGiuliano Pochini .period_bytes_min = 32, 85dd7b254dSGiuliano Pochini .period_bytes_max = 131072, 86dd7b254dSGiuliano Pochini .periods_min = 2, 87dd7b254dSGiuliano Pochini .periods_max = 220, 88dd7b254dSGiuliano Pochini /* One page (4k) contains 512 instructions. I don't know if the hw 89dd7b254dSGiuliano Pochini supports lists longer than this. In this case periods_max=220 is a 90dd7b254dSGiuliano Pochini safe limit to make sure the list never exceeds 512 instructions. */ 91dd7b254dSGiuliano Pochini }; 92dd7b254dSGiuliano Pochini 93dd7b254dSGiuliano Pochini 94dd7b254dSGiuliano Pochini #include "darla24_dsp.c" 95dd7b254dSGiuliano Pochini #include "echoaudio_dsp.c" 96dd7b254dSGiuliano Pochini #include "echoaudio.c" 97