18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0-only 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * ALSA driver for Echoaudio soundcards. 48c2ecf20Sopenharmony_ci * Copyright (C) 2003-2004 Giuliano Pochini <pochini@shiny.it> 58c2ecf20Sopenharmony_ci */ 68c2ecf20Sopenharmony_ci 78c2ecf20Sopenharmony_ci#define INDIGO_FAMILY 88c2ecf20Sopenharmony_ci#define ECHOCARD_INDIGO_IO 98c2ecf20Sopenharmony_ci#define ECHOCARD_NAME "Indigo IO" 108c2ecf20Sopenharmony_ci#define ECHOCARD_HAS_MONITOR 118c2ecf20Sopenharmony_ci#define ECHOCARD_HAS_SUPER_INTERLEAVE 128c2ecf20Sopenharmony_ci#define ECHOCARD_HAS_VMIXER 138c2ecf20Sopenharmony_ci#define ECHOCARD_HAS_STEREO_BIG_ENDIAN32 148c2ecf20Sopenharmony_ci 158c2ecf20Sopenharmony_ci/* Pipe indexes */ 168c2ecf20Sopenharmony_ci#define PX_ANALOG_OUT 0 /* 8 */ 178c2ecf20Sopenharmony_ci#define PX_DIGITAL_OUT 8 /* 0 */ 188c2ecf20Sopenharmony_ci#define PX_ANALOG_IN 8 /* 2 */ 198c2ecf20Sopenharmony_ci#define PX_DIGITAL_IN 10 /* 0 */ 208c2ecf20Sopenharmony_ci#define PX_NUM 10 218c2ecf20Sopenharmony_ci 228c2ecf20Sopenharmony_ci/* Bus indexes */ 238c2ecf20Sopenharmony_ci#define BX_ANALOG_OUT 0 /* 2 */ 248c2ecf20Sopenharmony_ci#define BX_DIGITAL_OUT 2 /* 0 */ 258c2ecf20Sopenharmony_ci#define BX_ANALOG_IN 2 /* 2 */ 268c2ecf20Sopenharmony_ci#define BX_DIGITAL_IN 4 /* 0 */ 278c2ecf20Sopenharmony_ci#define BX_NUM 4 288c2ecf20Sopenharmony_ci 298c2ecf20Sopenharmony_ci 308c2ecf20Sopenharmony_ci#include <linux/delay.h> 318c2ecf20Sopenharmony_ci#include <linux/init.h> 328c2ecf20Sopenharmony_ci#include <linux/interrupt.h> 338c2ecf20Sopenharmony_ci#include <linux/pci.h> 348c2ecf20Sopenharmony_ci#include <linux/module.h> 358c2ecf20Sopenharmony_ci#include <linux/firmware.h> 368c2ecf20Sopenharmony_ci#include <linux/slab.h> 378c2ecf20Sopenharmony_ci#include <linux/io.h> 388c2ecf20Sopenharmony_ci#include <sound/core.h> 398c2ecf20Sopenharmony_ci#include <sound/info.h> 408c2ecf20Sopenharmony_ci#include <sound/control.h> 418c2ecf20Sopenharmony_ci#include <sound/tlv.h> 428c2ecf20Sopenharmony_ci#include <sound/pcm.h> 438c2ecf20Sopenharmony_ci#include <sound/pcm_params.h> 448c2ecf20Sopenharmony_ci#include <sound/asoundef.h> 458c2ecf20Sopenharmony_ci#include <sound/initval.h> 468c2ecf20Sopenharmony_ci#include <linux/atomic.h> 478c2ecf20Sopenharmony_ci#include "echoaudio.h" 488c2ecf20Sopenharmony_ci 498c2ecf20Sopenharmony_ciMODULE_FIRMWARE("ea/loader_dsp.fw"); 508c2ecf20Sopenharmony_ciMODULE_FIRMWARE("ea/indigo_io_dsp.fw"); 518c2ecf20Sopenharmony_ci 528c2ecf20Sopenharmony_ci#define FW_361_LOADER 0 538c2ecf20Sopenharmony_ci#define FW_INDIGO_IO_DSP 1 548c2ecf20Sopenharmony_ci 558c2ecf20Sopenharmony_cistatic const struct firmware card_fw[] = { 568c2ecf20Sopenharmony_ci {0, "loader_dsp.fw"}, 578c2ecf20Sopenharmony_ci {0, "indigo_io_dsp.fw"} 588c2ecf20Sopenharmony_ci}; 598c2ecf20Sopenharmony_ci 608c2ecf20Sopenharmony_cistatic const struct pci_device_id snd_echo_ids[] = { 618c2ecf20Sopenharmony_ci {0x1057, 0x3410, 0xECC0, 0x00A0, 0, 0, 0}, /* Indigo IO*/ 628c2ecf20Sopenharmony_ci {0,} 638c2ecf20Sopenharmony_ci}; 648c2ecf20Sopenharmony_ci 658c2ecf20Sopenharmony_cistatic const struct snd_pcm_hardware pcm_hardware_skel = { 668c2ecf20Sopenharmony_ci .info = SNDRV_PCM_INFO_MMAP | 678c2ecf20Sopenharmony_ci SNDRV_PCM_INFO_INTERLEAVED | 688c2ecf20Sopenharmony_ci SNDRV_PCM_INFO_BLOCK_TRANSFER | 698c2ecf20Sopenharmony_ci SNDRV_PCM_INFO_MMAP_VALID | 708c2ecf20Sopenharmony_ci SNDRV_PCM_INFO_PAUSE | 718c2ecf20Sopenharmony_ci SNDRV_PCM_INFO_SYNC_START, 728c2ecf20Sopenharmony_ci .formats = SNDRV_PCM_FMTBIT_U8 | 738c2ecf20Sopenharmony_ci SNDRV_PCM_FMTBIT_S16_LE | 748c2ecf20Sopenharmony_ci SNDRV_PCM_FMTBIT_S24_3LE | 758c2ecf20Sopenharmony_ci SNDRV_PCM_FMTBIT_S32_LE | 768c2ecf20Sopenharmony_ci SNDRV_PCM_FMTBIT_S32_BE, 778c2ecf20Sopenharmony_ci .rates = SNDRV_PCM_RATE_32000 | 788c2ecf20Sopenharmony_ci SNDRV_PCM_RATE_44100 | 798c2ecf20Sopenharmony_ci SNDRV_PCM_RATE_48000 | 808c2ecf20Sopenharmony_ci SNDRV_PCM_RATE_88200 | 818c2ecf20Sopenharmony_ci SNDRV_PCM_RATE_96000, 828c2ecf20Sopenharmony_ci .rate_min = 32000, 838c2ecf20Sopenharmony_ci .rate_max = 96000, 848c2ecf20Sopenharmony_ci .channels_min = 1, 858c2ecf20Sopenharmony_ci .channels_max = 8, 868c2ecf20Sopenharmony_ci .buffer_bytes_max = 262144, 878c2ecf20Sopenharmony_ci .period_bytes_min = 32, 888c2ecf20Sopenharmony_ci .period_bytes_max = 131072, 898c2ecf20Sopenharmony_ci .periods_min = 2, 908c2ecf20Sopenharmony_ci .periods_max = 220, 918c2ecf20Sopenharmony_ci}; 928c2ecf20Sopenharmony_ci 938c2ecf20Sopenharmony_ci#include "indigoio_dsp.c" 948c2ecf20Sopenharmony_ci#include "echoaudio_dsp.c" 958c2ecf20Sopenharmony_ci#include "echoaudio.c" 968c2ecf20Sopenharmony_ci 97