indigoiox.c 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * ALSA driver for Echoaudio soundcards.
  4. * Copyright (C) 2009 Giuliano Pochini <[email protected]>
  5. */
  6. #define INDIGO_FAMILY
  7. #define ECHOCARD_INDIGO_IOX
  8. #define ECHOCARD_NAME "Indigo IOx"
  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/io.h>
  32. #include <linux/slab.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_iox_dsp.fw");
  45. #define FW_361_LOADER 0
  46. #define FW_INDIGO_IOX_DSP 1
  47. static const struct firmware card_fw[] = {
  48. {0, "loader_dsp.fw"},
  49. {0, "indigo_iox_dsp.fw"}
  50. };
  51. static const struct pci_device_id snd_echo_ids[] = {
  52. {0x1057, 0x3410, 0xECC0, 0x00D0, 0, 0, 0}, /* Indigo IOx */
  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_64000 |
  71. SNDRV_PCM_RATE_88200 |
  72. SNDRV_PCM_RATE_96000,
  73. .rate_min = 32000,
  74. .rate_max = 96000,
  75. .channels_min = 1,
  76. .channels_max = 8,
  77. .buffer_bytes_max = 262144,
  78. .period_bytes_min = 32,
  79. .period_bytes_max = 131072,
  80. .periods_min = 2,
  81. .periods_max = 220,
  82. };
  83. #include "indigoiox_dsp.c"
  84. #include "indigo_express_dsp.c"
  85. #include "echoaudio_dsp.c"
  86. #include "echoaudio.c"