Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef SOUND_FIREWIRE_AMDTP_AM824_H_INCLUDED
0003 #define SOUND_FIREWIRE_AMDTP_AM824_H_INCLUDED
0004 
0005 #include <sound/pcm.h>
0006 #include <sound/rawmidi.h>
0007 
0008 #include "amdtp-stream.h"
0009 
0010 #define AM824_IN_PCM_FORMAT_BITS    SNDRV_PCM_FMTBIT_S32
0011 
0012 #define AM824_OUT_PCM_FORMAT_BITS   SNDRV_PCM_FMTBIT_S32
0013 
0014 /*
0015  * This module supports maximum 64 PCM channels for one PCM stream
0016  * This is for our convenience.
0017  */
0018 #define AM824_MAX_CHANNELS_FOR_PCM  64
0019 
0020 /*
0021  * AMDTP packet can include channels for MIDI conformant data.
0022  * Each MIDI conformant data channel includes 8 MPX-MIDI data stream.
0023  * Each MPX-MIDI data stream includes one data stream from/to MIDI ports.
0024  *
0025  * This module supports maximum 1 MIDI conformant data channels.
0026  * Then this AMDTP packets can transfer maximum 8 MIDI data streams.
0027  */
0028 #define AM824_MAX_CHANNELS_FOR_MIDI 1
0029 
0030 int amdtp_am824_set_parameters(struct amdtp_stream *s, unsigned int rate,
0031                    unsigned int pcm_channels,
0032                    unsigned int midi_ports,
0033                    bool double_pcm_frames);
0034 
0035 void amdtp_am824_set_pcm_position(struct amdtp_stream *s, unsigned int index,
0036                  unsigned int position);
0037 
0038 void amdtp_am824_set_midi_position(struct amdtp_stream *s,
0039                    unsigned int position);
0040 
0041 int amdtp_am824_add_pcm_hw_constraints(struct amdtp_stream *s,
0042                        struct snd_pcm_runtime *runtime);
0043 
0044 void amdtp_am824_midi_trigger(struct amdtp_stream *s, unsigned int port,
0045                   struct snd_rawmidi_substream *midi);
0046 
0047 int amdtp_am824_init(struct amdtp_stream *s, struct fw_unit *unit,
0048              enum amdtp_stream_direction dir, unsigned int flags);
0049 #endif