amdtp-am824.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #ifndef SOUND_FIREWIRE_AMDTP_AM824_H_INCLUDED
  2. #define SOUND_FIREWIRE_AMDTP_AM824_H_INCLUDED
  3. #include <sound/pcm.h>
  4. #include <sound/rawmidi.h>
  5. #include "amdtp-stream.h"
  6. #define AM824_IN_PCM_FORMAT_BITS SNDRV_PCM_FMTBIT_S32
  7. #define AM824_OUT_PCM_FORMAT_BITS (SNDRV_PCM_FMTBIT_S16 | \
  8. SNDRV_PCM_FMTBIT_S32)
  9. /*
  10. * This module supports maximum 64 PCM channels for one PCM stream
  11. * This is for our convenience.
  12. */
  13. #define AM824_MAX_CHANNELS_FOR_PCM 64
  14. /*
  15. * AMDTP packet can include channels for MIDI conformant data.
  16. * Each MIDI conformant data channel includes 8 MPX-MIDI data stream.
  17. * Each MPX-MIDI data stream includes one data stream from/to MIDI ports.
  18. *
  19. * This module supports maximum 1 MIDI conformant data channels.
  20. * Then this AMDTP packets can transfer maximum 8 MIDI data streams.
  21. */
  22. #define AM824_MAX_CHANNELS_FOR_MIDI 1
  23. int amdtp_am824_set_parameters(struct amdtp_stream *s, unsigned int rate,
  24. unsigned int pcm_channels,
  25. unsigned int midi_ports,
  26. bool double_pcm_frames);
  27. void amdtp_am824_set_pcm_position(struct amdtp_stream *s, unsigned int index,
  28. unsigned int position);
  29. void amdtp_am824_set_midi_position(struct amdtp_stream *s,
  30. unsigned int position);
  31. int amdtp_am824_add_pcm_hw_constraints(struct amdtp_stream *s,
  32. struct snd_pcm_runtime *runtime);
  33. void amdtp_am824_set_pcm_format(struct amdtp_stream *s,
  34. snd_pcm_format_t format);
  35. void amdtp_am824_midi_trigger(struct amdtp_stream *s, unsigned int port,
  36. struct snd_rawmidi_substream *midi);
  37. int amdtp_am824_init(struct amdtp_stream *s, struct fw_unit *unit,
  38. enum amdtp_stream_direction dir, enum cip_flags flags);
  39. #endif