Check for SYS/GL during library init. Reason is that
[AROS.git] / workbench / devs / AHI / Drivers / CMI8738 / misc.h
blobe2c4a91870f8a1def2f502965a53378fdeb282a5
1 /*
2 The contents of this file are subject to the AROS Public License Version 1.1 (the "License");
3 you may not use this file except in compliance with the License. You may obtain a copy of the License at
4 http://www.aros.org/license.html
5 Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
6 ANY KIND, either express or implied. See the License for the specific language governing rights and
7 limitations under the License.
9 The Original Code is written by Davy Wentzler.
12 #ifndef AHI_Drivers_misc_h
13 #define AHI_Drivers_misc_h
15 //#include <config.h>
17 #include <devices/ahi.h>
18 #include <DriverData.h>
19 #include <stddef.h>
21 #define udelay micro_delay
22 void micro_delay(unsigned int val);
24 void WritePartialMask(struct PCIDevice *dev, struct CMI8738_DATA* card, unsigned long reg, unsigned long shift, unsigned long mask, unsigned long val);
25 void ClearMask(struct PCIDevice *dev, struct CMI8738_DATA* card, unsigned long reg, unsigned long mask);
26 void WriteMask(struct PCIDevice *dev, struct CMI8738_DATA* card, unsigned long reg, unsigned long mask);
27 void cmimix_wr(struct PCIDevice *dev, struct CMI8738_DATA* card, unsigned char port, unsigned char val);
28 unsigned char cmimix_rd(struct PCIDevice *dev, struct CMI8738_DATA* card, unsigned char port);
31 struct CMI8738_DATA*
32 AllocDriverData( struct PCIDevice* dev,
33 struct DriverBase* AHIsubBase );
35 void
36 FreeDriverData( struct CMI8738_DATA* card,
37 struct DriverBase* AHIsubBase );
39 void
40 SaveMixerState( struct CMI8738_DATA* card );
42 void
43 RestoreMixerState( struct CMI8738_DATA* card );
45 void
46 UpdateMonitorMixer( struct CMI8738_DATA* card );
48 Fixed
49 Linear2MixerGain( Fixed linear,
50 UWORD* bits );
52 Fixed
53 Linear2RecordGain( Fixed linear,
54 UWORD* bits );
56 ULONG
57 SamplerateToLinearPitch( ULONG samplingrate );
59 void *pci_alloc_consistent(size_t size, APTR *NonAlignedAddress, unsigned int boundary);
61 void pci_free_consistent(void* addr);
63 #endif /* AHI_Drivers_misc_h */