13#include <KernelExport.h>
21#ifndef HAIKU_TARGET_PLATFORM_HAIKU
22# define DEVFS_PATH_FORMAT "audio/multi/hda/%lu"
23# include <multi_audio.h>
25# define DEVFS_PATH_FORMAT "audio/hmulti/hda/%lu"
26# include <hmulti_audio.h>
37# define PCI_hd_audio 3
40#define HDA_MAX_AUDIO_GROUPS 15
41#define HDA_MAX_CODECS 15
42#define HDA_MAX_STREAMS 16
43#define MAX_CODEC_RESPONSES 16
44#define MAX_CODEC_UNSOL_RESPONSES 16
46#define MAX_IO_WIDGETS 8
47#define MAX_ASSOCIATIONS 16
48#define MAX_ASSOCIATION_PINS 16
50#define STREAM_MAX_BUFFERS 10
51#define STREAM_MIN_BUFFERS 2
108 return *(vuint16*)(
regs +
reg);
113 return *(vuint32*)(
regs +
reg);
269#define WIDGET_FLAG_OUTPUT_PATH 0x01
270#define WIDGET_FLAG_INPUT_PATH 0x02
271#define WIDGET_FLAG_WIDGET_PATH 0x04
333#define MULTI_CONTROL_FIRSTID 1024
334#define MULTI_CONTROL_MASTERID 0
335#define MULTI_MAX_CONTROLS 128
336#define MULTI_MAX_CHANNELS 128
367extern pci_module_info*
gPci;
#define STREAM_MAX_BUFFERS
status_t hda_audio_group_get_widgets(hda_audio_group *audioGroup, hda_stream *stream)
status_t hda_stream_stop(hda_controller *controller, hda_stream *stream)
void hda_stream_delete(hda_stream *stream)
hda_codec * hda_codec_new(hda_controller *controller, uint32 cad)
status_t hda_send_verbs(hda_codec *codec, corb_t *verbs, uint32 *responses, uint32 count)
#define MAX_ASSOCIATION_PINS
hda_stream * hda_stream_new(hda_audio_group *audioGroup, int type)
#define MULTI_MAX_CHANNELS
#define MULTI_MAX_CONTROLS
void hda_hw_uninit(hda_controller *controller)
pci_x86_module_info * gPCIx86Module
#define HDA_MAX_AUDIO_GROUPS
#define MAX_CODEC_RESPONSES
device_hooks gDriverHooks
status_t hda_verb_write(hda_codec *codec, uint32 nid, uint32 vid, uint16 payload)
hda_controller gCards[MAX_CARDS]
status_t hda_stream_setup_buffers(hda_audio_group *audioGroup, hda_stream *stream, const char *desc)
status_t multi_audio_control(void *cookie, uint32 op, void *arg, size_t length)
status_t hda_verb_read(hda_codec *codec, uint32 nid, uint32 vid, uint32 *response)
status_t hda_stream_start(hda_controller *controller, hda_stream *stream)
void hda_codec_delete(hda_codec *codec)
hda_widget * hda_audio_group_get_widget(hda_audio_group *audioGroup, uint32 nodeID)
void hda_hw_stop(hda_controller *controller)
status_t hda_hw_init(hda_controller *controller)
#define MAX_CODEC_UNSOL_RESPONSES
const char * get_widget_location(uint32 location)
GLuint GLuint GLsizei GLenum type
GLuint GLuint GLsizei count
GLuint GLsizei GLsizei * length
static const WCHAR desc[]
uint32 pins[MAX_ASSOCIATION_PINS]
hda_stream * record_stream
hda_association associations[MAX_ASSOCIATIONS]
hda_stream * playback_stream
thread_id unsol_response_thread
uint32 unsol_responses[MAX_CODEC_UNSOL_RESPONSES]
uint32 unsol_response_read
sem_id unsol_response_sem
struct hda_controller * controller
uint32 responses[MAX_CODEC_RESPONSES]
hda_audio_group * audio_groups[HDA_MAX_AUDIO_GROUPS]
uint32 unsol_response_write
void Write8(uint32 reg, uint8 value)
uint32 * stream_positions
uint32 Read32(uint32 reg)
void ReadModifyWrite8(uint32 reg, uint8 mask, uint8 value)
void Write32(uint32 reg, uint32 value)
void ReadModifyWrite16(uint32 reg, uint16 mask, uint16 value)
void ReadModifyWrite32(uint32 reg, uint32 mask, uint32 value)
void Write16(uint32 reg, uint16 value)
area_id corb_rirb_pos_area
hda_codec * codecs[HDA_MAX_CODECS+1]
uint16 Read16(uint32 reg)
hda_stream * streams[HDA_MAX_STREAMS]
uint32 num_output_streams
multi_mix_control mix_control
multi_channel_info chans[MULTI_MAX_CHANNELS]
uint32 aux_bus_channel_count
hda_multi_mixer_control controls[MULTI_MAX_CONTROLS]
uint32 input_bus_channel_count
uint32 output_channel_count
uint32 output_bus_channel_count
uint32 input_channel_count
void Write16(uint32 reg, uint16 value)
volatile int32 buffer_cycle
uint32 io_widgets[MAX_IO_WIDGETS]
volatile bigtime_t real_time
uint16 Read16(uint32 reg)
uint32 last_link_frame_position
void Write32(uint32 reg, uint32 value)
area_id buffer_descriptors_area
phys_addr_t physical_buffer_descriptors
uint32 Read32(uint32 reg)
void Write8(uint32 reg, uint8 value)
volatile uint64 frames_count
phys_addr_t physical_buffers[STREAM_MAX_BUFFERS]
hda_controller * controller
int32 incorrect_position_count