1 #ifndef AHI_Drivers_misc_h
2 #define AHI_Drivers_misc_h
6 #include <devices/ahi.h>
7 #include <DriverData.h>
11 #define udelay micro_delay
14 struct HDAudioChip
* AllocDriverData(APTR dev
, struct DriverBase
* AHIsubBase
);
15 void FreeDriverData(struct HDAudioChip
* dd
, struct DriverBase
* AHIsubBase
);
17 void *pci_alloc_consistent(size_t size
, APTR
*NonAlignedAddress
, unsigned int boundary
);
18 void pci_free_consistent(void* addr
);
20 void micro_delay(unsigned int val
);
22 // returns the RIRBWP just before sending the command. Used for 12-bit verbs
23 ULONG
send_command_12(UBYTE codec
, UBYTE node
, UWORD verb
, UBYTE payload
, struct HDAudioChip
*card
);
24 ULONG
send_command_4(UBYTE codec
, UBYTE node
, UBYTE verb
, UWORD payload
, struct HDAudioChip
*card
);
25 ULONG
get_parameter(UBYTE node
, UBYTE parameter
, struct HDAudioChip
*card
);
27 void set_monitor_volumes(struct HDAudioChip
*card
, double dB
);
28 void set_adc_input(struct HDAudioChip
*card
);
29 void set_adc_gain(struct HDAudioChip
*card
, double dB
);
30 void set_dac_gain(struct HDAudioChip
*card
, double dB
);
32 void switch_nid_to_input(struct HDAudioChip
*card
, UBYTE NID
);
33 void switch_nid_to_output(struct HDAudioChip
*card
, UBYTE NID
);
35 void codec_discovery(struct HDAudioChip
*card
);
37 // when this function is called, the chip is queried for its NID's etc. instead of looking at the hardcoded values
38 void setForceQuery(void);
40 // when set, will call codec_discovery, dumping all information about all NID's
41 void setDumpAll(void);
43 // when set, it uses this as speaker NID instead of querying the chip
44 void setForceSpeaker(int speaker_nid
);
46 BOOL
is_jack_connected(struct HDAudioChip
*card
, UBYTE NID
);
47 void detect_headphone_change(struct HDAudioChip
*card
);
49 #endif /* AHI_Drivers_misc_h */