indigoio.c 2.3 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 INDIGO_FAMILY
  7. #define ECHOCARD_INDIGO_IO
  8. #define ECHOCARD_NAME "Indigo IO"
  9. #define ECHOCARD_HAS_MONITOR
  10. #define ECHOCARD_HAS_SUPER_INTERLEAVE
  11. #define ECHOCARD_HAS_VMIXER
  12. #define ECHOCARD_HAS_STEREO_BIG_ENDIAN32
  13. /* Pipe indexes */
  14. #define PX_ANALOG_OUT 0 /* 8 */
  15. #define PX_DIGITAL_OUT 8 /* 0 */
  16. #define PX_ANALOG_IN 8 /* 2 */
  17. #define PX_DIGITAL_IN 10 /* 0 */
  18. #define PX_NUM 10
  19. /* Bus indexes */
  20. #define BX_ANALOG_OUT 0 /* 2 */
  21. #define BX_DIGITAL_OUT 2 /* 0 */
  22. #define BX_ANALOG_IN 2 /* 2 */
  23. #define BX_DIGITAL_IN 4 /* 0 */
  24. #define BX_NUM 4
  25. #include <linux/delay.h>
  26. #include <linux/init.h>
  27. #include <linux/interrupt.h>
  28. #include <linux/pci.h>
  29. #include <linux/module.h>
  30. #include <linux/firmware.h>
  31. #include <linux/slab.h>
  32. #include <linux/io.h>
  33. #include <sound/core.h>
  34. #include <sound/info.h>
  35. #include <sound/control.h>
  36. #include <sound/tlv.h>
  37. #include <sound/pcm.h>
  38. #include <sound/pcm_params.h>
  39. #include <sound/asoundef.h>
  40. #include <sound/initval.h>
  41. #include <linux/atomic.h>
  42. #include "echoaudio.h"
  43. MODULE_FIRMWARE("ea/loader_dsp.fw");
  44. MODULE_FIRMWARE("ea/indigo_io_dsp.fw");
  45. #define FW_361_LOADER 0
  46. #define FW_INDIGO_IO_DSP 1
  47. static const struct firmware card_fw[] = {
  48. {0, "loader_dsp.fw"},
  49. {0, "indigo_io_dsp.fw"}
  50. };
  51. static const struct pci_device_id snd_echo_ids[] = {
  52. {0x1057, 0x3410, 0xECC0, 0x00A0, 0, 0, 0}, /* Indigo IO*/
  53. {0,}
  54. };
  55. static const struct snd_pcm_hardware pcm_hardware_skel = {
  56. .info = SNDRV_PCM_INFO_MMAP |
  57. SNDRV_PCM_INFO_INTERLEAVED |
  58. SNDRV_PCM_INFO_BLOCK_TRANSFER |
  59. SNDRV_PCM_INFO_MMAP_VALID |
  60. SNDRV_PCM_INFO_PAUSE |
  61. SNDRV_PCM_INFO_SYNC_START,
  62. .formats = SNDRV_PCM_FMTBIT_U8 |
  63. SNDRV_PCM_FMTBIT_S16_LE |
  64. SNDRV_PCM_FMTBIT_S24_3LE |
  65. SNDRV_PCM_FMTBIT_S32_LE |
  66. SNDRV_PCM_FMTBIT_S32_BE,
  67. .rates = SNDRV_PCM_RATE_32000 |
  68. SNDRV_PCM_RATE_44100 |
  69. SNDRV_PCM_RATE_48000 |
  70. SNDRV_PCM_RATE_88200 |
  71. SNDRV_PCM_RATE_96000,
  72. .rate_min = 32000,
  73. .rate_max = 96000,
  74. .channels_min = 1,
  75. .channels_max = 8,
  76. .buffer_bytes_max = 262144,
  77. .period_bytes_min = 32,
  78. .period_bytes_max = 131072,
  79. .periods_min = 2,
  80. .periods_max = 220,
  81. };
  82. #include "indigoio_dsp.c"
  83. #include "echoaudio_dsp.c"
  84. #include "echoaudio.c"