FreeBSD kernel sound device code
hdaa.c File Reference
#include <dev/sound/pcm/sound.h>
#include <sys/ctype.h>
#include <sys/taskqueue.h>
#include <dev/sound/pci/hda/hdac.h>
#include <dev/sound/pci/hda/hdaa.h>
#include <dev/sound/pci/hda/hda_reg.h>
#include "mixer_if.h"
Include dependency graph for hdaa.c:

Go to the source code of this file.

Data Structures

struct  matrix
 

Macros

#define hdaa_lock(devinfo)   snd_mtxlock((devinfo)->lock)
 
#define hdaa_unlock(devinfo)   snd_mtxunlock((devinfo)->lock)
 
#define hdaa_lockassert(devinfo)   snd_mtxassert((devinfo)->lock)
 
#define HDA_PARSE_MAXDEPTH   10
 
#define HDA_RATE_TAB_LEN   (sizeof(hda_rate_tab) / sizeof(hda_rate_tab[0]))
 
#define CONN_RMASK(e)   (1 << ((32 / (e)) - 1))
 
#define CONN_NMASK(e)   (CONN_RMASK(e) - 1)
 
#define CONN_RESVAL(r, e, n)   ((r) >> ((32 / (e)) * (n)))
 
#define CONN_RANGE(r, e, n)   (CONN_RESVAL(r, e, n) & CONN_RMASK(e))
 
#define CONN_CNID(r, e, n)   (CONN_RESVAL(r, e, n) & CONN_NMASK(e))
 

Functions

 SND_DECLARE_FILE ("$FreeBSD$")
 
 MALLOC_DEFINE (M_HDAA, "hdaa", "HDA Audio")
 
static int hdaa_pcmchannel_setup (struct hdaa_chan *)
 
static void hdaa_widget_connection_select (struct hdaa_widget *, uint8_t)
 
static void hdaa_audio_ctl_amp_set (struct hdaa_audio_ctl *, uint32_t, int, int)
 
static struct hdaa_audio_ctlhdaa_audio_ctl_amp_get (struct hdaa_devinfo *, nid_t, int, int, int)
 
static void hdaa_audio_ctl_amp_set_internal (struct hdaa_devinfo *, nid_t, int, int, int, int, int, int)
 
static void hdaa_dump_pin_config (struct hdaa_widget *w, uint32_t conf)
 
static char * hdaa_audio_ctl_ossmixer_mask2allname (uint32_t mask, char *buf, size_t len)
 
static struct hdaa_audio_ctlhdaa_audio_ctl_each (struct hdaa_devinfo *devinfo, int *index)
 
static void hdaa_channels_handler (struct hdaa_audio_as *as)
 
static void hdaa_hpredir_handler (struct hdaa_widget *w)
 
static void hdaa_autorecsrc_handler (struct hdaa_audio_as *as, struct hdaa_widget *w)
 
static void hdaa_presence_handler (struct hdaa_widget *w)
 
static void hdaa_jack_poll_callback (void *arg)
 
static void hdaa_eld_dump (struct hdaa_widget *w)
 
static void hdaa_eld_handler (struct hdaa_widget *w)
 
static void hdaa_sense_init (struct hdaa_devinfo *devinfo)
 
static void hdaa_sense_deinit (struct hdaa_devinfo *devinfo)
 
uint32_t hdaa_widget_pin_patch (uint32_t config, const char *str)
 
uint32_t hdaa_gpio_patch (uint32_t gpio, const char *str)
 
static void hdaa_local_patch_pin (struct hdaa_widget *w)
 
static void hdaa_dump_audio_formats_sb (struct sbuf *sb, uint32_t fcap, uint32_t pcmcap)
 
static void hdaa_dump_pin_sb (struct sbuf *sb, struct hdaa_widget *w)
 
static void hdaa_dump_amp_sb (struct sbuf *sb, uint32_t cap, const char *banner)
 
static int hdaa_sysctl_caps (SYSCTL_HANDLER_ARGS)
 
static int hdaa_sysctl_config (SYSCTL_HANDLER_ARGS)
 
static void hdaa_config_fetch (const char *str, uint32_t *on, uint32_t *off)
 
static int hdaa_sysctl_quirks (SYSCTL_HANDLER_ARGS)
 
static void hdaa_local_patch (struct hdaa_devinfo *devinfo)
 
static void hdaa_widget_connection_parse (struct hdaa_widget *w)
 
static void hdaa_widget_parse (struct hdaa_widget *w)
 
static void hdaa_widget_postprocess (struct hdaa_widget *w)
 
struct hdaa_widgethdaa_widget_get (struct hdaa_devinfo *devinfo, nid_t nid)
 
static void * hdaa_channel_init (kobj_t obj, void *data, struct snd_dbuf *b, struct pcm_channel *c, int dir)
 
static int hdaa_channel_setformat (kobj_t obj, void *data, uint32_t format)
 
static uint32_t hdaa_channel_setspeed (kobj_t obj, void *data, uint32_t speed)
 
static uint16_t hdaa_stream_format (struct hdaa_chan *ch)
 
static int hdaa_allowed_stripes (uint16_t fmt)
 
static void hdaa_audio_setup (struct hdaa_chan *ch)
 
static unsigned gcd (unsigned a, unsigned b)
 
static unsigned lcm (unsigned a, unsigned b)
 
static int hdaa_channel_setfragments (kobj_t obj, void *data, uint32_t blksz, uint32_t blkcnt)
 
static uint32_t hdaa_channel_setblocksize (kobj_t obj, void *data, uint32_t blksz)
 
static void hdaa_channel_stop (struct hdaa_chan *ch)
 
static int hdaa_channel_start (struct hdaa_chan *ch)
 
static int hdaa_channel_trigger (kobj_t obj, void *data, int go)
 
static uint32_t hdaa_channel_getptr (kobj_t obj, void *data)
 
static struct pcmchan_capshdaa_channel_getcaps (kobj_t obj, void *data)
 
 CHANNEL_DECLARE (hdaa_channel)
 
static int hdaa_audio_ctl_ossmixer_init (struct snd_mixer *m)
 
static void hdaa_audio_ctl_dev_set (struct hdaa_audio_ctl *ctl, int ossdev, int mute, int *left, int *right)
 
static void hdaa_audio_ctl_source_volume (struct hdaa_pcm_devinfo *pdevinfo, int ossdev, nid_t nid, int index, int mute, int left, int right, int depth)
 
static void hdaa_audio_ctl_dest_volume (struct hdaa_pcm_devinfo *pdevinfo, int ossdev, nid_t nid, int index, int mute, int left, int right, int depth)
 
static void hdaa_audio_ctl_dev_volume (struct hdaa_pcm_devinfo *pdevinfo, unsigned dev)
 
static int hdaa_audio_ctl_ossmixer_set (struct snd_mixer *m, unsigned dev, unsigned left, unsigned right)
 
static void hdaa_audio_ctl_set_defaults (struct hdaa_pcm_devinfo *pdevinfo)
 
static uint32_t hdaa_audio_ctl_recsel_comm (struct hdaa_pcm_devinfo *pdevinfo, uint32_t src, nid_t nid, int depth)
 
static uint32_t hdaa_audio_ctl_ossmixer_setrecsrc (struct snd_mixer *m, uint32_t src)
 
 MIXER_DECLARE (hdaa_audio_ctl_ossmixer)
 
static void hdaa_dump_gpi (struct hdaa_devinfo *devinfo)
 
static void hdaa_dump_gpio (struct hdaa_devinfo *devinfo)
 
static void hdaa_dump_gpo (struct hdaa_devinfo *devinfo)
 
static void hdaa_audio_parse (struct hdaa_devinfo *devinfo)
 
static void hdaa_audio_postprocess (struct hdaa_devinfo *devinfo)
 
static void hdaa_audio_ctl_parse (struct hdaa_devinfo *devinfo)
 
static void hdaa_audio_as_parse (struct hdaa_devinfo *devinfo)
 
static nid_t hdaa_audio_trace_dac (struct hdaa_devinfo *devinfo, int as, int seq, nid_t nid, int dupseq, int min, int only, int depth)
 
static nid_t hdaa_audio_trace_adc (struct hdaa_devinfo *devinfo, int as, int seq, nid_t nid, int mixed, int min, int only, int depth, int *length, int onlylength)
 
static void hdaa_audio_undo_trace (struct hdaa_devinfo *devinfo, int as, int seq)
 
static int hdaa_audio_trace_as_out (struct hdaa_devinfo *devinfo, int as, int seq)
 
static int hdaa_audio_dacs_equal (struct hdaa_widget *w1, struct hdaa_widget *w2)
 
static int hdaa_audio_adcs_equal (struct hdaa_widget *w1, struct hdaa_widget *w2)
 
static void hdaa_audio_adddac (struct hdaa_devinfo *devinfo, int asid)
 
static int hdaa_audio_trace_as_in (struct hdaa_devinfo *devinfo, int as)
 
static int hdaa_audio_trace_as_in_mch (struct hdaa_devinfo *devinfo, int as, int seq)
 
static int hdaa_audio_trace_to_out (struct hdaa_devinfo *devinfo, nid_t nid, int depth)
 
static void hdaa_audio_trace_as_extra (struct hdaa_devinfo *devinfo)
 
static void hdaa_audio_bind_as (struct hdaa_devinfo *devinfo)
 
static void hdaa_audio_disable_nonaudio (struct hdaa_devinfo *devinfo)
 
static void hdaa_audio_disable_useless (struct hdaa_devinfo *devinfo)
 
static void hdaa_audio_disable_unas (struct hdaa_devinfo *devinfo)
 
static void hdaa_audio_disable_notselected (struct hdaa_devinfo *devinfo)
 
static void hdaa_audio_disable_crossas (struct hdaa_devinfo *devinfo)
 
static int hdaa_audio_ctl_source_amp (struct hdaa_devinfo *devinfo, nid_t nid, int index, int ossdev, int ctlable, int depth, int *minamp, int *maxamp)
 
static int hdaa_audio_ctl_dest_amp (struct hdaa_devinfo *devinfo, nid_t nid, int index, int ossdev, int depth, int *minamp, int *maxamp)
 
static void hdaa_audio_assign_names (struct hdaa_devinfo *devinfo)
 
static void hdaa_audio_build_tree (struct hdaa_devinfo *devinfo)
 
static void hdaa_adjust_amp (struct hdaa_widget *w, int ossdev, int found, int minamp, int maxamp)
 
static void hdaa_audio_assign_mixers (struct hdaa_devinfo *devinfo)
 
static void hdaa_audio_prepare_pin_ctrl (struct hdaa_devinfo *devinfo)
 
static void hdaa_audio_ctl_commit (struct hdaa_devinfo *devinfo)
 
static void hdaa_gpio_commit (struct hdaa_devinfo *devinfo)
 
static void hdaa_gpo_commit (struct hdaa_devinfo *devinfo)
 
static void hdaa_audio_commit (struct hdaa_devinfo *devinfo)
 
static void hdaa_powerup (struct hdaa_devinfo *devinfo)
 
static void hdaa_prepare_pcms (struct hdaa_devinfo *devinfo)
 
static void hdaa_create_pcms (struct hdaa_devinfo *devinfo)
 
static void hdaa_dump_ctls (struct hdaa_pcm_devinfo *pdevinfo, const char *banner, uint32_t flag)
 
static void hdaa_dump_audio_formats (device_t dev, uint32_t fcap, uint32_t pcmcap)
 
static void hdaa_dump_pin (struct hdaa_widget *w)
 
static void hdaa_dump_pin_configs (struct hdaa_devinfo *devinfo)
 
static void hdaa_dump_amp (device_t dev, uint32_t cap, const char *banner)
 
static void hdaa_dump_nodes (struct hdaa_devinfo *devinfo)
 
static void hdaa_dump_dst_nid (struct hdaa_pcm_devinfo *pdevinfo, nid_t nid, int depth)
 
static void hdaa_dump_dac (struct hdaa_pcm_devinfo *pdevinfo)
 
static void hdaa_dump_adc (struct hdaa_pcm_devinfo *pdevinfo)
 
static void hdaa_dump_mix (struct hdaa_pcm_devinfo *pdevinfo)
 
static void hdaa_pindump (device_t dev)
 
static void hdaa_configure (device_t dev)
 
static void hdaa_unconfigure (device_t dev)
 
static int hdaa_sysctl_gpi_state (SYSCTL_HANDLER_ARGS)
 
static int hdaa_sysctl_gpio_state (SYSCTL_HANDLER_ARGS)
 
static int hdaa_sysctl_gpio_config (SYSCTL_HANDLER_ARGS)
 
static int hdaa_sysctl_gpo_state (SYSCTL_HANDLER_ARGS)
 
static int hdaa_sysctl_gpo_config (SYSCTL_HANDLER_ARGS)
 
static int hdaa_sysctl_reconfig (SYSCTL_HANDLER_ARGS)
 
static int hdaa_suspend (device_t dev)
 
static int hdaa_resume (device_t dev)
 
static int hdaa_probe (device_t dev)
 
static int hdaa_attach (device_t dev)
 
static int hdaa_detach (device_t dev)
 
static int hdaa_print_child (device_t dev, device_t child)
 
static int hdaa_child_location (device_t dev, device_t child, struct sbuf *sb)
 
static void hdaa_stream_intr (device_t dev, int dir, int stream)
 
static void hdaa_unsol_intr (device_t dev, uint32_t resp)
 
 DRIVER_MODULE (snd_hda, hdacc, hdaa_driver, hdaa_devclass, NULL, NULL)
 
static void hdaa_chan_formula (struct hdaa_devinfo *devinfo, int asid, char *buf, int buflen)
 
static int hdaa_chan_type (struct hdaa_devinfo *devinfo, int asid)
 
static int hdaa_sysctl_32bit (SYSCTL_HANDLER_ARGS)
 
static int hdaa_pcm_probe (device_t dev)
 
static int hdaa_pcm_attach (device_t dev)
 
static int hdaa_pcm_detach (device_t dev)
 
 DRIVER_MODULE (snd_hda_pcm, hdaa, hdaa_pcm_driver, pcm_devclass, NULL, NULL)
 
 MODULE_DEPEND (snd_hda, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER)
 
 MODULE_VERSION (snd_hda, 1)
 

Variables

struct {
   const char *   key
 
   uint32_t   value
 
hdaa_quirks_tab []
 
static const char * HDA_COLORS [16]
 
static const char * HDA_DEVS [16]
 
static const char * HDA_CONNS [4] = {"Jack", "None", "Fixed", "Both"}
 
static const char * HDA_CONNECTORS [16]
 
static const char * HDA_LOCS [64]
 
static const char * HDA_GPIO_ACTIONS [8]
 
static const char * HDA_HDMI_CODING_TYPES [18]
 
static uint32_t hdaa_fmt []
 
static struct pcmchan_caps hdaa_caps = {48000, 48000, hdaa_fmt, 0}
 
struct {
   uint32_t   rate
 
   int   valid
 
   uint16_t   base
 
   uint16_t   mul
 
   uint16_t   div
 
hda_rate_tab []
 
static const char * ossnames [] = SOUND_DEVICE_NAMES
 
static const struct matrix matrixes []
 
static const char * channel_names [] = SND_CHN_T_NAMES
 
static kobj_method_t hdaa_channel_methods []
 
static kobj_method_t hdaa_audio_ctl_ossmixer_methods []
 
static device_method_t hdaa_methods []
 
static driver_t hdaa_driver
 
static devclass_t hdaa_devclass
 
static device_method_t hdaa_pcm_methods []
 
static driver_t hdaa_pcm_driver
 

Macro Definition Documentation

◆ CONN_CNID

#define CONN_CNID (   r,
  e,
  n 
)    (CONN_RESVAL(r, e, n) & CONN_NMASK(e))

◆ CONN_NMASK

#define CONN_NMASK (   e)    (CONN_RMASK(e) - 1)

◆ CONN_RANGE

#define CONN_RANGE (   r,
  e,
  n 
)    (CONN_RESVAL(r, e, n) & CONN_RMASK(e))

◆ CONN_RESVAL

#define CONN_RESVAL (   r,
  e,
  n 
)    ((r) >> ((32 / (e)) * (n)))

◆ CONN_RMASK

#define CONN_RMASK (   e)    (1 << ((32 / (e)) - 1))

◆ HDA_PARSE_MAXDEPTH

#define HDA_PARSE_MAXDEPTH   10

Definition at line 76 of file hdaa.c.

◆ HDA_RATE_TAB_LEN

#define HDA_RATE_TAB_LEN   (sizeof(hda_rate_tab) / sizeof(hda_rate_tab[0]))

Definition at line 164 of file hdaa.c.

◆ hdaa_lock

#define hdaa_lock (   devinfo)    snd_mtxlock((devinfo)->lock)

Definition at line 52 of file hdaa.c.

◆ hdaa_lockassert

#define hdaa_lockassert (   devinfo)    snd_mtxassert((devinfo)->lock)

Definition at line 54 of file hdaa.c.

◆ hdaa_unlock

#define hdaa_unlock (   devinfo)    snd_mtxunlock((devinfo)->lock)

Definition at line 53 of file hdaa.c.

Function Documentation

◆ CHANNEL_DECLARE()

CHANNEL_DECLARE ( hdaa_channel  )

◆ DRIVER_MODULE() [1/2]

DRIVER_MODULE ( snd_hda  ,
hdacc  ,
hdaa_driver  ,
hdaa_devclass  ,
NULL  ,
NULL   
)

◆ DRIVER_MODULE() [2/2]

DRIVER_MODULE ( snd_hda_pcm  ,
hdaa  ,
hdaa_pcm_driver  ,
pcm_devclass  ,
NULL  ,
NULL   
)

◆ gcd()

static unsigned gcd ( unsigned  a,
unsigned  b 
)
static

Definition at line 2029 of file hdaa.c.

References b, and c.

Referenced by lcm().

Here is the caller graph for this function:

◆ hdaa_adjust_amp()

static void hdaa_adjust_amp ( struct hdaa_widget w,
int  ossdev,
int  found,
int  minamp,
int  maxamp 
)
static

Definition at line 4921 of file hdaa.c.

References hdaa_widget::bindas, hdaa_widget::devinfo, devinfo, hdaa_pcm_devinfo::maxamp, hdaa_pcm_devinfo::minamp, and hdaa_pcm_devinfo::ossmask.

Referenced by hdaa_audio_assign_mixers().

Here is the caller graph for this function:

◆ hdaa_allowed_stripes()

static int hdaa_allowed_stripes ( uint16_t  fmt)
static

Definition at line 1829 of file hdaa.c.

References fmt, and size.

Referenced by hdaa_channel_start().

Here is the caller graph for this function:

◆ hdaa_attach()

◆ hdaa_audio_adcs_equal()

static int hdaa_audio_adcs_equal ( struct hdaa_widget w1,
struct hdaa_widget w2 
)
static

Definition at line 3660 of file hdaa.c.

References hdaa_widget::bindas, hdaa_widget::bindseqmask, hdaa_widget::conns, hdaa_widget::devinfo, devinfo, hdaa_widget::enable, hdaa_widget_get(), hdaa_widget::nconns, hdaa_widget::param, and hdaa_widget::type.

Referenced by hdaa_audio_adddac().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hdaa_audio_adddac()

◆ hdaa_audio_as_parse()

◆ hdaa_audio_assign_mixers()

◆ hdaa_audio_assign_names()

◆ hdaa_audio_bind_as()

static void hdaa_audio_bind_as ( struct hdaa_devinfo devinfo)
static

Definition at line 4070 of file hdaa.c.

References hdaa_chan::as, devinfo, enable, free, HDAA_CTL_IN, hdaa_pcmchannel_setup(), hdaa_audio_as::num_chans, PCMDIR_PLAY, and PCMDIR_REC.

Referenced by hdaa_configure().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hdaa_audio_build_tree()

static void hdaa_audio_build_tree ( struct hdaa_devinfo devinfo)
static

◆ hdaa_audio_commit()

◆ hdaa_audio_ctl_amp_get()

static struct hdaa_audio_ctl * hdaa_audio_ctl_amp_get ( struct hdaa_devinfo devinfo,
nid_t  nid,
int  dir,
int  index,
int  cnt 
)
static

◆ hdaa_audio_ctl_amp_set()

◆ hdaa_audio_ctl_amp_set_internal()

static void hdaa_audio_ctl_amp_set_internal ( struct hdaa_devinfo devinfo,
nid_t  nid,
int  index,
int  lmute,
int  rmute,
int  left,
int  right,
int  dir 
)
static

Definition at line 1648 of file hdaa.c.

References devinfo, dir, HDA_BOOTHVERBOSE, HDA_CMD_SET_AMP_GAIN_MUTE, hda_command, index, left, hdaa_widget::nid, and right.

Referenced by hdaa_audio_ctl_amp_set().

Here is the caller graph for this function:

◆ hdaa_audio_ctl_commit()

static void hdaa_audio_ctl_commit ( struct hdaa_devinfo devinfo)
static

Definition at line 5107 of file hdaa.c.

References devinfo, hdaa_audio_ctl::enable, HDAA_AMP_MUTE_ALL, HDAA_AMP_MUTE_NONE, hdaa_audio_ctl_amp_set(), hdaa_audio_ctl_each(), hdaa_audio_ctl::offset, hdaa_audio_ctl::ossmask, and hdaa_audio_ctl::step.

Referenced by hdaa_audio_commit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hdaa_audio_ctl_dest_amp()

static int hdaa_audio_ctl_dest_amp ( struct hdaa_devinfo devinfo,
nid_t  nid,
int  index,
int  ossdev,
int  depth,
int *  minamp,
int *  maxamp 
)
static

◆ hdaa_audio_ctl_dest_volume()

◆ hdaa_audio_ctl_dev_set()

static void hdaa_audio_ctl_dev_set ( struct hdaa_audio_ctl ctl,
int  ossdev,
int  mute,
int *  left,
int *  right 
)
static

Definition at line 2323 of file hdaa.c.

References hdaa_audio_ctl::devleft, hdaa_audio_ctl::devmute, hdaa_audio_ctl::devright, hdaa_audio_ctl_amp_set(), left, hdaa_widget::ossdev, QDB2VAL, right, and VAL2QDB.

Referenced by hdaa_audio_ctl_dest_volume(), and hdaa_audio_ctl_source_volume().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hdaa_audio_ctl_dev_volume()

◆ hdaa_audio_ctl_each()

static struct hdaa_audio_ctl * hdaa_audio_ctl_each ( struct hdaa_devinfo devinfo,
int *  index 
)
static

◆ hdaa_audio_ctl_ossmixer_init()

◆ hdaa_audio_ctl_ossmixer_mask2allname()

static char * hdaa_audio_ctl_ossmixer_mask2allname ( uint32_t  mask,
char *  buf,
size_t  len 
)
static

Definition at line 184 of file hdaa.c.

References buf, len, mask, and ossnames.

Referenced by hdaa_audio_ctl_recsel_comm(), hdaa_autorecsrc_handler(), hdaa_dump_ctls(), hdaa_dump_dst_nid(), hdaa_dump_nodes(), and hdaa_sysctl_caps().

Here is the caller graph for this function:

◆ hdaa_audio_ctl_ossmixer_set()

◆ hdaa_audio_ctl_ossmixer_setrecsrc()

◆ hdaa_audio_ctl_parse()

◆ hdaa_audio_ctl_recsel_comm()

◆ hdaa_audio_ctl_set_defaults()

static void hdaa_audio_ctl_set_defaults ( struct hdaa_pcm_devinfo pdevinfo)
static

Definition at line 2638 of file hdaa.c.

References hdaa_pcm_devinfo::dev, dev, hdaa_pcm_devinfo::digital, hdaa_pcm_devinfo::maxamp, hdaa_pcm_devinfo::minamp, mix_set(), hdaa_pcm_devinfo::mixer, hdaa_pcm_devinfo::ossmask, and ossnames.

Referenced by hdaa_pcm_attach().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hdaa_audio_ctl_source_amp()

static int hdaa_audio_ctl_source_amp ( struct hdaa_devinfo devinfo,
nid_t  nid,
int  index,
int  ossdev,
int  ctlable,
int  depth,
int *  minamp,
int *  maxamp 
)
static

◆ hdaa_audio_ctl_source_volume()

◆ hdaa_audio_dacs_equal()

static int hdaa_audio_dacs_equal ( struct hdaa_widget w1,
struct hdaa_widget w2 
)
static

◆ hdaa_audio_disable_crossas()

◆ hdaa_audio_disable_nonaudio()

static void hdaa_audio_disable_nonaudio ( struct hdaa_devinfo devinfo)
static

Definition at line 4127 of file hdaa.c.

References devinfo, hdaa_widget::enable, HDA_BOOTHVERBOSE, HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_POWER_WIDGET, HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_VOLUME_WIDGET, hdaa_widget_get(), hdaa_widget::nid, and hdaa_widget::type.

Referenced by hdaa_configure().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hdaa_audio_disable_notselected()

static void hdaa_audio_disable_notselected ( struct hdaa_devinfo devinfo)
static

Definition at line 4379 of file hdaa.c.

References hdaa_widget::bindas, hdaa_widget::connsenable, devinfo, hdaa_audio_as::dir, hdaa_widget::enable, HDA_BOOTHVERBOSE, HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_AUDIO_MIXER, HDAA_CTL_IN, hdaa_widget_get(), hdaa_widget::nconns, hdaa_widget::selconn, and hdaa_widget::type.

Referenced by hdaa_configure().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hdaa_audio_disable_unas()

◆ hdaa_audio_disable_useless()

◆ hdaa_audio_parse()

◆ hdaa_audio_postprocess()

static void hdaa_audio_postprocess ( struct hdaa_devinfo devinfo)
static

Definition at line 2984 of file hdaa.c.

References devinfo, hdaa_widget_get(), and hdaa_widget_postprocess().

Referenced by hdaa_configure().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hdaa_audio_prepare_pin_ctrl()

◆ hdaa_audio_setup()

◆ hdaa_audio_trace_adc()

static nid_t hdaa_audio_trace_adc ( struct hdaa_devinfo devinfo,
int  as,
int  seq,
nid_t  nid,
int  mixed,
int  min,
int  only,
int  depth,
int *  length,
int  onlylength 
)
static

◆ hdaa_audio_trace_as_extra()

◆ hdaa_audio_trace_as_in()

static int hdaa_audio_trace_as_in ( struct hdaa_devinfo devinfo,
int  as 
)
static

◆ hdaa_audio_trace_as_in_mch()

static int hdaa_audio_trace_as_in_mch ( struct hdaa_devinfo devinfo,
int  as,
int  seq 
)
static

Definition at line 3832 of file hdaa.c.

References hdaa_audio_as::dacs, devinfo, HDA_BOOTHVERBOSE, HDA_BOOTVERBOSE, hdaa_audio_trace_adc(), hdaa_audio_trace_as_in_mch(), hdaa_audio_undo_trace(), and hdaa_audio_as::pins.

Referenced by hdaa_audio_build_tree(), and hdaa_audio_trace_as_in_mch().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hdaa_audio_trace_as_out()

static int hdaa_audio_trace_as_out ( struct hdaa_devinfo devinfo,
int  as,
int  seq 
)
static

Definition at line 3553 of file hdaa.c.

References hdaa_audio_as::dacs, devinfo, hdaa_audio_as::fakeredir, HDA_BOOTHVERBOSE, HDA_BOOTVERBOSE, hdaa_audio_trace_as_out(), hdaa_audio_trace_dac(), hdaa_audio_undo_trace(), hdaa_audio_as::hpredir, and hdaa_audio_as::pins.

Referenced by hdaa_audio_build_tree(), and hdaa_audio_trace_as_out().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hdaa_audio_trace_dac()

◆ hdaa_audio_trace_to_out()

◆ hdaa_audio_undo_trace()

static void hdaa_audio_undo_trace ( struct hdaa_devinfo devinfo,
int  as,
int  seq 
)
static

Definition at line 3524 of file hdaa.c.

References hdaa_widget::bindas, hdaa_widget::bindseqmask, devinfo, hdaa_widget::enable, hdaa_widget_get(), and hdaa_widget::selconn.

Referenced by hdaa_audio_trace_as_in(), hdaa_audio_trace_as_in_mch(), and hdaa_audio_trace_as_out().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hdaa_autorecsrc_handler()

◆ hdaa_chan_formula()

static void hdaa_chan_formula ( struct hdaa_devinfo devinfo,
int  asid,
char *  buf,
int  buflen 
)
static

Definition at line 6856 of file hdaa.c.

References buf, c, hdaa_audio_as::chans, devinfo, hdaa_audio_as::hpredir, and hdaa_audio_as::pinset.

Referenced by hdaa_pcm_probe().

Here is the caller graph for this function:

◆ hdaa_chan_type()

static int hdaa_chan_type ( struct hdaa_devinfo devinfo,
int  asid 
)
static

Definition at line 6886 of file hdaa.c.

References hdaa_widget::config, devinfo, hdaa_widget::enable, HDA_CONFIG_DEFAULTCONF_DEVICE, HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX, hdaa_widget_get(), hdaa_widget::pin, hdaa_audio_as::pins, hdaa_widget::type, and hdaa_widget::wclass.

Referenced by hdaa_pcm_probe().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hdaa_channel_getcaps()

static struct pcmchan_caps * hdaa_channel_getcaps ( kobj_t  obj,
void *  data 
)
static

Definition at line 2203 of file hdaa.c.

References pcmchan_caps::caps, and data.

◆ hdaa_channel_getptr()

static uint32_t hdaa_channel_getptr ( kobj_t  obj,
void *  data 
)
static

◆ hdaa_channel_init()

static void * hdaa_channel_init ( kobj_t  obj,
void *  data,
struct snd_dbuf b,
struct pcm_channel c,
int  dir 
)
static

◆ hdaa_channel_setblocksize()

static uint32_t hdaa_channel_setblocksize ( kobj_t  obj,
void *  data,
uint32_t  blksz 
)
static

Definition at line 2090 of file hdaa.c.

References hdaa_chan::blksz, blksz, hdaa_pcm_devinfo::chan_blkcnt, data, hdaa_channel_setfragments(), and hdaa_chan::pdevinfo.

Here is the call graph for this function:

◆ hdaa_channel_setformat()

static int hdaa_channel_setformat ( kobj_t  obj,
void *  data,
uint32_t  format 
)
static

Definition at line 1760 of file hdaa.c.

References hdaa_chan::caps, data, hdaa_chan::fmt, pcmchan_caps::fmtlist, and format.

◆ hdaa_channel_setfragments()

static int hdaa_channel_setfragments ( kobj_t  obj,
void *  data,
uint32_t  blksz,
uint32_t  blkcnt 
)
static

Definition at line 2052 of file hdaa.c.

References hdaa_chan::b, hdaa_chan::blkcnt, blkcnt, hdaa_chan::blksz, blksz, data, hdaa_devinfo::dev, hdaa_chan::devinfo, HDA_BDL_MAX, HDA_BDL_MIN, HDA_BLK_MIN, HDA_DMA_ALIGNMENT, lcm(), sndbuf_getalign(), sndbuf_getblkcnt(), sndbuf_getblksz(), sndbuf_getmaxsize(), and sndbuf_resize().

Referenced by hdaa_channel_setblocksize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hdaa_channel_setspeed()

static uint32_t hdaa_channel_setspeed ( kobj_t  obj,
void *  data,
uint32_t  speed 
)
static

Definition at line 1776 of file hdaa.c.

References data, hdaa_chan::pcmrates, hdaa_chan::spd, spd, and speed.

◆ hdaa_channel_start()

static int hdaa_channel_start ( struct hdaa_chan ch)
static

◆ hdaa_channel_stop()

static void hdaa_channel_stop ( struct hdaa_chan ch)
static

◆ hdaa_channel_trigger()

static int hdaa_channel_trigger ( kobj_t  obj,
void *  data,
int  go 
)
static

Definition at line 2151 of file hdaa.c.

References data, hdaa_chan::devinfo, error, go, hdaa_channel_start(), hdaa_channel_stop(), hdaa_lock, hdaa_unlock, PCMTRIG_ABORT, PCMTRIG_COMMON, PCMTRIG_START, and PCMTRIG_STOP.

Here is the call graph for this function:

◆ hdaa_channels_handler()

◆ hdaa_child_location()

static int hdaa_child_location ( device_t  dev,
device_t  child,
struct sbuf *  sb 
)
static

◆ hdaa_config_fetch()

static void hdaa_config_fetch ( const char *  str,
uint32_t *  on,
uint32_t *  off 
)
static

Definition at line 1256 of file hdaa.c.

References hdaa_quirks_tab, k, key, and len.

Referenced by hdaa_local_patch(), and hdaa_sysctl_quirks().

Here is the caller graph for this function:

◆ hdaa_configure()

◆ hdaa_create_pcms()

static void hdaa_create_pcms ( struct hdaa_devinfo devinfo)
static

Definition at line 5539 of file hdaa.c.

References hdaa_pcm_devinfo::dev, and devinfo.

Referenced by hdaa_configure().

Here is the caller graph for this function:

◆ hdaa_detach()

static int hdaa_detach ( device_t  dev)
static

Definition at line 6691 of file hdaa.c.

References dev, devinfo, error, free, hdaa_lock, hdaa_unconfigure(), and hdaa_unlock.

Here is the call graph for this function:

◆ hdaa_dump_adc()

static void hdaa_dump_adc ( struct hdaa_pcm_devinfo pdevinfo)
static

◆ hdaa_dump_amp()

static void hdaa_dump_amp ( device_t  dev,
uint32_t  cap,
const char *  banner 
)
static

◆ hdaa_dump_amp_sb()

static void hdaa_dump_amp_sb ( struct sbuf *  sb,
uint32_t  cap,
const char *  banner 
)
static

◆ hdaa_dump_audio_formats()

◆ hdaa_dump_audio_formats_sb()

◆ hdaa_dump_ctls()

◆ hdaa_dump_dac()

static void hdaa_dump_dac ( struct hdaa_pcm_devinfo pdevinfo)
static

Definition at line 5942 of file hdaa.c.

References hdaa_pcm_devinfo::dev, hdaa_pcm_devinfo::devinfo, devinfo, hdaa_widget::enable, hdaa_dump_audio_formats(), hdaa_dump_dst_nid(), hdaa_widget_get(), hdaa_audio_as::pins, and hdaa_pcm_devinfo::playas.

Referenced by hdaa_pcm_attach().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hdaa_dump_dst_nid()

static void hdaa_dump_dst_nid ( struct hdaa_pcm_devinfo pdevinfo,
nid_t  nid,
int  depth 
)
static

◆ hdaa_dump_gpi()

static void hdaa_dump_gpi ( struct hdaa_devinfo devinfo)
static

◆ hdaa_dump_gpio()

◆ hdaa_dump_gpo()

static void hdaa_dump_gpo ( struct hdaa_devinfo devinfo)
static

Definition at line 2905 of file hdaa.c.

References data, dev, devinfo, HDA_CMD_GET_GPO_DATA, hda_command, and HDA_PARAM_GPIO_COUNT_NUM_GPO.

Referenced by hdaa_audio_parse(), hdaa_gpo_commit(), and hdaa_pindump().

Here is the caller graph for this function:

◆ hdaa_dump_mix()

static void hdaa_dump_mix ( struct hdaa_pcm_devinfo pdevinfo)
static

Definition at line 6020 of file hdaa.c.

References hdaa_widget::bindas, hdaa_pcm_devinfo::dev, hdaa_pcm_devinfo::devinfo, devinfo, hdaa_widget::enable, hdaa_dump_dst_nid(), hdaa_widget_get(), hdaa_widget::ossdev, and hdaa_pcm_devinfo::recas.

Referenced by hdaa_pcm_attach().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hdaa_dump_nodes()

◆ hdaa_dump_pin()

◆ hdaa_dump_pin_config()

◆ hdaa_dump_pin_configs()

static void hdaa_dump_pin_configs ( struct hdaa_devinfo devinfo)
static

Definition at line 5765 of file hdaa.c.

References hdaa_widget::config, devinfo, HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX, hdaa_dump_pin_config(), hdaa_widget_get(), hdaa_widget::pin, hdaa_widget::type, and hdaa_widget::wclass.

Referenced by hdaa_attach(), and hdaa_configure().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hdaa_dump_pin_sb()

◆ hdaa_eld_dump()

◆ hdaa_eld_handler()

◆ hdaa_gpio_commit()

◆ 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_gpo_commit()

static void hdaa_gpo_commit ( struct hdaa_devinfo devinfo)
static

Definition at line 5179 of file hdaa.c.

References devinfo, HDA_BOOTVERBOSE, HDA_CMD_GET_GPO_DATA, HDA_CMD_SET_GPO_DATA, hda_command, HDA_PARAM_GPIO_COUNT_NUM_GPO, hdaa_dump_gpo(), HDAA_GPIO_CLEAR, HDAA_GPIO_MASK, and HDAA_GPIO_SET.

Referenced by hdaa_audio_commit(), and hdaa_sysctl_gpo_config().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hdaa_hpredir_handler()

◆ hdaa_jack_poll_callback()

static void hdaa_jack_poll_callback ( void *  arg)
static

Definition at line 577 of file hdaa.c.

References devinfo, hdaa_widget::enable, HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX, hdaa_jack_poll_callback(), hdaa_lock, hdaa_presence_handler(), hdaa_unlock, hdaa_widget_get(), and hdaa_widget::type.

Referenced by hdaa_jack_poll_callback(), and hdaa_sense_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hdaa_local_patch()

static void hdaa_local_patch ( struct hdaa_devinfo devinfo)
static

Definition at line 1322 of file hdaa.c.

References devinfo, HDA_BOOTHVERBOSE, HDA_GPIO_ACTIONS, HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX, hdaa_config_fetch(), HDAA_GPIO_MASK, hdaa_gpio_patch(), HDAA_GPIO_SHIFT, hdaa_local_patch_pin(), hdaa_widget_get(), quirks_off, quirks_on, and hdaa_widget::type.

Referenced by hdaa_configure().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hdaa_local_patch_pin()

static void hdaa_local_patch_pin ( struct hdaa_widget w)
static

Definition at line 942 of file hdaa.c.

References buf, hdaa_widget::config, hdaa_devinfo::dev, dev, hdaa_widget::devinfo, HDA_BOOTVERBOSE, hdaa_widget_pin_patch(), hdaa_widget::newconf, hdaa_widget::nid, hdaa_widget::pin, and hdaa_widget::wclass.

Referenced by hdaa_local_patch().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hdaa_pcm_attach()

◆ hdaa_pcm_detach()

static int hdaa_pcm_detach ( device_t  dev)
static

Definition at line 7131 of file hdaa.c.

References dev, pcm_unregister(), and hdaa_pcm_devinfo::registered.

Here is the call graph for this function:

◆ hdaa_pcm_probe()

static int hdaa_pcm_probe ( device_t  dev)
static

◆ hdaa_pcmchannel_setup()

static int hdaa_pcmchannel_setup ( struct hdaa_chan ch)
static

Definition at line 5268 of file hdaa.c.

References hdaa_chan::as, hdaa_chan::asindex, hdaa_chan::bit16, hdaa_chan::bit32, hdaa_widget::cap, hdaa_chan::caps, hdaa_chan::channels, hdaa_widget::conv, hdaa_audio_as::dacs, hdaa_chan::devinfo, devinfo, hdaa_widget::enable, hdaa_audio_as::fakeredir, hdaa_chan::fmtlist, pcmchan_caps::fmtlist, HDA_PARAM_AUDIO_WIDGET_CAP_CC, HDA_PARAM_AUDIO_WIDGET_CAP_DIGITAL, HDA_PARAM_SUPP_PCM_SIZE_RATE_11KHZ, HDA_PARAM_SUPP_PCM_SIZE_RATE_16BIT, HDA_PARAM_SUPP_PCM_SIZE_RATE_16KHZ, HDA_PARAM_SUPP_PCM_SIZE_RATE_176KHZ, HDA_PARAM_SUPP_PCM_SIZE_RATE_192KHZ, HDA_PARAM_SUPP_PCM_SIZE_RATE_20BIT, HDA_PARAM_SUPP_PCM_SIZE_RATE_22KHZ, HDA_PARAM_SUPP_PCM_SIZE_RATE_24BIT, HDA_PARAM_SUPP_PCM_SIZE_RATE_32BIT, HDA_PARAM_SUPP_PCM_SIZE_RATE_32KHZ, HDA_PARAM_SUPP_PCM_SIZE_RATE_44KHZ, HDA_PARAM_SUPP_PCM_SIZE_RATE_88KHZ, HDA_PARAM_SUPP_PCM_SIZE_RATE_8BIT, HDA_PARAM_SUPP_PCM_SIZE_RATE_8KHZ, HDA_PARAM_SUPP_PCM_SIZE_RATE_96KHZ, HDA_PARAM_SUPP_STREAM_FORMATS_AC3, HDA_PARAM_SUPP_STREAM_FORMATS_AC3_MASK, HDA_PARAM_SUPP_STREAM_FORMATS_PCM, hdaa_caps, HDAA_QUIRK_FORCESTEREO, hdaa_widget_get(), hdaa_audio_as::hpredir, hdaa_chan::io, pcmchan_caps::maxspeed, pcmchan_caps::minspeed, hdaa_audio_as::mixed, hdaa_widget::param, hdaa_chan::pcmrates, hdaa_audio_as::pinset, SND_FORMAT, hdaa_widget::stripecap, hdaa_chan::stripecap, hdaa_widget::supp_pcm_size_rate, hdaa_chan::supp_pcm_size_rate, hdaa_widget::supp_stream_formats, hdaa_chan::supp_stream_formats, hdaa_widget::wclass, and hdaa_widget::widget_cap.

Referenced by hdaa_audio_bind_as().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hdaa_pindump()

◆ hdaa_powerup()

static void hdaa_powerup ( struct hdaa_devinfo devinfo)
static

Definition at line 5250 of file hdaa.c.

References devinfo, HDA_CMD_POWER_STATE_D0, HDA_CMD_SET_POWER_STATE, and hda_command.

Referenced by hdaa_attach(), and hdaa_resume().

Here is the caller graph for this function:

◆ hdaa_prepare_pcms()

static void hdaa_prepare_pcms ( struct hdaa_devinfo devinfo)
static

Definition at line 5472 of file hdaa.c.

References hdaa_audio_as::chans, devinfo, hdaa_audio_as::digital, dir, enable, HDAA_CTL_IN, k, max, hdaa_audio_as::num_chans, and hdaa_audio_as::pdevinfo.

Referenced by hdaa_configure().

Here is the caller graph for this function:

◆ hdaa_presence_handler()

◆ hdaa_print_child()

static int hdaa_print_child ( device_t  dev,
device_t  child 
)
static

◆ hdaa_probe()

static int hdaa_probe ( device_t  dev)
static

Definition at line 6580 of file hdaa.c.

References buf, dev, and HDA_PARAM_FCT_GRP_TYPE_NODE_TYPE_AUDIO.

◆ hdaa_resume()

static int hdaa_resume ( device_t  dev)
static

◆ hdaa_sense_deinit()

static void hdaa_sense_deinit ( struct hdaa_devinfo devinfo)
static

Definition at line 798 of file hdaa.c.

References devinfo, hdaa_widget::enable, HDA_CMD_SET_UNSOLICITED_RESPONSE, hda_command, HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX, hdaa_widget_get(), hdaa_widget::nid, hdaa_widget::type, and hdaa_widget::unsol.

Referenced by hdaa_unconfigure().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hdaa_sense_init()

◆ hdaa_stream_format()

static uint16_t hdaa_stream_format ( struct hdaa_chan ch)
static

Definition at line 1803 of file hdaa.c.

References AFMT_CHANNEL, hdaa_chan::bit16, hdaa_chan::bit32, fmt, hdaa_chan::fmt, hda_rate_tab, HDA_RATE_TAB_LEN, hdaa_chan::spd, and valid.

Referenced by hdaa_audio_setup(), and hdaa_channel_start().

Here is the caller graph for this function:

◆ hdaa_stream_intr()

static void hdaa_stream_intr ( device_t  dev,
int  dir,
int  stream 
)
static

Definition at line 6780 of file hdaa.c.

References hdaa_chan::c, chn_intr(), dev, devinfo, hdaa_chan::dir, dir, hdaa_chan::flags, HDAA_CHN_RUNNING, hdaa_lock, hdaa_unlock, PCMDIR_PLAY, PCMDIR_REC, hdaa_chan::sid, and stream.

Here is the call graph for this function:

◆ hdaa_suspend()

static int hdaa_suspend ( device_t  dev)
static

Definition at line 6488 of file hdaa.c.

References dev, devinfo, HDA_BOOTHVERBOSE, HDA_CMD_POWER_STATE_D3, HDA_CMD_SET_POWER_STATE, hda_command, hdaa_channel_stop(), HDAA_CHN_RUNNING, HDAA_CHN_SUSPEND, hdaa_lock, and hdaa_unlock.

Here is the call graph for this function:

◆ hdaa_sysctl_32bit()

static int hdaa_sysctl_32bit ( SYSCTL_HANDLER_ARGS  )
static

◆ hdaa_sysctl_caps()

static int hdaa_sysctl_caps ( SYSCTL_HANDLER_ARGS  )
static

◆ hdaa_sysctl_config()

static int hdaa_sysctl_config ( SYSCTL_HANDLER_ARGS  )
static

◆ hdaa_sysctl_gpi_state()

static int hdaa_sysctl_gpi_state ( SYSCTL_HANDLER_ARGS  )
static

Definition at line 6306 of file hdaa.c.

References buf, data, dev, devinfo, HDA_CMD_GET_GPI_DATA, hda_command, HDA_PARAM_GPIO_COUNT_NUM_GPI, hdaa_lock, hdaa_unlock, n, and req.

Referenced by hdaa_attach().

Here is the caller graph for this function:

◆ hdaa_sysctl_gpio_config()

static int hdaa_sysctl_gpio_config ( SYSCTL_HANDLER_ARGS  )
static

Definition at line 6364 of file hdaa.c.

References buf, devinfo, error, gpio, HDA_GPIO_ACTIONS, HDA_PARAM_GPIO_COUNT_NUM_GPIO, hdaa_gpio_commit(), HDAA_GPIO_MASK, hdaa_gpio_patch(), HDAA_GPIO_SHIFT, hdaa_lock, hdaa_unlock, n, and req.

Referenced by hdaa_attach().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hdaa_sysctl_gpio_state()

static int hdaa_sysctl_gpio_state ( SYSCTL_HANDLER_ARGS  )
static

Definition at line 6330 of file hdaa.c.

References buf, data, dev, devinfo, dir, enable, HDA_CMD_GET_GPIO_DATA, HDA_CMD_GET_GPIO_DIRECTION, HDA_CMD_GET_GPIO_ENABLE_MASK, hda_command, HDA_PARAM_GPIO_COUNT_NUM_GPIO, hdaa_lock, hdaa_unlock, n, and req.

Referenced by hdaa_attach().

Here is the caller graph for this function:

◆ hdaa_sysctl_gpo_config()

static int hdaa_sysctl_gpo_config ( SYSCTL_HANDLER_ARGS  )
static

Definition at line 6418 of file hdaa.c.

References buf, devinfo, error, hdaa_devinfo::gpo, HDA_GPIO_ACTIONS, HDA_PARAM_GPIO_COUNT_NUM_GPO, HDAA_GPIO_MASK, hdaa_gpio_patch(), HDAA_GPIO_SHIFT, hdaa_gpo_commit(), hdaa_lock, hdaa_unlock, n, and req.

Referenced by hdaa_attach().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hdaa_sysctl_gpo_state()

static int hdaa_sysctl_gpo_state ( SYSCTL_HANDLER_ARGS  )
static

Definition at line 6394 of file hdaa.c.

References buf, data, dev, devinfo, HDA_CMD_GET_GPO_DATA, hda_command, HDA_PARAM_GPIO_COUNT_NUM_GPO, hdaa_lock, hdaa_unlock, n, and req.

Referenced by hdaa_attach().

Here is the caller graph for this function:

◆ hdaa_sysctl_quirks()

static int hdaa_sysctl_quirks ( SYSCTL_HANDLER_ARGS  )
static

Definition at line 1295 of file hdaa.c.

References buf, error, hdaa_config_fetch(), hdaa_quirks_tab, n, quirks, quirks_off, req, and value.

Referenced by hdaa_attach().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hdaa_sysctl_reconfig()

static int hdaa_sysctl_reconfig ( SYSCTL_HANDLER_ARGS  )
static

Definition at line 6448 of file hdaa.c.

References dev, devinfo, error, HDA_BOOTHVERBOSE, hdaa_configure(), hdaa_lock, hdaa_unconfigure(), hdaa_unlock, req, and val.

Referenced by hdaa_attach().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hdaa_unconfigure()

◆ hdaa_unsol_intr()

static void hdaa_unsol_intr ( device_t  dev,
uint32_t  resp 
)
static

◆ hdaa_widget_connection_parse()

◆ hdaa_widget_connection_select()

static void hdaa_widget_connection_select ( struct hdaa_widget w,
uint8_t  index 
)
static

◆ hdaa_widget_get()

◆ hdaa_widget_parse()

static void hdaa_widget_parse ( struct hdaa_widget w)
static

Definition at line 1466 of file hdaa.c.

References buf, hdaa_widget::cap, hdaa_widget::config, hdaa_widget::connected, hdaa_widget::conv, hdaa_widget::ctrl, hdaa_devinfo::dev, dev, hdaa_widget::devinfo, hdaa_widget::eapdbtl, HDA_CMD_GET_CONFIGURATION_DEFAULT, HDA_CMD_GET_EAPD_BTL_ENABLE, HDA_CMD_GET_PARAMETER, HDA_CMD_GET_PIN_WIDGET_CTRL, HDA_CMD_GET_STRIPE_CONTROL, HDA_CMD_SET_EAPD_BTL_ENABLE_EAPD, hda_command, HDA_INVALID, HDA_PARAM_AUDIO_WIDGET_CAP, HDA_PARAM_AUDIO_WIDGET_CAP_AMP_OVR, HDA_PARAM_AUDIO_WIDGET_CAP_FORMAT_OVR, HDA_PARAM_AUDIO_WIDGET_CAP_IN_AMP, HDA_PARAM_AUDIO_WIDGET_CAP_OUT_AMP, HDA_PARAM_AUDIO_WIDGET_CAP_STRIPE, HDA_PARAM_AUDIO_WIDGET_CAP_TYPE, HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_AUDIO_INPUT, HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_AUDIO_OUTPUT, HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX, HDA_PARAM_INPUT_AMP_CAP, HDA_PARAM_OUTPUT_AMP_CAP, HDA_PARAM_PIN_CAP, HDA_PARAM_PIN_CAP_EAPD_CAP, HDA_PARAM_SUPP_PCM_SIZE_RATE, HDA_PARAM_SUPP_STREAM_FORMATS, hdaa_lock, hdaa_sysctl_caps(), hdaa_sysctl_config(), hdaa_unlock, hdaa_widget_connection_parse(), hdaa_widget::inamp_cap, hdaa_devinfo::inamp_cap, hdaa_widget::newconf, hdaa_widget::nid, hdaa_widget::original, hdaa_widget::outamp_cap, hdaa_devinfo::outamp_cap, hdaa_widget::param, hdaa_widget::pin, hdaa_widget::stripecap, hdaa_widget::supp_pcm_size_rate, hdaa_devinfo::supp_pcm_size_rate, hdaa_widget::supp_stream_formats, hdaa_devinfo::supp_stream_formats, hdaa_widget::type, hdaa_widget::unsol, hdaa_widget::wclass, and hdaa_widget::widget_cap.

Referenced by hdaa_audio_parse().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hdaa_widget_pin_patch()

◆ hdaa_widget_postprocess()

◆ lcm()

static unsigned lcm ( unsigned  a,
unsigned  b 
)
static

Definition at line 2045 of file hdaa.c.

References b, and gcd().

Referenced by hdaa_channel_setfragments().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MALLOC_DEFINE()

MALLOC_DEFINE ( M_HDAA  ,
"hdaa"  ,
"HDA Audio"   
)

◆ MIXER_DECLARE()

MIXER_DECLARE ( hdaa_audio_ctl_ossmixer  )

◆ MODULE_DEPEND()

MODULE_DEPEND ( snd_hda  ,
sound  ,
SOUND_MINVER  ,
SOUND_PREFVER  ,
SOUND_MAXVER   
)

◆ MODULE_VERSION()

MODULE_VERSION ( snd_hda  ,
 
)

◆ SND_DECLARE_FILE()

SND_DECLARE_FILE ( "$FreeBSD$"  )

Variable Documentation

◆ base

◆ channel_names

const char* channel_names[] = SND_CHN_T_NAMES
static

Definition at line 259 of file hdaa.c.

Referenced by hdaa_channels_handler().

◆ div

uint16_t div

Definition at line 126 of file hdaa.c.

◆ HDA_COLORS

const char* HDA_COLORS[16]
static
Initial value:
= {"Unknown", "Black", "Grey", "Blue",
"Green", "Red", "Orange", "Yellow", "Purple", "Pink", "Res.A", "Res.B",
"Res.C", "Res.D", "White", "Other"}

Definition at line 80 of file hdaa.c.

Referenced by hdaa_dump_pin_config(), hdaa_dump_pin_sb(), hdaa_sysctl_config(), hdaa_widget_pin_patch(), and hdaa_widget_postprocess().

◆ HDA_CONNECTORS

const char* HDA_CONNECTORS[16]
static
Initial value:
= {
"Unknown", "1/8", "1/4", "ATAPI", "RCA", "Optical", "Digital", "Analog",
"DIN", "XLR", "RJ-11", "Combo", "0xc", "0xd", "0xe", "Other" }

Definition at line 90 of file hdaa.c.

Referenced by hdaa_dump_pin_config(), hdaa_dump_pin_sb(), hdaa_sysctl_config(), and hdaa_widget_pin_patch().

◆ HDA_CONNS

const char* HDA_CONNS[4] = {"Jack", "None", "Fixed", "Both"}
static

◆ HDA_DEVS

const char* HDA_DEVS[16]
static
Initial value:
= {"Line-out", "Speaker", "Headphones", "CD",
"SPDIF-out", "Digital-out", "Modem-line", "Modem-handset", "Line-in",
"AUX", "Mic", "Telephony", "SPDIF-in", "Digital-in", "Res.E", "Other"}

Definition at line 84 of file hdaa.c.

Referenced by hdaa_dump_pin_config(), hdaa_dump_pin_sb(), hdaa_pcm_probe(), hdaa_sysctl_config(), hdaa_widget_pin_patch(), and hdaa_widget_postprocess().

◆ HDA_GPIO_ACTIONS

const char* HDA_GPIO_ACTIONS[8]
static
Initial value:
= {
"keep", "set", "clear", "disable", "input", "0x05", "0x06", "0x07"}

Definition at line 104 of file hdaa.c.

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

◆ HDA_HDMI_CODING_TYPES

const char* HDA_HDMI_CODING_TYPES[18]
static
Initial value:
= {
"undefined", "LPCM", "AC-3", "MPEG1", "MP3", "MPEG2", "AAC-LC", "DTS",
"ATRAC", "DSD", "E-AC-3", "DTS-HD", "MLP", "DST", "WMAPro", "HE-AAC",
"HE-AACv2", "MPEG-Surround"
}

Definition at line 107 of file hdaa.c.

Referenced by hdaa_eld_dump().

◆ HDA_LOCS

const char* HDA_LOCS[64]
static
Initial value:
= {
"0x00", "Rear", "Front", "Left", "Right", "Top", "Bottom", "Rear-panel",
"Drive-bay", "0x09", "0x0a", "0x0b", "0x0c", "0x0d", "0x0e", "0x0f",
"Internal", "0x11", "0x12", "0x13", "0x14", "0x15", "0x16", "Riser",
"0x18", "Onboard", "0x1a", "0x1b", "0x1c", "0x1d", "0x1e", "0x1f",
"External", "Ext-Rear", "Ext-Front", "Ext-Left", "Ext-Right", "Ext-Top", "Ext-Bottom", "0x07",
"0x28", "0x29", "0x2a", "0x2b", "0x2c", "0x2d", "0x2e", "0x2f",
"Other", "0x31", "0x32", "0x33", "0x34", "0x35", "Other-Bott", "Lid-In",
"Lid-Out", "0x39", "0x3a", "0x3b", "0x3c", "0x3d", "0x3e", "0x3f" }

Definition at line 94 of file hdaa.c.

Referenced by hdaa_dump_pin_config(), hdaa_dump_pin_sb(), hdaa_pcm_probe(), hdaa_sysctl_config(), and hdaa_widget_pin_patch().

◆ 

const struct { ... } hda_rate_tab[]

Referenced by hdaa_stream_format().

◆ hdaa_audio_ctl_ossmixer_methods

kobj_method_t hdaa_audio_ctl_ossmixer_methods[]
static
Initial value:
= {
}
static int hdaa_audio_ctl_ossmixer_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right)
Definition: hdaa.c:2577
static uint32_t hdaa_audio_ctl_ossmixer_setrecsrc(struct snd_mixer *m, uint32_t src)
Definition: hdaa.c:2754
static int hdaa_audio_ctl_ossmixer_init(struct snd_mixer *m)
Definition: hdaa.c:2222
#define KOBJMETHOD_END
Definition: midi.c:76
static int mixer_setrecsrc(struct snd_mixer *mixer, u_int32_t src)
Definition: mixer.c:373
int mixer_init(device_t dev, kobj_class_t cls, void *devinfo)
Definition: mixer.c:725
static int mixer_set(struct snd_mixer *m, u_int dev, u_int32_t muted, u_int lev)
Definition: mixer.c:247

Definition at line 2832 of file hdaa.c.

◆ hdaa_caps

struct pcmchan_caps hdaa_caps = {48000, 48000, hdaa_fmt, 0}
static

Definition at line 119 of file hdaa.c.

Referenced by hdaa_pcmchannel_setup().

◆ hdaa_channel_methods

kobj_method_t hdaa_channel_methods[]
static
Initial value:
= {
KOBJMETHOD(channel_init, hdaa_channel_init),
KOBJMETHOD(channel_setformat, hdaa_channel_setformat),
KOBJMETHOD(channel_setspeed, hdaa_channel_setspeed),
KOBJMETHOD(channel_setblocksize, hdaa_channel_setblocksize),
KOBJMETHOD(channel_setfragments, hdaa_channel_setfragments),
KOBJMETHOD(channel_trigger, hdaa_channel_trigger),
KOBJMETHOD(channel_getptr, hdaa_channel_getptr),
KOBJMETHOD(channel_getcaps, hdaa_channel_getcaps),
}
static void * hdaa_channel_init(kobj_t obj, void *data, struct snd_dbuf *b, struct pcm_channel *c, int dir)
Definition: hdaa.c:1730
static uint32_t hdaa_channel_getptr(kobj_t obj, void *data)
Definition: hdaa.c:2177
static uint32_t hdaa_channel_setspeed(kobj_t obj, void *data, uint32_t speed)
Definition: hdaa.c:1776
static struct pcmchan_caps * hdaa_channel_getcaps(kobj_t obj, void *data)
Definition: hdaa.c:2203
static int hdaa_channel_trigger(kobj_t obj, void *data, int go)
Definition: hdaa.c:2151
static uint32_t hdaa_channel_setblocksize(kobj_t obj, void *data, uint32_t blksz)
Definition: hdaa.c:2090
static int hdaa_channel_setformat(kobj_t obj, void *data, uint32_t format)
Definition: hdaa.c:1760
static int hdaa_channel_setfragments(kobj_t obj, void *data, uint32_t blksz, uint32_t blkcnt)
Definition: hdaa.c:2052

Definition at line 2208 of file hdaa.c.

◆ hdaa_devclass

devclass_t hdaa_devclass
static

Definition at line 6851 of file hdaa.c.

◆ hdaa_driver

driver_t hdaa_driver
static
Initial value:
= {
"hdaa",
sizeof(struct hdaa_devinfo),
}
static device_method_t hdaa_methods[]
Definition: hdaa.c:6829

Definition at line 6845 of file hdaa.c.

◆ hdaa_fmt

uint32_t hdaa_fmt[]
static
Initial value:
= {
SND_FORMAT(AFMT_S16_LE, 2, 0),
0
}
#define SND_FORMAT(f, c, e)
Definition: sound.h:238

Definition at line 114 of file hdaa.c.

◆ hdaa_methods

device_method_t hdaa_methods[]
static
Initial value:
= {
DEVMETHOD(device_probe, hdaa_probe),
DEVMETHOD(device_attach, hdaa_attach),
DEVMETHOD(device_detach, hdaa_detach),
DEVMETHOD(device_suspend, hdaa_suspend),
DEVMETHOD(device_resume, hdaa_resume),
DEVMETHOD(bus_print_child, hdaa_print_child),
DEVMETHOD(bus_child_location, hdaa_child_location),
DEVMETHOD(hdac_stream_intr, hdaa_stream_intr),
DEVMETHOD(hdac_unsol_intr, hdaa_unsol_intr),
DEVMETHOD(hdac_pindump, hdaa_pindump),
DEVMETHOD_END
}
static void hdaa_stream_intr(device_t dev, int dir, int stream)
Definition: hdaa.c:6780
static int hdaa_detach(device_t dev)
Definition: hdaa.c:6691
static int hdaa_resume(device_t dev)
Definition: hdaa.c:6524
static int hdaa_child_location(device_t dev, device_t child, struct sbuf *sb)
Definition: hdaa.c:6749
static int hdaa_print_child(device_t dev, device_t child)
Definition: hdaa.c:6711
static void hdaa_pindump(device_t dev)
Definition: hdaa.c:6047
static void hdaa_unsol_intr(device_t dev, uint32_t resp)
Definition: hdaa.c:6800
static int hdaa_probe(device_t dev)
Definition: hdaa.c:6580
static int hdaa_attach(device_t dev)
Definition: hdaa.c:6595
static int hdaa_suspend(device_t dev)
Definition: hdaa.c:6488

Definition at line 6829 of file hdaa.c.

◆ hdaa_pcm_driver

driver_t hdaa_pcm_driver
static
Initial value:
= {
"pcm",
}
static device_method_t hdaa_pcm_methods[]
Definition: hdaa.c:7146
#define PCM_SOFTC_SIZE
Definition: sound.h:96

Definition at line 7154 of file hdaa.c.

◆ hdaa_pcm_methods

device_method_t hdaa_pcm_methods[]
static
Initial value:
= {
DEVMETHOD(device_probe, hdaa_pcm_probe),
DEVMETHOD(device_attach, hdaa_pcm_attach),
DEVMETHOD(device_detach, hdaa_pcm_detach),
DEVMETHOD_END
}
static int hdaa_pcm_attach(device_t dev)
Definition: hdaa.c:7007
static int hdaa_pcm_detach(device_t dev)
Definition: hdaa.c:7131
static int hdaa_pcm_probe(device_t dev)
Definition: hdaa.c:6940

Definition at line 7146 of file hdaa.c.

◆ 

const struct { ... } hdaa_quirks_tab[]
Initial value:
= {
{ "softpcmvol", HDAA_QUIRK_SOFTPCMVOL },
{ "fixedrate", HDAA_QUIRK_FIXEDRATE },
{ "forcestereo", HDAA_QUIRK_FORCESTEREO },
{ "eapdinv", HDAA_QUIRK_EAPDINV },
{ "senseinv", HDAA_QUIRK_SENSEINV },
{ "ivref50", HDAA_QUIRK_IVREF50 },
{ "ivref80", HDAA_QUIRK_IVREF80 },
{ "ivref100", HDAA_QUIRK_IVREF100 },
{ "ovref50", HDAA_QUIRK_OVREF50 },
{ "ovref80", HDAA_QUIRK_OVREF80 },
{ "ovref100", HDAA_QUIRK_OVREF100 },
{ "ivref", HDAA_QUIRK_IVREF },
{ "ovref", HDAA_QUIRK_OVREF },
{ "vref", HDAA_QUIRK_VREF },
}
#define HDAA_QUIRK_IVREF80
Definition: hdaa.h:57
#define HDAA_QUIRK_VREF
Definition: hdaa.h:67
#define HDAA_QUIRK_FORCESTEREO
Definition: hdaa.h:51
#define HDAA_QUIRK_OVREF
Definition: hdaa.h:65
#define HDAA_QUIRK_EAPDINV
Definition: hdaa.h:52
#define HDAA_QUIRK_SOFTPCMVOL
Definition: hdaa.h:49
#define HDAA_QUIRK_IVREF100
Definition: hdaa.h:58
#define HDAA_QUIRK_OVREF100
Definition: hdaa.h:61
#define HDAA_QUIRK_IVREF
Definition: hdaa.h:63
#define HDAA_QUIRK_OVREF50
Definition: hdaa.h:59
#define HDAA_QUIRK_OVREF80
Definition: hdaa.h:60
#define HDAA_QUIRK_FIXEDRATE
Definition: hdaa.h:50
#define HDAA_QUIRK_IVREF50
Definition: hdaa.h:56
#define HDAA_QUIRK_SENSEINV
Definition: hdaa.h:53

Referenced by hdaa_config_fetch(), and hdaa_sysctl_quirks().

◆ key

const char* key

Definition at line 57 of file hdaa.c.

Referenced by hdaa_config_fetch(), hdaa_gpio_patch(), hdaa_widget_pin_patch(), and seq_chncommon().

◆ matrixes

const struct matrix matrixes[]
static
Initial value:
= {
}
#define SND_CHN_MATRIX_MAP_4_1
Definition: matrix_map.h:287
#define SND_CHN_MATRIX_MAP_4_0
Definition: matrix_map.h:243
#define SND_CHN_MATRIX_MAP_7_1
Definition: matrix_map.h:614
#define SND_CHN_MATRIX_MAP_2_0
Definition: matrix_map.h:94
#define SND_CHN_MATRIX_MAP_3_0
Definition: matrix_map.h:162
#define SND_CHN_MATRIX_MAP_2_1
Definition: matrix_map.h:125
#define SND_CHN_MATRIX_MAP_1_0
Definition: matrix_map.h:68
#define SND_CHN_MATRIX_MAP_6_0
Definition: matrix_map.h:440
#define SND_CHN_MATRIX_MAP_6_1
Definition: matrix_map.h:495
#define SND_CHN_MATRIX_MAP_7_0
Definition: matrix_map.h:552
#define SND_CHN_MATRIX_MAP_3_1
Definition: matrix_map.h:200
#define SND_CHN_MATRIX_MAP_5_1
Definition: matrix_map.h:387
#define SND_CHN_MATRIX_MAP_5_0
Definition: matrix_map.h:337

Referenced by hdaa_channels_handler().

◆ mul

uint16_t mul

Definition at line 125 of file hdaa.c.

Referenced by feed_matrix_setup().

◆ ossnames

const char* ossnames[] = SOUND_DEVICE_NAMES
static

◆ rate

uint32_t rate

Definition at line 122 of file hdaa.c.

◆ valid

int valid

Definition at line 123 of file hdaa.c.

Referenced by hdaa_stream_format().

◆ value