layla20.c 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * ALSA driver for Echoaudio soundcards.
  4. * Copyright (C) 2003-2004 Giuliano Pochini <[email protected]>
  5. */
  6. #define ECHOGALS_FAMILY
  7. #define ECHOCARD_LAYLA20
  8. #define ECHOCARD_NAME "Layla20"
  9. #define ECHOCARD_HAS_MONITOR
  10. #define ECHOCARD_HAS_ASIC
  11. #define ECHOCARD_HAS_INPUT_GAIN
  12. #define ECHOCARD_HAS_OUTPUT_NOMINAL_LEVEL
  13. #define ECHOCARD_HAS_SUPER_INTERLEAVE
  14. #define ECHOCARD_HAS_DIGITAL_IO
  15. #define ECHOCARD_HAS_EXTERNAL_CLOCK
  16. #define ECHOCARD_HAS_ADAT false
  17. #define ECHOCARD_HAS_OUTPUT_CLOCK_SWITCH
  18. #define ECHOCARD_HAS_MIDI
  19. /* Pipe indexes */
  20. #define PX_ANALOG_OUT 0 /* 10 */
  21. #define PX_DIGITAL_OUT 10 /* 2 */
  22. #define PX_ANALOG_IN 12 /* 8 */
  23. #define PX_DIGITAL_IN 20 /* 2 */
  24. #define PX_NUM 22
  25. /* Bus indexes */
  26. #define BX_ANALOG_OUT 0 /* 10 */
  27. #define BX_DIGITAL_OUT 10 /* 2 */
  28. #define BX_ANALOG_IN 12 /* 8 */
  29. #define BX_DIGITAL_IN 20 /* 2 */
  30. #define BX_NUM 22
  31. #include <linux/delay.h>
  32. #include <linux/init.h>
  33. #include <linux/interrupt.h>
  34. #include <linux/pci.h>
  35. #include <linux/module.h>
  36. #include <linux/firmware.h>
  37. #include <linux/slab.h>
  38. #include <linux/io.h>
  39. #include <sound/core.h>
  40. #include <sound/info.h>
  41. #include <sound/control.h>
  42. #include <sound/tlv.h>
  43. #include <sound/pcm.h>
  44. #include <sound/pcm_params.h>
  45. #include <sound/asoundef.h>
  46. #include <sound/initval.h>
  47. #include <sound/rawmidi.h>
  48. #include <linux/atomic.h>
  49. #include "echoaudio.h"
  50. MODULE_FIRMWARE("ea/layla20_dsp.fw");
  51. MODULE_FIRMWARE("ea/layla20_asic.fw");
  52. #define FW_LAYLA20_DSP 0
  53. #define FW_LAYLA20_ASIC 1
  54. static const struct firmware card_fw[] = {
  55. {0, "layla20_dsp.fw"},
  56. {0, "layla20_asic.fw"}
  57. };
  58. static const struct pci_device_id snd_echo_ids[] = {
  59. {0x1057, 0x1801, 0xECC0, 0x0030, 0, 0, 0}, /* DSP 56301 Layla20 rev.0 */
  60. {0x1057, 0x1801, 0xECC0, 0x0031, 0, 0, 0}, /* DSP 56301 Layla20 rev.1 */
  61. {0,}
  62. };
  63. static const struct snd_pcm_hardware pcm_hardware_skel = {
  64. .info = SNDRV_PCM_INFO_MMAP |
  65. SNDRV_PCM_INFO_INTERLEAVED |
  66. SNDRV_PCM_INFO_BLOCK_TRANSFER |
  67. SNDRV_PCM_INFO_MMAP_VALID |
  68. SNDRV_PCM_INFO_PAUSE |
  69. SNDRV_PCM_INFO_SYNC_START,
  70. .formats = SNDRV_PCM_FMTBIT_U8 |
  71. SNDRV_PCM_FMTBIT_S16_LE |
  72. SNDRV_PCM_FMTBIT_S24_3LE |
  73. SNDRV_PCM_FMTBIT_S32_LE |
  74. SNDRV_PCM_FMTBIT_S32_BE,
  75. .rates = SNDRV_PCM_RATE_8000_48000 | SNDRV_PCM_RATE_CONTINUOUS,
  76. .rate_min = 8000,
  77. .rate_max = 50000,
  78. .channels_min = 1,
  79. .channels_max = 10,
  80. .buffer_bytes_max = 262144,
  81. .period_bytes_min = 32,
  82. .period_bytes_max = 131072,
  83. .periods_min = 2,
  84. .periods_max = 220,
  85. /* One page (4k) contains 512 instructions. I don't know if the hw
  86. supports lists longer than this. In this case periods_max=220 is a
  87. safe limit to make sure the list never exceeds 512 instructions. */
  88. };
  89. #include "layla20_dsp.c"
  90. #include "echoaudio_dsp.c"
  91. #include "echoaudio.c"
  92. #include "midi.c"