2 * SiS 7018, Trident 4D Wave DX/NX, Acer Lab M5451 Sound Driver.
3 * Copyright (c) 2002, 2008-2011 S.Zharski <imker@gmx.li>
4 * Distributed under the terms of the MIT license.
7 #ifndef _SiS7018_DEVICE_H_
8 #define _SiS7018_DEVICE_H_
11 #include <KernelExport.h>
15 #include "Registers.h"
20 // card ids for supported audio hardware
21 const uint32 SiS7018
= 0x70181039;
22 const uint32 ALi5451
= 0x545110b9;
23 const uint32 TridentDX
= 0x20001023;
24 const uint32 TridentNX
= 0x20011023;
34 inline const char* Name() { return fName
; }
35 inline uint16
DeviceId() { return (fId
>> 16) & 0xffff; }
36 inline uint16
VendorId() { return (fId
) & 0xffff; }
37 inline uint32
Id() { return fId
; }
40 uint32
HardwareId() { return fInfo
.Id(); }
41 pci_info
& PCIInfo() { return fPCIInfo
; }
44 Device(Info
&DeviceInfo
, pci_info
&PCIInfo
);
48 status_t
InitCheck() { return fStatus
; };
50 status_t
Open(uint32 flags
);
51 status_t
Read(uint8
*buffer
, size_t *numBytes
);
52 status_t
Write(const uint8
*buffer
, size_t *numBytes
);
53 status_t
Control(uint32 op
, void *buffer
, size_t length
);
57 static int32
InterruptHandler(void *interruptParam
);
58 void SignalReadyBuffers();
60 class Mixer
& Mixer() { return fMixer
; }
63 void Unlock(cpu_status st
);
65 uint8
ReadPCI8(int offset
);
66 uint16
ReadPCI16(int offset
);
67 uint32
ReadPCI32(int offset
);
68 void WritePCI8(int offset
, uint8 value
);
69 void WritePCI16(int offset
, uint16 value
);
70 void WritePCI32(int offset
, uint32 value
);
73 status_t
_ReserveDeviceOnBus(bool reserve
);
74 void _ResetCard(uint32 resetMask
, uint32 releaseMask
);
76 status_t
_MultiGetDescription(multi_description
*Description
);
77 status_t
_MultiGetEnabledChannels(multi_channel_enable
*Enable
);
78 status_t
_MultiSetEnabledChannels(multi_channel_enable
*Enable
);
79 status_t
_MultiGetBuffers(multi_buffer_list
* List
);
80 status_t
_MultiGetGlobalFormat(multi_format_info
*Format
);
81 status_t
_MultiSetGlobalFormat(multi_format_info
*Format
);
82 status_t
_MultiGetMix(multi_mix_value_info
*Info
);
83 status_t
_MultiSetMix(multi_mix_value_info
*Info
);
84 status_t
_MultiListMixControls(multi_mix_control_info
* Info
);
85 status_t
_MultiBufferExchange(multi_buffer_info
* Info
);
92 int32 fInterruptsNest
;
93 sem_id fBuffersReadySem
;
96 Stream fPlaybackStream
;
100 #endif // _SiS7018_DEVICE_H_