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
17 #include <devices/ahi.h>
18 #include <DriverData.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
);
32 AllocDriverData( struct PCIDevice
* dev
,
33 struct DriverBase
* AHIsubBase
);
36 FreeDriverData( struct CMI8738_DATA
* card
,
37 struct DriverBase
* AHIsubBase
);
40 SaveMixerState( struct CMI8738_DATA
* card
);
43 RestoreMixerState( struct CMI8738_DATA
* card
);
46 UpdateMonitorMixer( struct CMI8738_DATA
* card
);
49 Linear2MixerGain( Fixed linear
,
53 Linear2RecordGain( Fixed linear
,
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 */