xref: /haiku/src/add-ons/kernel/drivers/audio/usb/Driver.h (revision 4a3268e14fff4dd5a456d824b48ce6503368e4c1)
1 /*
2  *	Driver for USB Audio Device Class devices.
3  *	Copyright (c) 2009-13 S.Zharski <imker@gmx.li>
4  *	Distributed under the terms of the MIT license.
5  *
6  */
7 #ifndef _USB_AUDIO_DRIVER_H_
8 #define _USB_AUDIO_DRIVER_H_
9 
10 
11 #include <Drivers.h>
12 #include <USB3.h>
13 
14 
15 #define DRIVER_NAME	"usb_audio"
16 #define MAX_DEVICES	8
17 
18 const char* const kVersion = "ver.0.0.5";
19 
20 // initial buffer size in samples
21 const uint32 kSamplesBufferSize = 1024;
22 // [sub]buffers count
23 const uint32 kSamplesBufferCount = 2;
24 
25 // calculate count of array members
26 #ifdef _countof
27 	#warning "countof(...) WAS ALREADY DEFINED!!! Remove local definition!"
28 	#undef countof
29 #endif
30 #define _countof(array)(sizeof(array) / sizeof(array[0]))
31 
32 
33 extern usb_module_info* gUSBModule;
34 
35 extern "C" status_t usb_audio_device_added(usb_device device, void** cookie);
36 extern "C" status_t usb_audio_device_removed(void* cookie);
37 
38 extern "C" status_t init_hardware();
39 extern "C" void uninit_driver();
40 
41 extern "C" const char** publish_devices();
42 extern "C" device_hooks *find_device(const char* name);
43 
44 
45 #endif // _USB_AUDIO_DRIVER_H_
46 
47