Commit | Line | Data |
---|---|---|
e2786ca6 TS |
1 | /* |
2 | * oxfw.h - a part of driver for OXFW970/971 based devices | |
3 | * | |
4 | * Copyright (c) Clemens Ladisch <clemens@ladisch.de> | |
5 | * Licensed under the terms of the GNU General Public License, version 2. | |
6 | */ | |
7 | ||
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> | |
15 | ||
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 | ||
22 | #include "../lib.h" | |
23 | #include "../fcp.h" | |
24 | #include "../packets-buffer.h" | |
25 | #include "../iso-resources.h" | |
26 | #include "../amdtp.h" | |
27 | #include "../cmp.h" | |
28 | ||
29 | struct device_info { | |
30 | const char *driver_name; | |
fec7b753 TS |
31 | const char *vendor_name; |
32 | const char *model_name; | |
e2786ca6 TS |
33 | int (*pcm_constraints)(struct snd_pcm_runtime *runtime); |
34 | unsigned int mixer_channels; | |
35 | u8 mute_fb_id; | |
36 | u8 volume_fb_id; | |
37 | }; | |
38 | ||
39 | struct snd_oxfw { | |
40 | struct snd_card *card; | |
41 | struct fw_unit *unit; | |
42 | const struct device_info *device_info; | |
43 | struct mutex mutex; | |
44 | struct cmp_connection in_conn; | |
45 | struct amdtp_stream rx_stream; | |
46 | bool mute; | |
47 | s16 volume[6]; | |
48 | s16 volume_min; | |
49 | s16 volume_max; | |
50 | }; | |
51 | ||
52 | int snd_oxfw_stream_init_simplex(struct snd_oxfw *oxfw); | |
53 | int snd_oxfw_stream_start_simplex(struct snd_oxfw *oxfw); | |
54 | void snd_oxfw_stream_stop_simplex(struct snd_oxfw *oxfw); | |
55 | void snd_oxfw_stream_destroy_simplex(struct snd_oxfw *oxfw); | |
56 | void snd_oxfw_stream_update_simplex(struct snd_oxfw *oxfw); | |
3713d93a TS |
57 | |
58 | int firewave_constraints(struct snd_pcm_runtime *runtime); | |
59 | int lacie_speakers_constraints(struct snd_pcm_runtime *runtime); | |
60 | int snd_oxfw_create_pcm(struct snd_oxfw *oxfw); | |
31514bfb TS |
61 | |
62 | int snd_oxfw_create_mixer(struct snd_oxfw *oxfw); |