Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
amdtp.h File Reference
#include <linux/interrupt.h>
#include <linux/mutex.h>
#include <linux/spinlock.h>
#include "packets-buffer.h"

Go to the source code of this file.

Data Structures

struct  amdtp_out_stream
 

Macros

#define AMDTP_OUT_PCM_FORMAT_BITS
 

Enumerations

enum  cip_out_flags { CIP_NONBLOCKING = 0 }
 
enum  cip_sfc {
  CIP_SFC_32000 = 0, CIP_SFC_44100 = 1, CIP_SFC_48000 = 2, CIP_SFC_88200 = 3,
  CIP_SFC_96000 = 4, CIP_SFC_176400 = 5, CIP_SFC_192000 = 6
}
 

Functions

int amdtp_out_stream_init (struct amdtp_out_stream *s, struct fw_unit *unit, enum cip_out_flags flags)
 
void amdtp_out_stream_destroy (struct amdtp_out_stream *s)
 
void amdtp_out_stream_set_rate (struct amdtp_out_stream *s, unsigned int rate)
 
unsigned int amdtp_out_stream_get_max_payload (struct amdtp_out_stream *s)
 
int amdtp_out_stream_start (struct amdtp_out_stream *s, int channel, int speed)
 
void amdtp_out_stream_update (struct amdtp_out_stream *s)
 
void amdtp_out_stream_stop (struct amdtp_out_stream *s)
 
void amdtp_out_stream_set_pcm_format (struct amdtp_out_stream *s, snd_pcm_format_t format)
 
void amdtp_out_stream_pcm_prepare (struct amdtp_out_stream *s)
 
unsigned long amdtp_out_stream_pcm_pointer (struct amdtp_out_stream *s)
 
void amdtp_out_stream_pcm_abort (struct amdtp_out_stream *s)
 

Macro Definition Documentation

#define AMDTP_OUT_PCM_FORMAT_BITS
Value:
(SNDRV_PCM_FMTBIT_S16 | \
SNDRV_PCM_FMTBIT_S32)

Definition at line 33 of file amdtp.h.

Enumeration Type Documentation

enum cip_out_flags - describes details of the streaming protocol : In non-blocking mode, each packet contains sample_rate/8000 samples, with rounding up or down to adjust for clock skew and left-over fractional samples. This should be used if supported by the device.

Enumerator:
CIP_NONBLOCKING 

Definition at line 16 of file amdtp.h.

enum cip_sfc

enum cip_sfc - a stream's sample rate

Enumerator:
CIP_SFC_32000 
CIP_SFC_44100 
CIP_SFC_48000 
CIP_SFC_88200 
CIP_SFC_96000 
CIP_SFC_176400 
CIP_SFC_192000 

Definition at line 23 of file amdtp.h.

Function Documentation

void amdtp_out_stream_destroy ( struct amdtp_out_stream s)

amdtp_out_stream_destroy - free stream resources : the AMDTP output stream to destroy

Definition at line 63 of file amdtp.c.

unsigned int amdtp_out_stream_get_max_payload ( struct amdtp_out_stream s)

amdtp_out_stream_get_max_payload - get the stream's packet size : the AMDTP output stream

This function must not be called before the stream has been configured with amdtp_out_stream_set_hw_params(), amdtp_out_stream_set_pcm(), and amdtp_out_stream_set_midi().

Definition at line 116 of file amdtp.c.

int amdtp_out_stream_init ( struct amdtp_out_stream s,
struct fw_unit unit,
enum cip_out_flags  flags 
)

amdtp_out_stream_init - initialize an AMDTP output stream structure : the AMDTP output stream to initialize : the target of the stream : the packet transmission method to use

Definition at line 42 of file amdtp.c.

void amdtp_out_stream_pcm_abort ( struct amdtp_out_stream s)

amdtp_out_stream_pcm_abort - abort the running PCM device : the AMDTP stream about to be stopped

If the isochronous stream needs to be stopped asynchronously, call this function first to stop the PCM device.

Definition at line 598 of file amdtp.c.

unsigned long amdtp_out_stream_pcm_pointer ( struct amdtp_out_stream s)

amdtp_out_stream_pcm_pointer - get the PCM buffer position : the AMDTP output stream that transports the PCM data

Returns the current buffer position, in frames.

Definition at line 542 of file amdtp.c.

void amdtp_out_stream_pcm_prepare ( struct amdtp_out_stream s)

amdtp_out_stream_pcm_prepare - prepare PCM device for running : the AMDTP output stream

This function should be called from the PCM device's .prepare callback.

Definition at line 176 of file amdtp.c.

void amdtp_out_stream_set_pcm_format ( struct amdtp_out_stream s,
snd_pcm_format_t  format 
)

amdtp_out_stream_set_pcm_format - set the PCM format : the AMDTP output stream to configure : the format of the ALSA PCM device

The sample format must be set before the stream is started, and must not be changed while the stream is running.

Definition at line 150 of file amdtp.c.

void amdtp_out_stream_set_rate ( struct amdtp_out_stream s,
unsigned int  rate 
)

amdtp_out_stream_set_rate - set the sample rate : the AMDTP output stream to configure : the sample rate

The sample rate must be set before the stream is started, and must not be changed while the stream is running.

Definition at line 79 of file amdtp.c.

int amdtp_out_stream_start ( struct amdtp_out_stream s,
int  channel,
int  speed 
)

amdtp_out_stream_start - start sending packets : the AMDTP output stream to start : the isochronous channel on the bus : firewire speed code

The stream cannot be started until it has been configured with amdtp_out_stream_set_hw_params(), amdtp_out_stream_set_pcm(), and amdtp_out_stream_set_midi(); and it must be started before any PCM or MIDI device can be started.

Definition at line 462 of file amdtp.c.

void amdtp_out_stream_stop ( struct amdtp_out_stream s)

amdtp_out_stream_stop - stop sending packets : the AMDTP output stream to stop

All PCM and MIDI devices of the stream must be stopped before the stream itself can be stopped.

Definition at line 572 of file amdtp.c.

void amdtp_out_stream_update ( struct amdtp_out_stream s)

amdtp_out_stream_update - update the stream after a bus reset : the AMDTP output stream

Definition at line 558 of file amdtp.c.