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 ECHO24_FAMILY
0008 #define ECHOCARD_LAYLA24
0009 #define ECHOCARD_NAME "Layla24"
0010 #define ECHOCARD_HAS_MONITOR
0011 #define ECHOCARD_HAS_ASIC
0012 #define ECHOCARD_HAS_INPUT_NOMINAL_LEVEL
0013 #define ECHOCARD_HAS_OUTPUT_NOMINAL_LEVEL
0014 #define ECHOCARD_HAS_SUPER_INTERLEAVE
0015 #define ECHOCARD_HAS_DIGITAL_IO
0016 #define ECHOCARD_HAS_DIGITAL_IN_AUTOMUTE
0017 #define ECHOCARD_HAS_DIGITAL_MODE_SWITCH
0018 #define ECHOCARD_HAS_EXTERNAL_CLOCK
0019 #define ECHOCARD_HAS_ADAT   6
0020 #define ECHOCARD_HAS_STEREO_BIG_ENDIAN32
0021 #define ECHOCARD_HAS_MIDI
0022 
0023 /* Pipe indexes */
0024 #define PX_ANALOG_OUT   0   /* 8 */
0025 #define PX_DIGITAL_OUT  8   /* 8 */
0026 #define PX_ANALOG_IN    16  /* 8 */
0027 #define PX_DIGITAL_IN   24  /* 8 */
0028 #define PX_NUM      32
0029 
0030 /* Bus indexes */
0031 #define BX_ANALOG_OUT   0   /* 8 */
0032 #define BX_DIGITAL_OUT  8   /* 8 */
0033 #define BX_ANALOG_IN    16  /* 8 */
0034 #define BX_DIGITAL_IN   24  /* 8 */
0035 #define BX_NUM      32
0036 
0037 
0038 #include <linux/delay.h>
0039 #include <linux/init.h>
0040 #include <linux/interrupt.h>
0041 #include <linux/pci.h>
0042 #include <linux/module.h>
0043 #include <linux/firmware.h>
0044 #include <linux/slab.h>
0045 #include <linux/io.h>
0046 #include <sound/core.h>
0047 #include <sound/info.h>
0048 #include <sound/control.h>
0049 #include <sound/tlv.h>
0050 #include <sound/pcm.h>
0051 #include <sound/pcm_params.h>
0052 #include <sound/asoundef.h>
0053 #include <sound/initval.h>
0054 #include <sound/rawmidi.h>
0055 #include <linux/atomic.h>
0056 #include "echoaudio.h"
0057 
0058 MODULE_FIRMWARE("ea/loader_dsp.fw");
0059 MODULE_FIRMWARE("ea/layla24_dsp.fw");
0060 MODULE_FIRMWARE("ea/layla24_1_asic.fw");
0061 MODULE_FIRMWARE("ea/layla24_2A_asic.fw");
0062 MODULE_FIRMWARE("ea/layla24_2S_asic.fw");
0063 
0064 #define FW_361_LOADER       0
0065 #define FW_LAYLA24_DSP      1
0066 #define FW_LAYLA24_1_ASIC   2
0067 #define FW_LAYLA24_2A_ASIC  3
0068 #define FW_LAYLA24_2S_ASIC  4
0069 
0070 static const struct firmware card_fw[] = {
0071     {0, "loader_dsp.fw"},
0072     {0, "layla24_dsp.fw"},
0073     {0, "layla24_1_asic.fw"},
0074     {0, "layla24_2A_asic.fw"},
0075     {0, "layla24_2S_asic.fw"}
0076 };
0077 
0078 static const struct pci_device_id snd_echo_ids[] = {
0079     {0x1057, 0x3410, 0xECC0, 0x0060, 0, 0, 0},  /* DSP 56361 Layla24 rev.0 */
0080     {0,}
0081 };
0082 
0083 static const struct snd_pcm_hardware pcm_hardware_skel = {
0084     .info = SNDRV_PCM_INFO_MMAP |
0085         SNDRV_PCM_INFO_INTERLEAVED |
0086         SNDRV_PCM_INFO_BLOCK_TRANSFER |
0087         SNDRV_PCM_INFO_MMAP_VALID |
0088         SNDRV_PCM_INFO_PAUSE |
0089         SNDRV_PCM_INFO_SYNC_START,
0090     .formats =  SNDRV_PCM_FMTBIT_U8 |
0091             SNDRV_PCM_FMTBIT_S16_LE |
0092             SNDRV_PCM_FMTBIT_S24_3LE |
0093             SNDRV_PCM_FMTBIT_S32_LE |
0094             SNDRV_PCM_FMTBIT_S32_BE,
0095     .rates =    SNDRV_PCM_RATE_8000_96000,
0096     .rate_min = 8000,
0097     .rate_max = 100000,
0098     .channels_min = 1,
0099     .channels_max = 8,
0100     .buffer_bytes_max = 262144,
0101     .period_bytes_min = 32,
0102     .period_bytes_max = 131072,
0103     .periods_min = 2,
0104     .periods_max = 220,
0105     /* One page (4k) contains 512 instructions. I don't know if the hw
0106     supports lists longer than this. In this case periods_max=220 is a
0107     safe limit to make sure the list never exceeds 512 instructions. */
0108 };
0109 
0110 
0111 #include "layla24_dsp.c"
0112 #include "echoaudio_dsp.c"
0113 #include "echoaudio_gml.c"
0114 #include "echoaudio.c"
0115 #include "midi.c"