2 * oxfw.h - a part of driver for OXFW970/971 based devices
4 * Copyright (c) Clemens Ladisch <clemens@ladisch.de>
5 * Licensed under the terms of the GNU General Public License, version 2.
8 #include <linux/device.h>
9 #include <linux/firewire.h>
10 #include <linux/firewire-constants.h>
11 #include <linux/module.h>
12 #include <linux/mod_devicetable.h>
13 #include <linux/mutex.h>
14 #include <linux/slab.h>
16 #include <sound/control.h>
17 #include <sound/core.h>
18 #include <sound/initval.h>
19 #include <sound/pcm.h>
20 #include <sound/pcm_params.h>
21 #include <sound/info.h>
25 #include "../packets-buffer.h"
26 #include "../iso-resources.h"
31 const char *driver_name
;
32 const char *vendor_name
;
33 const char *model_name
;
34 unsigned int mixer_channels
;
39 /* This is an arbitrary number for convinience. */
40 #define SND_OXFW_STREAM_FORMAT_ENTRIES 10
42 struct snd_card
*card
;
44 const struct device_info
*device_info
;
47 u8
*rx_stream_formats
[SND_OXFW_STREAM_FORMAT_ENTRIES
];
49 struct cmp_connection in_conn
;
50 struct amdtp_stream rx_stream
;
59 * AV/C Stream Format Information Specification 1.1 Working Draft
62 int avc_stream_set_format(struct fw_unit
*unit
, enum avc_general_plug_dir dir
,
63 unsigned int pid
, u8
*format
, unsigned int len
);
64 int avc_stream_get_format(struct fw_unit
*unit
,
65 enum avc_general_plug_dir dir
, unsigned int pid
,
66 u8
*buf
, unsigned int *len
, unsigned int eid
);
68 avc_stream_get_format_single(struct fw_unit
*unit
,
69 enum avc_general_plug_dir dir
, unsigned int pid
,
70 u8
*buf
, unsigned int *len
)
72 return avc_stream_get_format(unit
, dir
, pid
, buf
, len
, 0xff);
75 avc_stream_get_format_list(struct fw_unit
*unit
,
76 enum avc_general_plug_dir dir
, unsigned int pid
,
77 u8
*buf
, unsigned int *len
,
80 return avc_stream_get_format(unit
, dir
, pid
, buf
, len
, eid
);
84 * AV/C Digital Interface Command Set General Specification 4.2
87 int avc_general_inquiry_sig_fmt(struct fw_unit
*unit
, unsigned int rate
,
88 enum avc_general_plug_dir dir
,
91 int snd_oxfw_stream_init_simplex(struct snd_oxfw
*oxfw
);
92 int snd_oxfw_stream_start_simplex(struct snd_oxfw
*oxfw
, unsigned int rate
,
93 unsigned int pcm_channels
);
94 void snd_oxfw_stream_stop_simplex(struct snd_oxfw
*oxfw
);
95 void snd_oxfw_stream_destroy_simplex(struct snd_oxfw
*oxfw
);
96 void snd_oxfw_stream_update_simplex(struct snd_oxfw
*oxfw
);
98 struct snd_oxfw_stream_formation
{
103 int snd_oxfw_stream_parse_format(u8
*format
,
104 struct snd_oxfw_stream_formation
*formation
);
105 int snd_oxfw_stream_get_current_formation(struct snd_oxfw
*oxfw
,
106 enum avc_general_plug_dir dir
,
107 struct snd_oxfw_stream_formation
*formation
);
108 int snd_oxfw_stream_discover(struct snd_oxfw
*oxfw
);
110 int snd_oxfw_create_pcm(struct snd_oxfw
*oxfw
);
112 int snd_oxfw_create_mixer(struct snd_oxfw
*oxfw
);
114 void snd_oxfw_proc_init(struct snd_oxfw
*oxfw
);