darla24.c 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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_DARLA24
  8. #define ECHOCARD_NAME "Darla24"
  9. #define ECHOCARD_HAS_MONITOR
  10. #define ECHOCARD_HAS_INPUT_NOMINAL_LEVEL
  11. #define ECHOCARD_HAS_OUTPUT_NOMINAL_LEVEL
  12. #define ECHOCARD_HAS_EXTERNAL_CLOCK
  13. #define ECHOCARD_HAS_SUPER_INTERLEAVE
  14. /* Pipe indexes */
  15. #define PX_ANALOG_OUT 0 /* 8 */
  16. #define PX_DIGITAL_OUT 8 /* 0 */
  17. #define PX_ANALOG_IN 8 /* 2 */
  18. #define PX_DIGITAL_IN 10 /* 0 */
  19. #define PX_NUM 10
  20. /* Bus indexes */
  21. #define BX_ANALOG_OUT 0 /* 8 */
  22. #define BX_DIGITAL_OUT 8 /* 0 */
  23. #define BX_ANALOG_IN 8 /* 2 */
  24. #define BX_DIGITAL_IN 10 /* 0 */
  25. #define BX_NUM 10
  26. #include <linux/delay.h>
  27. #include <linux/init.h>
  28. #include <linux/interrupt.h>
  29. #include <linux/pci.h>
  30. #include <linux/module.h>
  31. #include <linux/firmware.h>
  32. #include <linux/slab.h>
  33. #include <linux/io.h>
  34. #include <sound/core.h>
  35. #include <sound/info.h>
  36. #include <sound/control.h>
  37. #include <sound/tlv.h>
  38. #include <sound/pcm.h>
  39. #include <sound/pcm_params.h>
  40. #include <sound/asoundef.h>
  41. #include <sound/initval.h>
  42. #include <linux/atomic.h>
  43. #include "echoaudio.h"
  44. MODULE_FIRMWARE("ea/darla24_dsp.fw");
  45. #define FW_DARLA24_DSP 0
  46. static const struct firmware card_fw[] = {
  47. {0, "darla24_dsp.fw"}
  48. };
  49. static const struct pci_device_id snd_echo_ids[] = {
  50. {0x1057, 0x1801, 0xECC0, 0x0040, 0, 0, 0}, /* DSP 56301 Darla24 rev.0 */
  51. {0x1057, 0x1801, 0xECC0, 0x0041, 0, 0, 0}, /* DSP 56301 Darla24 rev.1 */
  52. {0,}
  53. };
  54. static const struct snd_pcm_hardware pcm_hardware_skel = {
  55. .info = SNDRV_PCM_INFO_MMAP |
  56. SNDRV_PCM_INFO_INTERLEAVED |
  57. SNDRV_PCM_INFO_BLOCK_TRANSFER |
  58. SNDRV_PCM_INFO_MMAP_VALID |
  59. SNDRV_PCM_INFO_PAUSE |
  60. SNDRV_PCM_INFO_SYNC_START,
  61. .formats = SNDRV_PCM_FMTBIT_U8 |
  62. SNDRV_PCM_FMTBIT_S16_LE |
  63. SNDRV_PCM_FMTBIT_S24_3LE |
  64. SNDRV_PCM_FMTBIT_S32_LE |
  65. SNDRV_PCM_FMTBIT_S32_BE,
  66. .rates = SNDRV_PCM_RATE_8000_48000 |
  67. SNDRV_PCM_RATE_88200 |
  68. SNDRV_PCM_RATE_96000,
  69. .rate_min = 8000,
  70. .rate_max = 96000,
  71. .channels_min = 1,
  72. .channels_max = 8,
  73. .buffer_bytes_max = 262144,
  74. .period_bytes_min = 32,
  75. .period_bytes_max = 131072,
  76. .periods_min = 2,
  77. .periods_max = 220,
  78. /* One page (4k) contains 512 instructions. I don't know if the hw
  79. supports lists longer than this. In this case periods_max=220 is a
  80. safe limit to make sure the list never exceeds 512 instructions. */
  81. };
  82. #include "darla24_dsp.c"
  83. #include "echoaudio_dsp.c"
  84. #include "echoaudio.c"