Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-only
0002 /*
0003  *  ALSA driver for Echoaudio soundcards.
0004  *  Copyright (C) 2003-2004 Giuliano Pochini <pochini@shiny.it>
0005  */
0006 
0007 #define ECHOGALS_FAMILY
0008 #define ECHOCARD_DARLA20
0009 #define ECHOCARD_NAME "Darla20"
0010 #define ECHOCARD_HAS_MONITOR
0011 
0012 /* Pipe indexes */
0013 #define PX_ANALOG_OUT   0   /* 8 */
0014 #define PX_DIGITAL_OUT  8   /* 0 */
0015 #define PX_ANALOG_IN    8   /* 2 */
0016 #define PX_DIGITAL_IN   10  /* 0 */
0017 #define PX_NUM      10
0018 
0019 /* Bus indexes */
0020 #define BX_ANALOG_OUT   0   /* 8 */
0021 #define BX_DIGITAL_OUT  8   /* 0 */
0022 #define BX_ANALOG_IN    8   /* 2 */
0023 #define BX_DIGITAL_IN   10  /* 0 */
0024 #define BX_NUM      10
0025 
0026 
0027 #include <linux/delay.h>
0028 #include <linux/init.h>
0029 #include <linux/interrupt.h>
0030 #include <linux/pci.h>
0031 #include <linux/module.h>
0032 #include <linux/firmware.h>
0033 #include <linux/slab.h>
0034 #include <linux/io.h>
0035 #include <sound/core.h>
0036 #include <sound/info.h>
0037 #include <sound/control.h>
0038 #include <sound/tlv.h>
0039 #include <sound/pcm.h>
0040 #include <sound/pcm_params.h>
0041 #include <sound/asoundef.h>
0042 #include <sound/initval.h>
0043 #include <linux/atomic.h>
0044 #include "echoaudio.h"
0045 
0046 MODULE_FIRMWARE("ea/darla20_dsp.fw");
0047 
0048 #define FW_DARLA20_DSP  0
0049 
0050 static const struct firmware card_fw[] = {
0051     {0, "darla20_dsp.fw"}
0052 };
0053 
0054 static const struct pci_device_id snd_echo_ids[] = {
0055     {0x1057, 0x1801, 0xECC0, 0x0010, 0, 0, 0},  /* DSP 56301 Darla20 rev.0 */
0056     {0,}
0057 };
0058 
0059 static const struct snd_pcm_hardware pcm_hardware_skel = {
0060     .info = SNDRV_PCM_INFO_MMAP |
0061         SNDRV_PCM_INFO_INTERLEAVED |
0062         SNDRV_PCM_INFO_BLOCK_TRANSFER |
0063         SNDRV_PCM_INFO_MMAP_VALID |
0064         SNDRV_PCM_INFO_PAUSE |
0065         SNDRV_PCM_INFO_SYNC_START,
0066     .formats =  SNDRV_PCM_FMTBIT_U8 |
0067             SNDRV_PCM_FMTBIT_S16_LE |
0068             SNDRV_PCM_FMTBIT_S24_3LE |
0069             SNDRV_PCM_FMTBIT_S32_LE |
0070             SNDRV_PCM_FMTBIT_S32_BE,
0071     .rates = SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000,
0072     .rate_min = 44100,
0073     .rate_max = 48000,
0074     .channels_min = 1,
0075     .channels_max = 2,
0076     .buffer_bytes_max = 262144,
0077     .period_bytes_min = 32,
0078     .period_bytes_max = 131072,
0079     .periods_min = 2,
0080     .periods_max = 220,
0081     /* One page (4k) contains 512 instructions. I don't know if the hw
0082     supports lists longer than this. In this case periods_max=220 is a
0083     safe limit to make sure the list never exceeds 512 instructions. */
0084 };
0085 
0086 
0087 #include "darla20_dsp.c"
0088 #include "echoaudio_dsp.c"
0089 #include "echoaudio.c"