Check for SYS/GL during library init. Reason is that
[AROS.git] / workbench / devs / AHI / Drivers / VIA-AC97 / misc.h
blobaa23d7c685333d0349a609e8d9c0b73c9b8b5405
1 /*
2 Copyright © 2005-2013, Davy Wentzler. All rights reserved.
3 Copyright © 2010-2013, The AROS Development Team. All rights reserved.
4 $Id$
5 */
7 #ifndef AHI_Drivers_misc_h
8 #define AHI_Drivers_misc_h
10 #include <config.h>
12 #include <devices/ahi.h>
13 #include <DriverData.h>
14 #include <stddef.h>
17 #define udelay MicroDelay
18 #define snd_printk DebugPrintF
19 #ifdef __amigaos4__
20 #define outl(a, b) dev->OutLong(b, a)
21 #define outb(a, b) dev->OutByte(b, a)
22 #endif
25 struct CardData*
26 AllocDriverData( struct PCIDevice* dev,
27 struct DriverBase* AHIsubBase );
29 void
30 FreeDriverData( struct CardData* dd,
31 struct DriverBase* AHIsubBase );
33 void
34 SaveMixerState( struct CardData* dd );
36 void
37 RestoreMixerState( struct CardData* dd );
39 void
40 UpdateMonitorMixer( struct CardData* dd );
42 Fixed
43 Linear2MixerGain( Fixed linear,
44 UWORD* bits );
46 Fixed
47 Linear2RecordGain( Fixed linear,
48 UWORD* bits );
50 ULONG
51 SamplerateToLinearPitch( ULONG samplingrate );
53 void *pci_alloc_consistent(size_t size, APTR *NonAlignedAddress);
55 void pci_free_consistent(void* addr);
57 void MicroDelay(unsigned int val);
58 void channel_reset(struct CardData *card);
60 unsigned int codec_xread(struct CardData *card);
61 void codec_xwrite(struct CardData *card, unsigned int val);
62 int codec_ready(struct CardData *card);
63 int codec_valid(struct CardData *card);
64 void codec_wait(struct CardData *card);
65 void codec_write(struct CardData *card, unsigned short reg, unsigned short val);
66 unsigned short codec_read(struct CardData *card, unsigned char reg);
68 BOOL ac97_read_reg(struct CardData *card, unsigned char reg, unsigned short *data );
71 #endif /* AHI_Drivers_misc_h */