|
XenevaOS
|


Go to the source code of this file.
Classes | |
| struct | _bdl_ |
| struct | _hd_audio_ |
Macros | |
| #define | GCAP 0x00 |
| Device Registers. | |
| #define | VMIN 0x02 |
| #define | VMAJ 0x03 |
| #define | OUTPAY 0x04 |
| #define | INPAY 0x06 |
| #define | GCTL 0x08 |
| #define | WAKEEN 0x0C |
| #define | STATESTS 0x0E |
| #define | GSTS 0x10 |
| #define | OUTSTRMPAY 0x18 |
| #define | INSTRMPAY 0x1A |
| #define | INTCTL 0x20 |
| #define | INTSTS 0x24 |
| #define | WALCLK 0x30 |
| #define | SSYNC 0x38 |
| #define | CORBLBASE 0x40 |
| #define | CORBUBASE 0x44 |
| #define | CORBWP 0x48 |
| #define | CORBRP 0x4A |
| #define | CORBCTL 0x4C |
| #define | CORBSTS 0x4D |
| #define | CORBSIZE 0x4E |
| #define | RIRBLBASE 0x50 |
| #define | RIRBUBASE 0x54 |
| #define | RIRBWP 0x58 |
| #define | RINTCNT 0x5A |
| #define | RIRBCTL 0x5C |
| #define | RIRBSTS 0x5D |
| #define | RIRBSIZE 0x5E |
| #define | ICOI 0x60 |
| #define | ICII 0x64 |
| #define | ICIS 0x68 |
| #define | DPIBLBASE 0x70 |
| #define | DPIBUBASE 0x74 |
| #define | SD0CTL 0x80 |
| #define | SD0STS 0x83 |
| #define | SD0LPIB 0x84 |
| #define | SD0CBL 0x88 |
| #define | SD0LVI 0x8C |
| #define | SD0FIFOD 0x90 |
| #define | SD0FMT 0x92 |
| #define | SDBDPL 0x98 |
| #define | SDBDPU 0x9C |
| #define | REG_O0_CTLL 0x100 |
| Output 0 - Control Lower. | |
| #define | REG_O0_CTLU 0x102 |
| Output 0 - Control Upper. | |
| #define | REG_O0_STS 0x103 |
| Output 0 - Status. | |
| #define | REG_O0_CBL 0x108 |
| Output 0 - Cyclic Buffer Length. | |
| #define | REG_O0_STLVI 0x10c |
| Output 0 - Last Valid Index. | |
| #define | REG_O0_FIFOD 0x110 |
| Output 0 - FIFO Size. | |
| #define | REG_O0_FMT 0x112 |
| Output 0 - Format. | |
| #define | REG_O0_BDLPL 0x118 |
| Output 0 - BDL Pointer Lower. | |
| #define | REG_O0_BDLPU 0x11c |
| Output 0 - BDL Pointer Upper. | |
| #define | REG_I0_CTLL 0x80 |
| Input 0 - Control Lower. | |
| #define | REG_I0_STS 0x83 |
| Input 0 - Status. | |
| #define | REG_I0_LPIB 0x84 |
| Input 0 - Link position in current buffer. | |
| #define | REG_I0_CBL 0x88 |
| Input 0 - Cyclic Buffer Length. | |
| #define | REG_I0_LVI 0x8C |
| Input 0 - Last Valid Index. | |
| #define | REG_I0_FIFOD 0x90 |
| Input 0 - FIFO. | |
| #define | REG_I0_FMT 0x92 |
| Input 0 - Format. | |
| #define | REG_I0_BDPL 0x98 |
| Input 0 - BDL Pointer Lower. | |
| #define | REG_I0_BDPU 0x9C |
| Input 0 - BDL Pointer Upper. | |
| #define | BDL_SIZE 4 |
| #define | BUFFER_SIZE 1024 |
| #define | HDA_GCAP_OSS_MASK 0xf000 |
| #define | HDA_GCAP_OSS_SHIFT 12 |
| #define | HDA_GCAP_ISS_SHIFT 8 |
| #define | HDA_GCAP_ISS_MASK 0x0f00 |
| #define | HDA_GCAP_BSS_SHIFT 3 |
| #define | HDA_GCAP_BSS_MASK 0x00f8 |
| #define | HDA_GCAP_NSD0_SHIFT 1 |
| #define | HDA_GCAP_NSD0_MASK 0x0006 |
| #define | HDA_GCAP_BSS(gcap) (((gcap) & HDA_GCAP_BSS_MASK) >> HDA_GCAP_BSS_SHIFT) |
| #define | HDA_GCAP_ISS(gcap) (((gcap) & HDA_GCAP_ISS_MASK) >> HDA_GCAP_ISS_SHIFT) |
| #define | HDA_GCAP_OSS(gcap) (((gcap) & HDA_GCAP_OSS_MASK) >> HDA_GCAP_OSS_SHIFT) |
| #define | HDA_INTCTL_CIE 0x40000000 |
| #define | HDA_INTCTL_GIE 0x80000000 |
| #define | HDAC_SDCTL_RUN 0x000002 |
| #define | HDAC_SDCTL_IOCE 0x000004 |
| #define | HDAC_SDCTL_FEIE 0x000008 |
| #define | HDAC_SDCTL_DEIE 0x000010 |
| #define | HDAC_SDSTS_DESE (1<<4) |
| #define | HDAC_SDSTS_FIFOE (1<<3) |
| #define | HDAC_SDSTS_BCIS (1<<2) |
Typedefs | |
| typedef struct _bdl_ | HDABDLEntry |
| typedef struct _hd_audio_ | HDAudio |
Functions | |
| uint8_t | _aud_inb_ (int reg) |
| void | _aud_outb_ (int reg, uint8_t value) |
| uint16_t | _aud_inw_ (int reg) |
| void | _aud_outw_ (int reg, uint16_t value) |
| uint32_t | _aud_inl_ (int reg) |
| void | _aud_outl_ (int reg, uint32_t value) |
| void | HDAudioSetDMAPos (uint64_t dma_buff) |
| uint64_t | HDAudioGetDMAPos () |
| void | HDAudioSetSampleBuffer (uint64_t buffer) |
| void | CORBWrite (uint32_t verb) |
| void | RIRBRead (uint64_t *response) |
| void | HDAAddPath (HDAAudioPath *path) |
| void | HDASetVolumeFunc (void(*set_vol)(uint8_t volume, int codec)) |
| void | HDASetCodecInitFunc (void(*init_func)(int codec, int nid)) |
| void | HDASetVolume (uint8_t volume) |
| #define BDL_SIZE 4 |
| #define BUFFER_SIZE 1024 |
| #define CORBCTL 0x4C |
| #define CORBLBASE 0x40 |
| #define CORBRP 0x4A |
| #define CORBSIZE 0x4E |
| #define CORBSTS 0x4D |
| #define CORBUBASE 0x44 |
| #define CORBWP 0x48 |
| #define DPIBLBASE 0x70 |
| #define DPIBUBASE 0x74 |
| #define GCAP 0x00 |
Device Registers.
BSD 2-Clause License
Copyright (c) 2022-2023, Manas Kamal Choudhury All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
| #define GCTL 0x08 |
| #define GSTS 0x10 |
| #define HDA_GCAP_BSS | ( | gcap | ) | (((gcap) & HDA_GCAP_BSS_MASK) >> HDA_GCAP_BSS_SHIFT) |
| #define HDA_GCAP_BSS_MASK 0x00f8 |
| #define HDA_GCAP_BSS_SHIFT 3 |
| #define HDA_GCAP_ISS | ( | gcap | ) | (((gcap) & HDA_GCAP_ISS_MASK) >> HDA_GCAP_ISS_SHIFT) |
| #define HDA_GCAP_ISS_MASK 0x0f00 |
| #define HDA_GCAP_ISS_SHIFT 8 |
| #define HDA_GCAP_NSD0_MASK 0x0006 |
| #define HDA_GCAP_NSD0_SHIFT 1 |
| #define HDA_GCAP_OSS | ( | gcap | ) | (((gcap) & HDA_GCAP_OSS_MASK) >> HDA_GCAP_OSS_SHIFT) |
| #define HDA_GCAP_OSS_MASK 0xf000 |
| #define HDA_GCAP_OSS_SHIFT 12 |
| #define HDA_INTCTL_CIE 0x40000000 |
| #define HDA_INTCTL_GIE 0x80000000 |
| #define HDAC_SDCTL_DEIE 0x000010 |
| #define HDAC_SDCTL_FEIE 0x000008 |
| #define HDAC_SDCTL_IOCE 0x000004 |
| #define HDAC_SDCTL_RUN 0x000002 |
| #define HDAC_SDSTS_BCIS (1<<2) |
| #define HDAC_SDSTS_DESE (1<<4) |
| #define HDAC_SDSTS_FIFOE (1<<3) |
| #define ICII 0x64 |
| #define ICIS 0x68 |
| #define ICOI 0x60 |
| #define INPAY 0x06 |
| #define INSTRMPAY 0x1A |
| #define INTCTL 0x20 |
| #define INTSTS 0x24 |
| #define OUTPAY 0x04 |
| #define OUTSTRMPAY 0x18 |
| #define REG_I0_BDPL 0x98 |
Input 0 - BDL Pointer Lower.
| #define REG_I0_BDPU 0x9C |
Input 0 - BDL Pointer Upper.
| #define REG_I0_CBL 0x88 |
Input 0 - Cyclic Buffer Length.
| #define REG_I0_CTLL 0x80 |
Input 0 - Control Lower.
| #define REG_I0_FIFOD 0x90 |
Input 0 - FIFO.
| #define REG_I0_FMT 0x92 |
Input 0 - Format.
| #define REG_I0_LPIB 0x84 |
Input 0 - Link position in current buffer.
| #define REG_I0_LVI 0x8C |
Input 0 - Last Valid Index.
| #define REG_I0_STS 0x83 |
Input 0 - Status.
| #define REG_O0_BDLPL 0x118 |
Output 0 - BDL Pointer Lower.
| #define REG_O0_BDLPU 0x11c |
Output 0 - BDL Pointer Upper.
| #define REG_O0_CBL 0x108 |
Output 0 - Cyclic Buffer Length.
| #define REG_O0_CTLL 0x100 |
Output 0 - Control Lower.
| #define REG_O0_CTLU 0x102 |
Output 0 - Control Upper.
| #define REG_O0_FIFOD 0x110 |
Output 0 - FIFO Size.
| #define REG_O0_FMT 0x112 |
Output 0 - Format.
| #define REG_O0_STLVI 0x10c |
Output 0 - Last Valid Index.
| #define REG_O0_STS 0x103 |
Output 0 - Status.
| #define RINTCNT 0x5A |
| #define RIRBCTL 0x5C |
| #define RIRBLBASE 0x50 |
| #define RIRBSIZE 0x5E |
| #define RIRBSTS 0x5D |
| #define RIRBUBASE 0x54 |
| #define RIRBWP 0x58 |
| #define SD0CBL 0x88 |
| #define SD0CTL 0x80 |
| #define SD0FIFOD 0x90 |
| #define SD0FMT 0x92 |
| #define SD0LPIB 0x84 |
| #define SD0LVI 0x8C |
| #define SD0STS 0x83 |
| #define SDBDPL 0x98 |
| #define SDBDPU 0x9C |
| #define SSYNC 0x38 |
| #define STATESTS 0x0E |
| #define VMAJ 0x03 |
| #define VMIN 0x02 |
| #define WAKEEN 0x0C |
| #define WALCLK 0x30 |
| typedef struct _bdl_ HDABDLEntry |
| typedef struct _hd_audio_ HDAudio |
| enum codec_parameters |
| enum codec_verbs |
| enum fn_group_type |
| enum pin_capabilities |
| enum pin_ctl_flags |
| enum reg_corbctl |
| enum reg_gctl |
| enum reg_rirbctl |
| enum sample_format |
| enum widget_capabilities |
| enum widget_type |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
Check for immediate use
else use standard command transmitting method
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
RIRBRead - read a response from RIRB
| response | - address to where the controller will write response |