darla20.c 2.2 KB

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