diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
commit | 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch) | |
tree | 0bba044c4ce775e45a88a51686b5d9f90697ea9d /drivers/ieee1394/amdtp.h |
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.
Let it rip!
Diffstat (limited to 'drivers/ieee1394/amdtp.h')
-rw-r--r-- | drivers/ieee1394/amdtp.h | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/drivers/ieee1394/amdtp.h b/drivers/ieee1394/amdtp.h new file mode 100644 index 000000000000..531f28e3ab50 --- /dev/null +++ b/drivers/ieee1394/amdtp.h | |||
@@ -0,0 +1,84 @@ | |||
1 | /* -*- c-basic-offset: 8 -*- */ | ||
2 | |||
3 | #ifndef __AMDTP_H | ||
4 | #define __AMDTP_H | ||
5 | |||
6 | #include <asm/types.h> | ||
7 | #include "ieee1394-ioctl.h" | ||
8 | |||
9 | /* The userspace interface for the Audio & Music Data Transmission | ||
10 | * Protocol driver is really simple. First, open /dev/amdtp, use the | ||
11 | * ioctl to configure format, rate, dimension and either plug or | ||
12 | * channel, then start writing samples. | ||
13 | * | ||
14 | * The formats supported by the driver are listed below. | ||
15 | * AMDTP_FORMAT_RAW corresponds to the AM824 raw format, which can | ||
16 | * carry any number of channels, so use this if you're streaming | ||
17 | * multichannel audio. The AMDTP_FORMAT_IEC958_PCM corresponds to the | ||
18 | * AM824 IEC958 encapsulation without the IEC958 data bit set, using | ||
19 | * AMDTP_FORMAT_IEC958_AC3 will transmit the samples with the data bit | ||
20 | * set, suitable for transmitting compressed AC-3 audio. | ||
21 | * | ||
22 | * The rate field specifies the transmission rate; supported values | ||
23 | * are 32000, 44100, 48000, 88200, 96000, 176400 and 192000. | ||
24 | * | ||
25 | * The dimension field specifies the dimension of the signal, that is, | ||
26 | * the number of audio channels. Only AMDTP_FORMAT_RAW supports | ||
27 | * settings greater than 2. | ||
28 | * | ||
29 | * The mode field specifies which transmission mode to use. The AMDTP | ||
30 | * specifies two different transmission modes: blocking and | ||
31 | * non-blocking. The blocking transmission mode always send a fixed | ||
32 | * number of samples, typically 8, 16 or 32. To exactly match the | ||
33 | * transmission rate, the driver alternates between sending empty and | ||
34 | * non-empty packets. In non-blocking mode, the driver transmits as | ||
35 | * small packets as possible. For example, for a transmission rate of | ||
36 | * 44100Hz, the driver should send 5 41/80 samples in every cycle, but | ||
37 | * this is not possible so instead the driver alternates between | ||
38 | * sending 5 and 6 samples. | ||
39 | * | ||
40 | * The last thing to specify is either the isochronous channel to use | ||
41 | * or the output plug to connect to. If you know what channel the | ||
42 | * destination device will listen on, you can specify the channel | ||
43 | * directly and use the AMDTP_IOC_CHANNEL ioctl. However, if the | ||
44 | * destination device chooses the channel and uses the IEC61883-1 plug | ||
45 | * mechanism, you can specify an output plug to connect to. The | ||
46 | * driver will pick up the channel number from the plug once the | ||
47 | * destination device locks the output plug control register. In this | ||
48 | * case set the plug field and use the AMDTP_IOC_PLUG ioctl. | ||
49 | * | ||
50 | * Having configured the interface, the driver now accepts writes of | ||
51 | * regular 16 bit signed little endian samples, with the channels | ||
52 | * interleaved. For example, 4 channels would look like: | ||
53 | * | ||
54 | * | sample 0 | sample 1 ... | ||
55 | * | ch. 0 | ch. 1 | ch. 2 | ch. 3 | ch. 0 | ... | ||
56 | * | lsb | msb | lsb | msb | lsb | msb | lsb | msb | lsb | msb | ... | ||
57 | * | ||
58 | */ | ||
59 | |||
60 | enum { | ||
61 | AMDTP_FORMAT_RAW, | ||
62 | AMDTP_FORMAT_IEC958_PCM, | ||
63 | AMDTP_FORMAT_IEC958_AC3 | ||
64 | }; | ||
65 | |||
66 | enum { | ||
67 | AMDTP_MODE_BLOCKING, | ||
68 | AMDTP_MODE_NON_BLOCKING, | ||
69 | }; | ||
70 | |||
71 | enum { | ||
72 | AMDTP_INPUT_LE16, | ||
73 | AMDTP_INPUT_BE16, | ||
74 | }; | ||
75 | |||
76 | struct amdtp_ioctl { | ||
77 | __u32 format; | ||
78 | __u32 rate; | ||
79 | __u32 dimension; | ||
80 | __u32 mode; | ||
81 | union { __u32 channel; __u32 plug; } u; | ||
82 | }; | ||
83 | |||
84 | #endif /* __AMDTP_H */ | ||