motu.h (9e796e7d59e71f8a556cfbdc2ffa3aff0555dd0e) motu.h (71c3797779d3cd8378767f5b2d8cfd3b2f88c5c1)
1/*
2 * motu.h - a part of driver for MOTU FireWire series
3 *
4 * Copyright (c) 2015-2017 Takashi Sakamoto <o-takashi@sakamocchi.jp>
5 *
6 * Licensed under the terms of the GNU General Public License, version 2.
7 */
8
9#ifndef SOUND_FIREWIRE_MOTU_H_INCLUDED
10#define SOUND_FIREWIRE_MOTU_H_INCLUDED
11
12#include <linux/device.h>
13#include <linux/firewire.h>
14#include <linux/firewire-constants.h>
15#include <linux/module.h>
16#include <linux/mod_devicetable.h>
17#include <linux/mutex.h>
18#include <linux/slab.h>
1/*
2 * motu.h - a part of driver for MOTU FireWire series
3 *
4 * Copyright (c) 2015-2017 Takashi Sakamoto <o-takashi@sakamocchi.jp>
5 *
6 * Licensed under the terms of the GNU General Public License, version 2.
7 */
8
9#ifndef SOUND_FIREWIRE_MOTU_H_INCLUDED
10#define SOUND_FIREWIRE_MOTU_H_INCLUDED
11
12#include <linux/device.h>
13#include <linux/firewire.h>
14#include <linux/firewire-constants.h>
15#include <linux/module.h>
16#include <linux/mod_devicetable.h>
17#include <linux/mutex.h>
18#include <linux/slab.h>
19#include <linux/compat.h>
20#include <linux/sched/signal.h>
19
20#include <sound/control.h>
21#include <sound/core.h>
22#include <sound/pcm.h>
23#include <sound/info.h>
24#include <sound/rawmidi.h>
21
22#include <sound/control.h>
23#include <sound/core.h>
24#include <sound/pcm.h>
25#include <sound/info.h>
26#include <sound/rawmidi.h>
27#include <sound/firewire.h>
28#include <sound/hwdep.h>
25
26#include "../lib.h"
27#include "../amdtp-stream.h"
28#include "../iso-resources.h"
29
30struct snd_motu_packet_format {
31 unsigned char midi_flag_offset;
32 unsigned char midi_byte_offset;

--- 24 unchanged lines hidden (view full) ---

57 struct fw_iso_resources tx_resources;
58 struct fw_iso_resources rx_resources;
59 unsigned int capture_substreams;
60 unsigned int playback_substreams;
61
62 /* For notification. */
63 struct fw_address_handler async_handler;
64 u32 msg;
29
30#include "../lib.h"
31#include "../amdtp-stream.h"
32#include "../iso-resources.h"
33
34struct snd_motu_packet_format {
35 unsigned char midi_flag_offset;
36 unsigned char midi_byte_offset;

--- 24 unchanged lines hidden (view full) ---

61 struct fw_iso_resources tx_resources;
62 struct fw_iso_resources rx_resources;
63 unsigned int capture_substreams;
64 unsigned int playback_substreams;
65
66 /* For notification. */
67 struct fw_address_handler async_handler;
68 u32 msg;
69
70 /* For uapi */
71 int dev_lock_count;
72 bool dev_lock_changed;
73 wait_queue_head_t hwdep_wait;
65};
66
67enum snd_motu_spec_flags {
68 SND_MOTU_SPEC_SUPPORT_CLOCK_X2 = 0x0001,
69 SND_MOTU_SPEC_SUPPORT_CLOCK_X4 = 0x0002,
70 SND_MOTU_SPEC_TX_MICINST_CHUNK = 0x0004,
71 SND_MOTU_SPEC_TX_RETURN_CHUNK = 0x0008,
72 SND_MOTU_SPEC_TX_REVERB_CHUNK = 0x0010,

--- 58 unchanged lines hidden (view full) ---

131int snd_motu_transaction_register(struct snd_motu *motu);
132int snd_motu_transaction_reregister(struct snd_motu *motu);
133void snd_motu_transaction_unregister(struct snd_motu *motu);
134
135int snd_motu_stream_init_duplex(struct snd_motu *motu);
136void snd_motu_stream_destroy_duplex(struct snd_motu *motu);
137int snd_motu_stream_start_duplex(struct snd_motu *motu, unsigned int rate);
138void snd_motu_stream_stop_duplex(struct snd_motu *motu);
74};
75
76enum snd_motu_spec_flags {
77 SND_MOTU_SPEC_SUPPORT_CLOCK_X2 = 0x0001,
78 SND_MOTU_SPEC_SUPPORT_CLOCK_X4 = 0x0002,
79 SND_MOTU_SPEC_TX_MICINST_CHUNK = 0x0004,
80 SND_MOTU_SPEC_TX_RETURN_CHUNK = 0x0008,
81 SND_MOTU_SPEC_TX_REVERB_CHUNK = 0x0010,

--- 58 unchanged lines hidden (view full) ---

140int snd_motu_transaction_register(struct snd_motu *motu);
141int snd_motu_transaction_reregister(struct snd_motu *motu);
142void snd_motu_transaction_unregister(struct snd_motu *motu);
143
144int snd_motu_stream_init_duplex(struct snd_motu *motu);
145void snd_motu_stream_destroy_duplex(struct snd_motu *motu);
146int snd_motu_stream_start_duplex(struct snd_motu *motu, unsigned int rate);
147void snd_motu_stream_stop_duplex(struct snd_motu *motu);
148int snd_motu_stream_lock_try(struct snd_motu *motu);
149void snd_motu_stream_lock_release(struct snd_motu *motu);
139
140void snd_motu_proc_init(struct snd_motu *motu);
141
142int snd_motu_create_pcm_devices(struct snd_motu *motu);
143
144int snd_motu_create_midi_devices(struct snd_motu *motu);
150
151void snd_motu_proc_init(struct snd_motu *motu);
152
153int snd_motu_create_pcm_devices(struct snd_motu *motu);
154
155int snd_motu_create_midi_devices(struct snd_motu *motu);
156
157int snd_motu_create_hwdep_device(struct snd_motu *motu);
145#endif
158#endif