FreeBSD kernel sound device code
hdaa.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  hdaa_widget
 
struct  hdaa_audio_ctl
 
struct  hdaa_audio_as
 
struct  hdaa_pcm_devinfo
 
struct  hdaa_devinfo
 
struct  hdaa_chan
 

Macros

#define HDAA_GPIO_SHIFT(n)   (n * 3)
 
#define HDAA_GPIO_MASK(n)   (0x7 << (n * 3))
 
#define HDAA_GPIO_KEEP(n)   (0x0 << (n * 3))
 
#define HDAA_GPIO_SET(n)   (0x1 << (n * 3))
 
#define HDAA_GPIO_CLEAR(n)   (0x2 << (n * 3))
 
#define HDAA_GPIO_DISABLE(n)   (0x3 << (n * 3))
 
#define HDAA_GPIO_INPUT(n)   (0x4 << (n * 3))
 
#define HDAA_QUIRK_SOFTPCMVOL   (1 << 9)
 
#define HDAA_QUIRK_FIXEDRATE   (1 << 10)
 
#define HDAA_QUIRK_FORCESTEREO   (1 << 11)
 
#define HDAA_QUIRK_EAPDINV   (1 << 12)
 
#define HDAA_QUIRK_SENSEINV   (1 << 14)
 
#define HDAA_QUIRK_IVREF50   (1 << 26)
 
#define HDAA_QUIRK_IVREF80   (1 << 27)
 
#define HDAA_QUIRK_IVREF100   (1 << 28)
 
#define HDAA_QUIRK_OVREF50   (1 << 29)
 
#define HDAA_QUIRK_OVREF80   (1 << 30)
 
#define HDAA_QUIRK_OVREF100   (1U << 31)
 
#define HDAA_QUIRK_IVREF
 
#define HDAA_QUIRK_OVREF
 
#define HDAA_QUIRK_VREF   (HDAA_QUIRK_IVREF | HDAA_QUIRK_OVREF)
 
#define HDAA_AMP_VOL_DEFAULT   (-1)
 
#define HDAA_AMP_MUTE_DEFAULT   (0xffffffff)
 
#define HDAA_AMP_MUTE_NONE   (0)
 
#define HDAA_AMP_MUTE_LEFT   (1 << 0)
 
#define HDAA_AMP_MUTE_RIGHT   (1 << 1)
 
#define HDAA_AMP_MUTE_ALL   (HDAA_AMP_MUTE_LEFT | HDAA_AMP_MUTE_RIGHT)
 
#define HDAA_AMP_LEFT_MUTED(v)   ((v) & (HDAA_AMP_MUTE_LEFT))
 
#define HDAA_AMP_RIGHT_MUTED(v)   (((v) & HDAA_AMP_MUTE_RIGHT) >> 1)
 
#define HDAA_ADC_MONITOR   (1 << 0)
 
#define HDAA_IMIX_AS_DST   (2 << 0)
 
#define HDAA_CTL_OUT   1
 
#define HDAA_CTL_IN   2
 
#define HDA_MAX_CONNS   32
 
#define HDA_MAX_NAMELEN   32
 
#define HDAA_CHN_RUNNING   0x00000001
 
#define HDAA_CHN_SUSPEND   0x00000002
 
#define MINQDB(ctl)    ((0 - (ctl)->offset) * ((ctl)->size + 1))
 
#define MAXQDB(ctl)    (((ctl)->step - (ctl)->offset) * ((ctl)->size + 1))
 
#define RANGEQDB(ctl)    ((ctl)->step * ((ctl)->size + 1))
 
#define VAL2QDB(ctl, val)    (((ctl)->size + 1) * ((int)(val) - (ctl)->offset))
 
#define QDB2VAL(ctl, qdb)
 
#define hdaa_codec_id(devinfo)
 
#define hdaa_card_id(devinfo)
 

Functions

struct hdaa_widgethdaa_widget_get (struct hdaa_devinfo *, nid_t)
 
uint32_t hdaa_widget_pin_patch (uint32_t config, const char *str)
 
uint32_t hdaa_gpio_patch (uint32_t gpio, const char *str)
 
void hdaa_patch (struct hdaa_devinfo *devinfo)
 
void hdaa_patch_direct (struct hdaa_devinfo *devinfo)
 

Macro Definition Documentation

◆ HDA_MAX_CONNS

#define HDA_MAX_CONNS   32

Definition at line 87 of file hdaa.h.

◆ HDA_MAX_NAMELEN

#define HDA_MAX_NAMELEN   32

Definition at line 88 of file hdaa.h.

◆ HDAA_ADC_MONITOR

#define HDAA_ADC_MONITOR   (1 << 0)

Definition at line 80 of file hdaa.h.

◆ HDAA_AMP_LEFT_MUTED

#define HDAA_AMP_LEFT_MUTED (   v)    ((v) & (HDAA_AMP_MUTE_LEFT))

Definition at line 76 of file hdaa.h.

◆ HDAA_AMP_MUTE_ALL

#define HDAA_AMP_MUTE_ALL   (HDAA_AMP_MUTE_LEFT | HDAA_AMP_MUTE_RIGHT)

Definition at line 74 of file hdaa.h.

◆ HDAA_AMP_MUTE_DEFAULT

#define HDAA_AMP_MUTE_DEFAULT   (0xffffffff)

Definition at line 70 of file hdaa.h.

◆ HDAA_AMP_MUTE_LEFT

#define HDAA_AMP_MUTE_LEFT   (1 << 0)

Definition at line 72 of file hdaa.h.

◆ HDAA_AMP_MUTE_NONE

#define HDAA_AMP_MUTE_NONE   (0)

Definition at line 71 of file hdaa.h.

◆ HDAA_AMP_MUTE_RIGHT

#define HDAA_AMP_MUTE_RIGHT   (1 << 1)

Definition at line 73 of file hdaa.h.

◆ HDAA_AMP_RIGHT_MUTED

#define HDAA_AMP_RIGHT_MUTED (   v)    (((v) & HDAA_AMP_MUTE_RIGHT) >> 1)

Definition at line 77 of file hdaa.h.

◆ HDAA_AMP_VOL_DEFAULT

#define HDAA_AMP_VOL_DEFAULT   (-1)

Definition at line 69 of file hdaa.h.

◆ hdaa_card_id

#define hdaa_card_id (   devinfo)
Value:
(((uint32_t)hda_get_subdevice_id(devinfo->dev) << 16) + \
hda_get_subvendor_id(devinfo->dev))
void * devinfo
Definition: ac97_if.m:47

Definition at line 266 of file hdaa.h.

◆ HDAA_CHN_RUNNING

#define HDAA_CHN_RUNNING   0x00000001

Definition at line 220 of file hdaa.h.

◆ HDAA_CHN_SUSPEND

#define HDAA_CHN_SUSPEND   0x00000002

Definition at line 221 of file hdaa.h.

◆ hdaa_codec_id

#define hdaa_codec_id (   devinfo)
Value:
(((uint32_t)hda_get_vendor_id(devinfo->dev) << 16) + \
hda_get_device_id(devinfo->dev))

Definition at line 262 of file hdaa.h.

◆ HDAA_CTL_IN

#define HDAA_CTL_IN   2

Definition at line 85 of file hdaa.h.

◆ HDAA_CTL_OUT

#define HDAA_CTL_OUT   1

Definition at line 84 of file hdaa.h.

◆ HDAA_GPIO_CLEAR

#define HDAA_GPIO_CLEAR (   n)    (0x2 << (n * 3))

Definition at line 44 of file hdaa.h.

◆ HDAA_GPIO_DISABLE

#define HDAA_GPIO_DISABLE (   n)    (0x3 << (n * 3))

Definition at line 45 of file hdaa.h.

◆ HDAA_GPIO_INPUT

#define HDAA_GPIO_INPUT (   n)    (0x4 << (n * 3))

Definition at line 46 of file hdaa.h.

◆ HDAA_GPIO_KEEP

#define HDAA_GPIO_KEEP (   n)    (0x0 << (n * 3))

Definition at line 42 of file hdaa.h.

◆ HDAA_GPIO_MASK

#define HDAA_GPIO_MASK (   n)    (0x7 << (n * 3))

Definition at line 41 of file hdaa.h.

◆ HDAA_GPIO_SET

#define HDAA_GPIO_SET (   n)    (0x1 << (n * 3))

Definition at line 43 of file hdaa.h.

◆ HDAA_GPIO_SHIFT

#define HDAA_GPIO_SHIFT (   n)    (n * 3)

Definition at line 40 of file hdaa.h.

◆ HDAA_IMIX_AS_DST

#define HDAA_IMIX_AS_DST   (2 << 0)

Definition at line 82 of file hdaa.h.

◆ HDAA_QUIRK_EAPDINV

#define HDAA_QUIRK_EAPDINV   (1 << 12)

Definition at line 52 of file hdaa.h.

◆ HDAA_QUIRK_FIXEDRATE

#define HDAA_QUIRK_FIXEDRATE   (1 << 10)

Definition at line 50 of file hdaa.h.

◆ HDAA_QUIRK_FORCESTEREO

#define HDAA_QUIRK_FORCESTEREO   (1 << 11)

Definition at line 51 of file hdaa.h.

◆ HDAA_QUIRK_IVREF

#define HDAA_QUIRK_IVREF
Value:
HDAA_QUIRK_IVREF100)
#define HDAA_QUIRK_IVREF80
Definition: hdaa.h:57
#define HDAA_QUIRK_IVREF50
Definition: hdaa.h:56

Definition at line 63 of file hdaa.h.

◆ HDAA_QUIRK_IVREF100

#define HDAA_QUIRK_IVREF100   (1 << 28)

Definition at line 58 of file hdaa.h.

◆ HDAA_QUIRK_IVREF50

#define HDAA_QUIRK_IVREF50   (1 << 26)

Definition at line 56 of file hdaa.h.

◆ HDAA_QUIRK_IVREF80

#define HDAA_QUIRK_IVREF80   (1 << 27)

Definition at line 57 of file hdaa.h.

◆ HDAA_QUIRK_OVREF

#define HDAA_QUIRK_OVREF
Value:
HDAA_QUIRK_OVREF100)
#define HDAA_QUIRK_OVREF50
Definition: hdaa.h:59
#define HDAA_QUIRK_OVREF80
Definition: hdaa.h:60

Definition at line 65 of file hdaa.h.

◆ HDAA_QUIRK_OVREF100

#define HDAA_QUIRK_OVREF100   (1U << 31)

Definition at line 61 of file hdaa.h.

◆ HDAA_QUIRK_OVREF50

#define HDAA_QUIRK_OVREF50   (1 << 29)

Definition at line 59 of file hdaa.h.

◆ HDAA_QUIRK_OVREF80

#define HDAA_QUIRK_OVREF80   (1 << 30)

Definition at line 60 of file hdaa.h.

◆ HDAA_QUIRK_SENSEINV

#define HDAA_QUIRK_SENSEINV   (1 << 14)

Definition at line 53 of file hdaa.h.

◆ HDAA_QUIRK_SOFTPCMVOL

#define HDAA_QUIRK_SOFTPCMVOL   (1 << 9)

Definition at line 49 of file hdaa.h.

◆ HDAA_QUIRK_VREF

#define HDAA_QUIRK_VREF   (HDAA_QUIRK_IVREF | HDAA_QUIRK_OVREF)

Definition at line 67 of file hdaa.h.

◆ MAXQDB

#define MAXQDB (   ctl)     (((ctl)->step - (ctl)->offset) * ((ctl)->size + 1))

Definition at line 249 of file hdaa.h.

◆ MINQDB

#define MINQDB (   ctl)     ((0 - (ctl)->offset) * ((ctl)->size + 1))

Definition at line 246 of file hdaa.h.

◆ QDB2VAL

#define QDB2VAL (   ctl,
  qdb 
)
Value:
imax(imin((((qdb) + (ctl)->size / 2 * ((qdb) > 0 ? 1 : -1)) / \
((ctl)->size + 1) + (ctl)->offset), (ctl)->step), 0)

Definition at line 258 of file hdaa.h.

◆ RANGEQDB

#define RANGEQDB (   ctl)     ((ctl)->step * ((ctl)->size + 1))

Definition at line 252 of file hdaa.h.

◆ VAL2QDB

#define VAL2QDB (   ctl,
  val 
)     (((ctl)->size + 1) * ((int)(val) - (ctl)->offset))

Definition at line 255 of file hdaa.h.

Function Documentation

◆ hdaa_gpio_patch()

uint32_t hdaa_gpio_patch ( uint32_t  gpio,
const char *  str 
)

Definition at line 915 of file hdaa.c.

References buf, gpio, HDA_GPIO_ACTIONS, HDAA_GPIO_SHIFT, key, and value.

Referenced by hdaa_local_patch(), hdaa_sysctl_gpio_config(), and hdaa_sysctl_gpo_config().

Here is the caller graph for this function:

◆ hdaa_patch()

◆ hdaa_patch_direct()

◆ hdaa_widget_get()

◆ hdaa_widget_pin_patch()