2 Copyright © 2005-2013, Davy Wentzler. All rights reserved.
3 Copyright © 2010-2013, The AROS Development Team. All rights reserved.
7 #ifndef AHI_Drivers_misc_h
8 #define AHI_Drivers_misc_h
12 #include <devices/ahi.h>
13 #include <DriverData.h>
17 #define udelay MicroDelay
18 #define snd_printk DebugPrintF
20 #define outl(a, b) dev->OutLong(b, a)
21 #define outb(a, b) dev->OutByte(b, a)
26 AllocDriverData( struct PCIDevice
* dev
,
27 struct DriverBase
* AHIsubBase
);
30 FreeDriverData( struct CardData
* dd
,
31 struct DriverBase
* AHIsubBase
);
34 SaveMixerState( struct CardData
* dd
);
37 RestoreMixerState( struct CardData
* dd
);
40 UpdateMonitorMixer( struct CardData
* dd
);
43 Linear2MixerGain( Fixed linear
,
47 Linear2RecordGain( Fixed linear
,
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 */