Importing CMI8738-20072011
[AROS.git] / workbench / devs / AHI / Drivers / CMI8738 / misc.h
blob0e3cb2c5c965280179e29c57af7743a964d6ba90
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 void WritePartialMask(struct PCIDevice *dev, struct CardData* card, unsigned long reg, unsigned long shift, unsigned long mask, unsigned long val);
22 void ClearMask(struct PCIDevice *dev, struct CardData* card, unsigned long reg, unsigned long mask);
23 void WriteMask(struct PCIDevice *dev, struct CardData* card, unsigned long reg, unsigned long mask);
24 void cmimix_wr(struct PCIDevice *dev, struct CardData* card, unsigned char port, unsigned char val);
25 unsigned char cmimix_rd(struct PCIDevice *dev, struct CardData* card, unsigned char port);
28 struct CardData*
29 AllocDriverData( struct PCIDevice* dev,
30 struct DriverBase* AHIsubBase );
32 void
33 FreeDriverData( struct CardData* card,
34 struct DriverBase* AHIsubBase );
36 void
37 SaveMixerState( struct CardData* card );
39 void
40 RestoreMixerState( struct CardData* card );
42 void
43 UpdateMonitorMixer( struct CardData* card );
45 Fixed
46 Linear2MixerGain( Fixed linear,
47 UWORD* bits );
49 Fixed
50 Linear2RecordGain( Fixed linear,
51 UWORD* bits );
53 ULONG
54 SamplerateToLinearPitch( ULONG samplingrate );
56 void *pci_alloc_consistent(size_t size, APTR *NonAlignedAddress);
58 void pci_free_consistent(void* addr);
60 #endif /* AHI_Drivers_misc_h */