Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
hda_codec.c File Reference
#include <linux/mm.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/pci.h>
#include <linux/mutex.h>
#include <linux/module.h>
#include <sound/core.h>
#include "hda_codec.h"
#include <sound/asoundef.h>
#include <sound/tlv.h>
#include <sound/initval.h>
#include <sound/jack.h>
#include "hda_local.h"
#include "hda_beep.h"
#include "hda_jack.h"
#include <sound/hda_hwdep.h>
#include "hda_trace.h"

Go to the source code of this file.

Data Structures

struct  hda_vendor_id
 
struct  hda_cvt_setup
 
struct  hda_rate_tbl
 

Macros

#define CREATE_TRACE_POINTS
 
#define codec_in_pm(codec)   0
 
#define hda_codec_is_power_on(codec)   1
 
#define hda_call_pm_notify(bus, state)   {}
 
#define snd_hda_bus_dev_register   NULL
 
#define is_generic_config(codec)   0
 
#define HDA_MODREQ_MAX_COUNT   0 /* all presets are statically linked */
 
#define HDA_HASH_KEY(nid, dir, idx)   (u32)((nid) + ((idx) << 16) + ((dir) << 24))
 
#define HDA_HASH_PINCAP_KEY(nid)   (u32)((nid) + (0x02 << 24))
 
#define HDA_HASH_PARPCM_KEY(nid)   (u32)((nid) + (0x03 << 24))
 
#define HDA_HASH_PARSTR_KEY(nid)   (u32)((nid) + (0x04 << 24))
 
#define INFO_AMP_CAPS   (1<<0)
 
#define INFO_AMP_VOL(ch)   (1 << (1 + (ch)))
 
#define AC_PAR_PCM_RATE_BITS   11
 

Functions

int snd_hda_add_codec_preset (struct hda_codec_preset_list *preset)
 
 EXPORT_SYMBOL_HDA (snd_hda_add_codec_preset)
 
int snd_hda_delete_codec_preset (struct hda_codec_preset_list *preset)
 
 EXPORT_SYMBOL_HDA (snd_hda_delete_codec_preset)
 
const charsnd_hda_get_jack_location (u32 cfg)
 
 EXPORT_SYMBOL_HDA (snd_hda_get_jack_location)
 
const charsnd_hda_get_jack_connectivity (u32 cfg)
 
 EXPORT_SYMBOL_HDA (snd_hda_get_jack_connectivity)
 
const charsnd_hda_get_jack_type (u32 cfg)
 
 EXPORT_SYMBOL_HDA (snd_hda_get_jack_type)
 
unsigned int snd_hda_codec_read (struct hda_codec *codec, hda_nid_t nid, int direct, unsigned int verb, unsigned int parm)
 
 EXPORT_SYMBOL_HDA (snd_hda_codec_read)
 
int snd_hda_codec_write (struct hda_codec *codec, hda_nid_t nid, int direct, unsigned int verb, unsigned int parm)
 
 EXPORT_SYMBOL_HDA (snd_hda_codec_write)
 
void snd_hda_sequence_write (struct hda_codec *codec, const struct hda_verb *seq)
 
 EXPORT_SYMBOL_HDA (snd_hda_sequence_write)
 
int snd_hda_get_sub_nodes (struct hda_codec *codec, hda_nid_t nid, hda_nid_t *start_id)
 
 EXPORT_SYMBOL_HDA (snd_hda_get_sub_nodes)
 
int snd_hda_get_connections (struct hda_codec *codec, hda_nid_t nid, hda_nid_t *conn_list, int max_conns)
 
 EXPORT_SYMBOL_HDA (snd_hda_get_connections)
 
int snd_hda_get_raw_connections (struct hda_codec *codec, hda_nid_t nid, hda_nid_t *conn_list, int max_conns)
 
int snd_hda_override_conn_list (struct hda_codec *codec, hda_nid_t nid, int len, const hda_nid_t *list)
 
 EXPORT_SYMBOL_HDA (snd_hda_override_conn_list)
 
int snd_hda_get_conn_index (struct hda_codec *codec, hda_nid_t mux, hda_nid_t nid, int recursive)
 
 EXPORT_SYMBOL_HDA (snd_hda_get_conn_index)
 
int snd_hda_queue_unsol_event (struct hda_bus *bus, u32 res, u32 res_ex)
 
 EXPORT_SYMBOL_HDA (snd_hda_queue_unsol_event)
 
int snd_hda_bus_new (struct snd_card *card, const struct hda_bus_template *temp, struct hda_bus **busp)
 
 EXPORT_SYMBOL_HDA (snd_hda_bus_new)
 
int snd_hda_add_pincfg (struct hda_codec *codec, struct snd_array *list, hda_nid_t nid, unsigned int cfg)
 
int snd_hda_codec_set_pincfg (struct hda_codec *codec, hda_nid_t nid, unsigned int cfg)
 
 EXPORT_SYMBOL_HDA (snd_hda_codec_set_pincfg)
 
unsigned int snd_hda_codec_get_pincfg (struct hda_codec *codec, hda_nid_t nid)
 
 EXPORT_SYMBOL_HDA (snd_hda_codec_get_pincfg)
 
void snd_hda_shutup_pins (struct hda_codec *codec)
 
 EXPORT_SYMBOL_HDA (snd_hda_shutup_pins)
 
int snd_hda_codec_new (struct hda_bus *bus, unsigned int codec_addr, struct hda_codec **codecp)
 
 EXPORT_SYMBOL_HDA (snd_hda_codec_new)
 
int snd_hda_codec_configure (struct hda_codec *codec)
 
 EXPORT_SYMBOL_HDA (snd_hda_codec_configure)
 
void snd_hda_codec_setup_stream (struct hda_codec *codec, hda_nid_t nid, u32 stream_tag, int channel_id, int format)
 
 EXPORT_SYMBOL_HDA (snd_hda_codec_setup_stream)
 
void __snd_hda_codec_cleanup_stream (struct hda_codec *codec, hda_nid_t nid, int do_now)
 
 EXPORT_SYMBOL_HDA (__snd_hda_codec_cleanup_stream)
 
u32 query_amp_caps (struct hda_codec *codec, hda_nid_t nid, int direction)
 
 EXPORT_SYMBOL_HDA (query_amp_caps)
 
int snd_hda_override_amp_caps (struct hda_codec *codec, hda_nid_t nid, int dir, unsigned int caps)
 
 EXPORT_SYMBOL_HDA (snd_hda_override_amp_caps)
 
u32 snd_hda_query_pin_caps (struct hda_codec *codec, hda_nid_t nid)
 
 EXPORT_SYMBOL_HDA (snd_hda_query_pin_caps)
 
int snd_hda_override_pin_caps (struct hda_codec *codec, hda_nid_t nid, unsigned int caps)
 
 EXPORT_SYMBOL_HDA (snd_hda_override_pin_caps)
 
int snd_hda_codec_amp_read (struct hda_codec *codec, hda_nid_t nid, int ch, int direction, int index)
 
 EXPORT_SYMBOL_HDA (snd_hda_codec_amp_read)
 
int snd_hda_codec_amp_update (struct hda_codec *codec, hda_nid_t nid, int ch, int direction, int idx, int mask, int val)
 
 EXPORT_SYMBOL_HDA (snd_hda_codec_amp_update)
 
int snd_hda_codec_amp_stereo (struct hda_codec *codec, hda_nid_t nid, int direction, int idx, int mask, int val)
 
 EXPORT_SYMBOL_HDA (snd_hda_codec_amp_stereo)
 
int snd_hda_mixer_amp_volume_info (struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
 
 EXPORT_SYMBOL_HDA (snd_hda_mixer_amp_volume_info)
 
int snd_hda_mixer_amp_volume_get (struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
 
 EXPORT_SYMBOL_HDA (snd_hda_mixer_amp_volume_get)
 
int snd_hda_mixer_amp_volume_put (struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
 
 EXPORT_SYMBOL_HDA (snd_hda_mixer_amp_volume_put)
 
int snd_hda_mixer_amp_tlv (struct snd_kcontrol *kcontrol, int op_flag, unsigned int size, unsigned int __user *_tlv)
 
 EXPORT_SYMBOL_HDA (snd_hda_mixer_amp_tlv)
 
void snd_hda_set_vmaster_tlv (struct hda_codec *codec, hda_nid_t nid, int dir, unsigned int *tlv)
 
 EXPORT_SYMBOL_HDA (snd_hda_set_vmaster_tlv)
 

: ctl id name string

snd_hda_find_mixer_ctl - Find a mixer control element with the given name : HD-audio codec

Get the control element with the given id string and IFACE_MIXER.

typedef int(* map_slave_func_t )(void *, struct snd_kcontrol *)
 
struct snd_kcontrolsnd_hda_find_mixer_ctl (struct hda_codec *codec, const char *name)
 
 EXPORT_SYMBOL_HDA (snd_hda_find_mixer_ctl)
 
int snd_hda_ctl_add (struct hda_codec *codec, hda_nid_t nid, struct snd_kcontrol *kctl)
 
 EXPORT_SYMBOL_HDA (snd_hda_ctl_add)
 
int snd_hda_add_nid (struct hda_codec *codec, struct snd_kcontrol *kctl, unsigned int index, hda_nid_t nid)
 
 EXPORT_SYMBOL_HDA (snd_hda_add_nid)
 
void snd_hda_ctls_clear (struct hda_codec *codec)
 
int snd_hda_lock_devices (struct hda_bus *bus)
 
 EXPORT_SYMBOL_HDA (snd_hda_lock_devices)
 
void snd_hda_unlock_devices (struct hda_bus *bus)
 
 EXPORT_SYMBOL_HDA (snd_hda_unlock_devices)
 
int snd_hda_codec_reset (struct hda_codec *codec)
 

: vmaster control name

snd_hda_add_vmaster - create a virtual master control and add slaves : HD-audio codec

: TLV data (optional) : slave control names (optional) : suffix string to each slave name (optional) : initialize slaves to unmute/0dB : store the vmaster kcontrol in return

Create a virtual master control with the given name. The TLV data must be either NULL or a valid data.

is a NULL-terminated array of strings, each of which is a slave control name. All controls with these names are assigned to the new virtual master control.

This function returns zero if successful or a negative error code.

#define AMP_VAL_IDX_SHIFT   19
 
#define AMP_VAL_IDX_MASK   (0x0f<<19)
 
#define snd_hda_spdif_out_switch_info   snd_ctl_boolean_mono_info
 
#define snd_hda_spdif_in_switch_info   snd_hda_spdif_out_switch_info
 
#define HDA_RATE(base, mult, div)
 
struct hda_ctl_ops snd_hda_bind_vol
 
struct hda_ctl_ops snd_hda_bind_sw
 
const charsnd_hda_pcm_type_name [HDA_PCM_NTYPES]
 
int __snd_hda_add_vmaster (struct hda_codec *codec, char *name, unsigned int *tlv, const char *const *slaves, const char *suffix, bool init_slave_vol, struct snd_kcontrol **ctl_ret)
 
 EXPORT_SYMBOL_HDA (__snd_hda_add_vmaster)
 
int snd_hda_add_vmaster_hook (struct hda_codec *codec, struct hda_vmaster_mute_hook *hook, bool expose_enum_ctl)
 
 EXPORT_SYMBOL_HDA (snd_hda_add_vmaster_hook)
 
void snd_hda_sync_vmaster_hook (struct hda_vmaster_mute_hook *hook)
 
 EXPORT_SYMBOL_HDA (snd_hda_sync_vmaster_hook)
 
int snd_hda_mixer_amp_switch_info (struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
 
 EXPORT_SYMBOL_HDA (snd_hda_mixer_amp_switch_info)
 
int snd_hda_mixer_amp_switch_get (struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
 
 EXPORT_SYMBOL_HDA (snd_hda_mixer_amp_switch_get)
 
int snd_hda_mixer_amp_switch_put (struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
 
 EXPORT_SYMBOL_HDA (snd_hda_mixer_amp_switch_put)
 
int snd_hda_mixer_bind_switch_get (struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
 
 EXPORT_SYMBOL_HDA (snd_hda_mixer_bind_switch_get)
 
int snd_hda_mixer_bind_switch_put (struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
 
 EXPORT_SYMBOL_HDA (snd_hda_mixer_bind_switch_put)
 
int snd_hda_mixer_bind_ctls_info (struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
 
 EXPORT_SYMBOL_HDA (snd_hda_mixer_bind_ctls_info)
 
int snd_hda_mixer_bind_ctls_get (struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
 
 EXPORT_SYMBOL_HDA (snd_hda_mixer_bind_ctls_get)
 
int snd_hda_mixer_bind_ctls_put (struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
 
 EXPORT_SYMBOL_HDA (snd_hda_mixer_bind_ctls_put)
 
int snd_hda_mixer_bind_tlv (struct snd_kcontrol *kcontrol, int op_flag, unsigned int size, unsigned int __user *tlv)
 
 EXPORT_SYMBOL_HDA (snd_hda_mixer_bind_tlv)
 
 EXPORT_SYMBOL_HDA (snd_hda_bind_vol)
 
 EXPORT_SYMBOL_HDA (snd_hda_bind_sw)
 
int snd_hda_create_spdif_out_ctls (struct hda_codec *codec, hda_nid_t associated_nid, hda_nid_t cvt_nid)
 
 EXPORT_SYMBOL_HDA (snd_hda_create_spdif_out_ctls)
 
struct hda_spdif_outsnd_hda_spdif_out_of_nid (struct hda_codec *codec, hda_nid_t nid)
 
 EXPORT_SYMBOL_HDA (snd_hda_spdif_out_of_nid)
 
void snd_hda_spdif_ctls_unassign (struct hda_codec *codec, int idx)
 
 EXPORT_SYMBOL_HDA (snd_hda_spdif_ctls_unassign)
 
void snd_hda_spdif_ctls_assign (struct hda_codec *codec, int idx, hda_nid_t nid)
 
 EXPORT_SYMBOL_HDA (snd_hda_spdif_ctls_assign)
 
int snd_hda_create_spdif_share_sw (struct hda_codec *codec, struct hda_multi_out *mout)
 
 EXPORT_SYMBOL_HDA (snd_hda_create_spdif_share_sw)
 
int snd_hda_create_spdif_in_ctls (struct hda_codec *codec, hda_nid_t nid)
 
 EXPORT_SYMBOL_HDA (snd_hda_create_spdif_in_ctls)
 
void snd_hda_codec_set_power_to_all (struct hda_codec *codec, hda_nid_t fg, unsigned int power_state, bool eapd_workaround)
 
 EXPORT_SYMBOL_HDA (snd_hda_codec_set_power_to_all)
 
int snd_hda_build_controls (struct hda_bus *bus)
 
 EXPORT_SYMBOL_HDA (snd_hda_build_controls)
 
int snd_hda_codec_build_controls (struct hda_codec *codec)
 
unsigned int snd_hda_calc_stream_format (unsigned int rate, unsigned int channels, unsigned int format, unsigned int maxbps, unsigned short spdif_ctls)
 
 EXPORT_SYMBOL_HDA (snd_hda_calc_stream_format)
 
int snd_hda_query_supported_pcm (struct hda_codec *codec, hda_nid_t nid, u32 *ratesp, u64 *formatsp, unsigned int *bpsp)
 
 EXPORT_SYMBOL_HDA (snd_hda_query_supported_pcm)
 
int snd_hda_is_supported_format (struct hda_codec *codec, hda_nid_t nid, unsigned int format)
 
 EXPORT_SYMBOL_HDA (snd_hda_is_supported_format)
 
int snd_hda_codec_prepare (struct hda_codec *codec, struct hda_pcm_stream *hinfo, unsigned int stream, unsigned int format, struct snd_pcm_substream *substream)
 
 EXPORT_SYMBOL_HDA (snd_hda_codec_prepare)
 
void snd_hda_codec_cleanup (struct hda_codec *codec, struct hda_pcm_stream *hinfo, struct snd_pcm_substream *substream)
 
 EXPORT_SYMBOL_HDA (snd_hda_codec_cleanup)
 
int snd_hda_codec_build_pcms (struct hda_codec *codec)
 
int snd_hda_build_pcms (struct hda_bus *bus)
 
 EXPORT_SYMBOL_HDA (snd_hda_build_pcms)
 
int snd_hda_check_board_config (struct hda_codec *codec, int num_configs, const char *const *models, const struct snd_pci_quirk *tbl)
 
 EXPORT_SYMBOL_HDA (snd_hda_check_board_config)
 
int snd_hda_check_board_codec_sid_config (struct hda_codec *codec, int num_configs, const char *const *models, const struct snd_pci_quirk *tbl)
 
 EXPORT_SYMBOL_HDA (snd_hda_check_board_codec_sid_config)
 
int snd_hda_add_new_ctls (struct hda_codec *codec, const struct snd_kcontrol_new *knew)
 
 EXPORT_SYMBOL_HDA (snd_hda_add_new_ctls)
 
int snd_hda_ch_mode_info (struct hda_codec *codec, struct snd_ctl_elem_info *uinfo, const struct hda_channel_mode *chmode, int num_chmodes)
 
 EXPORT_SYMBOL_HDA (snd_hda_ch_mode_info)
 
int snd_hda_ch_mode_get (struct hda_codec *codec, struct snd_ctl_elem_value *ucontrol, const struct hda_channel_mode *chmode, int num_chmodes, int max_channels)
 
 EXPORT_SYMBOL_HDA (snd_hda_ch_mode_get)
 
int snd_hda_ch_mode_put (struct hda_codec *codec, struct snd_ctl_elem_value *ucontrol, const struct hda_channel_mode *chmode, int num_chmodes, int *max_channelsp)
 
 EXPORT_SYMBOL_HDA (snd_hda_ch_mode_put)
 
int snd_hda_input_mux_info (const struct hda_input_mux *imux, struct snd_ctl_elem_info *uinfo)
 
 EXPORT_SYMBOL_HDA (snd_hda_input_mux_info)
 
int snd_hda_input_mux_put (struct hda_codec *codec, const struct hda_input_mux *imux, struct snd_ctl_elem_value *ucontrol, hda_nid_t nid, unsigned int *cur_val)
 
 EXPORT_SYMBOL_HDA (snd_hda_input_mux_put)
 
void snd_hda_bus_reboot_notify (struct hda_bus *bus)
 
 EXPORT_SYMBOL_HDA (snd_hda_bus_reboot_notify)
 
int snd_hda_multi_out_dig_open (struct hda_codec *codec, struct hda_multi_out *mout)
 
 EXPORT_SYMBOL_HDA (snd_hda_multi_out_dig_open)
 
int snd_hda_multi_out_dig_prepare (struct hda_codec *codec, struct hda_multi_out *mout, unsigned int stream_tag, unsigned int format, struct snd_pcm_substream *substream)
 
 EXPORT_SYMBOL_HDA (snd_hda_multi_out_dig_prepare)
 
int snd_hda_multi_out_dig_cleanup (struct hda_codec *codec, struct hda_multi_out *mout)
 
 EXPORT_SYMBOL_HDA (snd_hda_multi_out_dig_cleanup)
 
int snd_hda_multi_out_dig_close (struct hda_codec *codec, struct hda_multi_out *mout)
 
 EXPORT_SYMBOL_HDA (snd_hda_multi_out_dig_close)
 
int snd_hda_multi_out_analog_open (struct hda_codec *codec, struct hda_multi_out *mout, struct snd_pcm_substream *substream, struct hda_pcm_stream *hinfo)
 
 EXPORT_SYMBOL_HDA (snd_hda_multi_out_analog_open)
 
int snd_hda_multi_out_analog_prepare (struct hda_codec *codec, struct hda_multi_out *mout, unsigned int stream_tag, unsigned int format, struct snd_pcm_substream *substream)
 
 EXPORT_SYMBOL_HDA (snd_hda_multi_out_analog_prepare)
 
int snd_hda_multi_out_analog_cleanup (struct hda_codec *codec, struct hda_multi_out *mout)
 
 EXPORT_SYMBOL_HDA (snd_hda_multi_out_analog_cleanup)
 
unsigned int snd_hda_get_default_vref (struct hda_codec *codec, hda_nid_t pin)
 
 EXPORT_SYMBOL_HDA (snd_hda_get_default_vref)
 
int _snd_hda_set_pin_ctl (struct hda_codec *codec, hda_nid_t pin, unsigned int val, bool cached)
 
 EXPORT_SYMBOL_HDA (_snd_hda_set_pin_ctl)
 
int snd_hda_add_imux_item (struct hda_input_mux *imux, const char *label, int index, int *type_idx)
 
 EXPORT_SYMBOL_HDA (snd_hda_add_imux_item)
 
voidsnd_array_new (struct snd_array *array)
 
 EXPORT_SYMBOL_HDA (snd_array_new)
 
void snd_array_free (struct snd_array *array)
 
 EXPORT_SYMBOL_HDA (snd_array_free)
 
void snd_print_pcm_bits (int pcm, char *buf, int buflen)
 
 EXPORT_SYMBOL_HDA (snd_print_pcm_bits)
 
 MODULE_DESCRIPTION ("HDA codec core")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define AC_PAR_PCM_RATE_BITS   11
#define AMP_VAL_IDX_MASK   (0x0f<<19)

Definition at line 2731 of file hda_codec.c.

#define AMP_VAL_IDX_SHIFT   19

Definition at line 2730 of file hda_codec.c.

#define codec_in_pm (   codec)    0

Definition at line 108 of file hda_codec.c.

#define CREATE_TRACE_POINTS

Definition at line 40 of file hda_codec.c.

#define hda_call_pm_notify (   bus,
  state 
)    {}

Definition at line 111 of file hda_codec.c.

#define hda_codec_is_power_on (   codec)    1

Definition at line 110 of file hda_codec.c.

#define HDA_HASH_KEY (   nid,
  dir,
  idx 
)    (u32)((nid) + ((idx) << 16) + ((dir) << 24))

Definition at line 1583 of file hda_codec.c.

#define HDA_HASH_PARPCM_KEY (   nid)    (u32)((nid) + (0x03 << 24))

Definition at line 1585 of file hda_codec.c.

#define HDA_HASH_PARSTR_KEY (   nid)    (u32)((nid) + (0x04 << 24))

Definition at line 1586 of file hda_codec.c.

#define HDA_HASH_PINCAP_KEY (   nid)    (u32)((nid) + (0x02 << 24))

Definition at line 1584 of file hda_codec.c.

#define HDA_MODREQ_MAX_COUNT   0 /* all presets are statically linked */

Definition at line 808 of file hda_codec.c.

#define HDA_RATE (   base,
  mult,
  div 
)
Value:
(AC_FMT_BASE_##base##K | (((mult) - 1) << AC_FMT_MULT_SHIFT) | \
(((div) - 1) << AC_FMT_DIV_SHIFT))

Definition at line 3763 of file hda_codec.c.

#define INFO_AMP_CAPS   (1<<0)

Definition at line 1587 of file hda_codec.c.

#define INFO_AMP_VOL (   ch)    (1 << (1 + (ch)))

Definition at line 1588 of file hda_codec.c.

#define is_generic_config (   codec)    0

Definition at line 802 of file hda_codec.c.

#define snd_hda_bus_dev_register   NULL

Definition at line 730 of file hda_codec.c.

#define snd_hda_spdif_in_switch_info   snd_hda_spdif_out_switch_info

Definition at line 3272 of file hda_codec.c.

#define snd_hda_spdif_out_switch_info   snd_ctl_boolean_mono_info

Definition at line 3054 of file hda_codec.c.

Typedef Documentation

typedef int(* map_slave_func_t)(void *, struct snd_kcontrol *)

Definition at line 2399 of file hda_codec.c.

Function Documentation

int __snd_hda_add_vmaster ( struct hda_codec codec,
char name,
unsigned int tlv,
const char *const slaves,
const char suffix,
bool  init_slave_vol,
struct snd_kcontrol **  ctl_ret 
)

Definition at line 2508 of file hda_codec.c.

void __snd_hda_codec_cleanup_stream ( struct hda_codec codec,
hda_nid_t  nid,
int  do_now 
)

__snd_hda_codec_cleanup_stream - clean up the codec for closing : the CODEC to clean up : the NID to clean up : really clean up the stream instead of clearing the active flag

Definition at line 1509 of file hda_codec.c.

int _snd_hda_set_pin_ctl ( struct hda_codec codec,
hda_nid_t  pin,
unsigned int  val,
bool  cached 
)

Definition at line 5063 of file hda_codec.c.

EXPORT_SYMBOL_HDA ( snd_hda_add_codec_preset  )
EXPORT_SYMBOL_HDA ( snd_hda_delete_codec_preset  )
EXPORT_SYMBOL_HDA ( snd_hda_get_jack_location  )
EXPORT_SYMBOL_HDA ( snd_hda_get_jack_connectivity  )
EXPORT_SYMBOL_HDA ( snd_hda_get_jack_type  )
EXPORT_SYMBOL_HDA ( snd_hda_codec_read  )
EXPORT_SYMBOL_HDA ( snd_hda_codec_write  )
EXPORT_SYMBOL_HDA ( snd_hda_sequence_write  )
EXPORT_SYMBOL_HDA ( snd_hda_get_sub_nodes  )
EXPORT_SYMBOL_HDA ( snd_hda_get_connections  )
EXPORT_SYMBOL_HDA ( snd_hda_override_conn_list  )
EXPORT_SYMBOL_HDA ( snd_hda_get_conn_index  )
EXPORT_SYMBOL_HDA ( snd_hda_queue_unsol_event  )
EXPORT_SYMBOL_HDA ( snd_hda_bus_new  )
EXPORT_SYMBOL_HDA ( snd_hda_codec_set_pincfg  )
EXPORT_SYMBOL_HDA ( snd_hda_codec_get_pincfg  )
EXPORT_SYMBOL_HDA ( snd_hda_shutup_pins  )
EXPORT_SYMBOL_HDA ( snd_hda_codec_new  )
EXPORT_SYMBOL_HDA ( snd_hda_codec_configure  )
EXPORT_SYMBOL_HDA ( snd_hda_codec_setup_stream  )
EXPORT_SYMBOL_HDA ( __snd_hda_codec_cleanup_stream  )
EXPORT_SYMBOL_HDA ( query_amp_caps  )
EXPORT_SYMBOL_HDA ( snd_hda_override_amp_caps  )
EXPORT_SYMBOL_HDA ( snd_hda_query_pin_caps  )
EXPORT_SYMBOL_HDA ( snd_hda_override_pin_caps  )
EXPORT_SYMBOL_HDA ( snd_hda_codec_amp_read  )
EXPORT_SYMBOL_HDA ( snd_hda_codec_amp_update  )
EXPORT_SYMBOL_HDA ( snd_hda_codec_amp_stereo  )
EXPORT_SYMBOL_HDA ( snd_hda_mixer_amp_volume_info  )
EXPORT_SYMBOL_HDA ( snd_hda_mixer_amp_volume_get  )
EXPORT_SYMBOL_HDA ( snd_hda_mixer_amp_volume_put  )
EXPORT_SYMBOL_HDA ( snd_hda_mixer_amp_tlv  )
EXPORT_SYMBOL_HDA ( snd_hda_set_vmaster_tlv  )
EXPORT_SYMBOL_HDA ( snd_hda_find_mixer_ctl  )
EXPORT_SYMBOL_HDA ( snd_hda_ctl_add  )
EXPORT_SYMBOL_HDA ( snd_hda_add_nid  )
EXPORT_SYMBOL_HDA ( snd_hda_lock_devices  )
EXPORT_SYMBOL_HDA ( snd_hda_unlock_devices  )
EXPORT_SYMBOL_HDA ( __snd_hda_add_vmaster  )
EXPORT_SYMBOL_HDA ( snd_hda_add_vmaster_hook  )
EXPORT_SYMBOL_HDA ( snd_hda_sync_vmaster_hook  )
EXPORT_SYMBOL_HDA ( snd_hda_mixer_amp_switch_info  )
EXPORT_SYMBOL_HDA ( snd_hda_mixer_amp_switch_get  )
EXPORT_SYMBOL_HDA ( snd_hda_mixer_amp_switch_put  )
EXPORT_SYMBOL_HDA ( snd_hda_mixer_bind_switch_get  )
EXPORT_SYMBOL_HDA ( snd_hda_mixer_bind_switch_put  )
EXPORT_SYMBOL_HDA ( snd_hda_mixer_bind_ctls_info  )
EXPORT_SYMBOL_HDA ( snd_hda_mixer_bind_ctls_get  )
EXPORT_SYMBOL_HDA ( snd_hda_mixer_bind_ctls_put  )
EXPORT_SYMBOL_HDA ( snd_hda_mixer_bind_tlv  )
EXPORT_SYMBOL_HDA ( snd_hda_bind_vol  )
EXPORT_SYMBOL_HDA ( snd_hda_bind_sw  )
EXPORT_SYMBOL_HDA ( snd_hda_create_spdif_out_ctls  )
EXPORT_SYMBOL_HDA ( snd_hda_spdif_out_of_nid  )
EXPORT_SYMBOL_HDA ( snd_hda_spdif_ctls_unassign  )
EXPORT_SYMBOL_HDA ( snd_hda_spdif_ctls_assign  )
EXPORT_SYMBOL_HDA ( snd_hda_create_spdif_share_sw  )
EXPORT_SYMBOL_HDA ( snd_hda_create_spdif_in_ctls  )
EXPORT_SYMBOL_HDA ( snd_hda_codec_set_power_to_all  )
EXPORT_SYMBOL_HDA ( snd_hda_build_controls  )
EXPORT_SYMBOL_HDA ( snd_hda_calc_stream_format  )
EXPORT_SYMBOL_HDA ( snd_hda_query_supported_pcm  )
EXPORT_SYMBOL_HDA ( snd_hda_is_supported_format  )
EXPORT_SYMBOL_HDA ( snd_hda_codec_prepare  )
EXPORT_SYMBOL_HDA ( snd_hda_codec_cleanup  )
EXPORT_SYMBOL_HDA ( snd_hda_build_pcms  )
EXPORT_SYMBOL_HDA ( snd_hda_check_board_config  )
EXPORT_SYMBOL_HDA ( snd_hda_check_board_codec_sid_config  )
EXPORT_SYMBOL_HDA ( snd_hda_add_new_ctls  )
EXPORT_SYMBOL_HDA ( snd_hda_ch_mode_info  )
EXPORT_SYMBOL_HDA ( snd_hda_ch_mode_get  )
EXPORT_SYMBOL_HDA ( snd_hda_ch_mode_put  )
EXPORT_SYMBOL_HDA ( snd_hda_input_mux_info  )
EXPORT_SYMBOL_HDA ( snd_hda_input_mux_put  )
EXPORT_SYMBOL_HDA ( snd_hda_bus_reboot_notify  )
EXPORT_SYMBOL_HDA ( snd_hda_multi_out_dig_open  )
EXPORT_SYMBOL_HDA ( snd_hda_multi_out_dig_prepare  )
EXPORT_SYMBOL_HDA ( snd_hda_multi_out_dig_cleanup  )
EXPORT_SYMBOL_HDA ( snd_hda_multi_out_dig_close  )
EXPORT_SYMBOL_HDA ( snd_hda_multi_out_analog_open  )
EXPORT_SYMBOL_HDA ( snd_hda_multi_out_analog_prepare  )
EXPORT_SYMBOL_HDA ( snd_hda_multi_out_analog_cleanup  )
EXPORT_SYMBOL_HDA ( snd_hda_get_default_vref  )
EXPORT_SYMBOL_HDA ( _snd_hda_set_pin_ctl  )
EXPORT_SYMBOL_HDA ( snd_hda_add_imux_item  )
EXPORT_SYMBOL_HDA ( snd_array_new  )
EXPORT_SYMBOL_HDA ( snd_array_free  )
EXPORT_SYMBOL_HDA ( snd_print_pcm_bits  )
MODULE_DESCRIPTION ( "HDA codec core )
MODULE_LICENSE ( "GPL"  )
u32 query_amp_caps ( struct hda_codec codec,
hda_nid_t  nid,
int  direction 
)

query_amp_caps - query AMP capabilities : the HD-auio codec : the NID to query : either HDA_INPUT or HDA_OUTPUT

Query AMP capabilities for the given widget and direction. Returns the obtained capability bits.

When cap bits have been already read, this doesn't read again but returns the cached value.

Definition at line 1714 of file hda_codec.c.

void snd_array_free ( struct snd_array array)

snd_array_free - free the given array elements : the array object

Definition at line 5204 of file hda_codec.c.

void* snd_array_new ( struct snd_array array)

snd_array_new - get a new element from the given array : the array object

Get a new element from the given array. If it exceeds the pre-allocated array size, re-allocate the array.

Returns NULL if allocation failed.

Definition at line 5178 of file hda_codec.c.

int snd_hda_add_codec_preset ( struct hda_codec_preset_list preset)

Definition at line 79 of file hda_codec.c.

int snd_hda_add_imux_item ( struct hda_input_mux imux,
const char label,
int  index,
int type_idx 
)

snd_hda_add_imux_item - Add an item to input_mux

When the same label is used already in the existing items, the number suffix is appended to the label. This label index number is stored to type_idx when non-NULL pointer is given.

Definition at line 5096 of file hda_codec.c.

int snd_hda_add_new_ctls ( struct hda_codec codec,
const struct snd_kcontrol_new knew 
)

snd_hda_add_new_ctls - create controls from the array : the HDA codec : the array of struct snd_kcontrol_new

This helper function creates and add new controls in the given array. The array must be terminated with an empty entry as terminator.

Returns 0 if successful, or a negative error code.

Definition at line 4432 of file hda_codec.c.

int snd_hda_add_nid ( struct hda_codec codec,
struct snd_kcontrol kctl,
unsigned int  index,
hda_nid_t  nid 
)

snd_hda_add_nid - Assign a NID to a control element : HD-audio codec : corresponding NID (optional) : the control element to assign : index to kctl

Add the given control element to an array inside the codec instance. This function is used when snd_hda_ctl_add cannot be used for 1:1 NID:KCTL mapping - for example "Capture Source" selector.

Definition at line 2252 of file hda_codec.c.

int snd_hda_add_pincfg ( struct hda_codec codec,
struct snd_array list,
hda_nid_t  nid,
unsigned int  cfg 
)

Definition at line 1012 of file hda_codec.c.

int snd_hda_add_vmaster_hook ( struct hda_codec codec,
struct hda_vmaster_mute_hook hook,
bool  expose_enum_ctl 
)

Definition at line 2605 of file hda_codec.c.

int snd_hda_build_controls ( struct hda_bus bus)

snd_hda_build_controls - build mixer controls : the BUS

Creates mixer controls for each codec included in the bus.

Returns 0 if successful, otherwise a negative error code.

Definition at line 3681 of file hda_codec.c.

int snd_hda_build_pcms ( struct hda_bus bus)

snd_hda_build_pcms - build PCM information : the BUS

Create PCM information for each codec included in the bus.

The build_pcms codec patch is requested to set up codec->num_pcms and codec->pcm_info properly. The array is referred by the top-level driver to create its PCM instances. The allocated codec->pcm_info should be released in codec->patch_ops.free callback.

At least, substreams, channels_min and channels_max must be filled for each stream. substreams = 0 indicates that the stream doesn't exist. When rates and/or formats are zero, the supported values are queried from the given nid. The nid is used also by the default ops.prepare and ops.cleanup callbacks.

The driver needs to call ops.open in its open callback. Similarly, ops.close is supposed to be called in the close callback. ops.prepare should be called in the prepare or hw_params callback with the proper parameters for set up. ops.cleanup should be called in hw_free for clean up of streams.

This function returns 0 if successful, or a negative error code.

Definition at line 4292 of file hda_codec.c.

int snd_hda_bus_new ( struct snd_card card,
const struct hda_bus_template temp,
struct hda_bus **  busp 
)

snd_hda_bus_new - create a HDA bus : the card entry : the template for hda_bus information : the pointer to store the created bus instance

Returns 0 if successful, or a negative error code.

Definition at line 741 of file hda_codec.c.

void snd_hda_bus_reboot_notify ( struct hda_bus bus)

snd_hda_bus_reboot_notify - call the reboot notifier of each codec : HD-audio bus

Definition at line 4815 of file hda_codec.c.

unsigned int snd_hda_calc_stream_format ( unsigned int  rate,
unsigned int  channels,
unsigned int  format,
unsigned int  maxbps,
unsigned short  spdif_ctls 
)

snd_hda_calc_stream_format - calculate format bitset : the sample rate : the number of channels : the PCM format (SNDRV_PCM_FORMAT_XXX) : the max. bps

Calculate the format bitset from the given rate, channels and th PCM format.

Return zero if invalid.

Definition at line 3802 of file hda_codec.c.

int snd_hda_ch_mode_get ( struct hda_codec codec,
struct snd_ctl_elem_value ucontrol,
const struct hda_channel_mode chmode,
int  num_chmodes,
int  max_channels 
)

snd_hda_ch_mode_get - Get callback helper for the channel mode enum

Definition at line 4680 of file hda_codec.c.

int snd_hda_ch_mode_info ( struct hda_codec codec,
struct snd_ctl_elem_info uinfo,
const struct hda_channel_mode chmode,
int  num_chmodes 
)

snd_hda_ch_mode_info - Info callback helper for the channel mode enum

Definition at line 4661 of file hda_codec.c.

int snd_hda_ch_mode_put ( struct hda_codec codec,
struct snd_ctl_elem_value ucontrol,
const struct hda_channel_mode chmode,
int  num_chmodes,
int max_channelsp 
)

snd_hda_ch_mode_put - Put callback helper for the channel mode enum

Definition at line 4701 of file hda_codec.c.

int snd_hda_check_board_codec_sid_config ( struct hda_codec codec,
int  num_configs,
const char *const models,
const struct snd_pci_quirk *  tbl 
)

snd_hda_check_board_codec_sid_config - compare the current codec subsystem ID with the config table

This is important for Gateway notebooks with SB450 HDA Audio where the vendor ID of the PCI device is: ATI Technologies Inc SB450 HDA Audio [1002:437b] and the vendor/subvendor are found only at the codec.

: the HDA codec : number of config enums : array of model name strings : configuration table, terminated by null entries

Compares the modelname or PCI subsystem id of the current codec with the given configuration table. If a matching entry is found, returns its config value (supposed to be 0 or positive).

If no entries are matching, the function returns a negative value.

Definition at line 4382 of file hda_codec.c.

int snd_hda_check_board_config ( struct hda_codec codec,
int  num_configs,
const char *const models,
const struct snd_pci_quirk *  tbl 
)

snd_hda_check_board_config - compare the current codec with the config table : the HDA codec : number of config enums : array of model name strings : configuration table, terminated by null entries

Compares the modelname or PCI subsystem id of the current codec with the given configuration table. If a matching entry is found, returns its config value (supposed to be 0 or positive).

If no entries are matching, the function returns a negative value.

Definition at line 4318 of file hda_codec.c.

int snd_hda_codec_amp_read ( struct hda_codec codec,
hda_nid_t  nid,
int  ch,
int  direction,
int  index 
)

snd_hda_codec_amp_read - Read AMP value : HD-audio codec : NID to read the AMP value : channel (left=0 or right=1) : HDA_INPUT or HDA_OUTPUT : the index value (only for input direction)

Read AMP value. The volume is between 0 to 0x7f, 0x80 = mute bit.

Definition at line 1848 of file hda_codec.c.

int snd_hda_codec_amp_stereo ( struct hda_codec codec,
hda_nid_t  nid,
int  direction,
int  idx,
int  mask,
int  val 
)

snd_hda_codec_amp_stereo - update the AMP stereo values : HD-audio codec : NID to read the AMP value : HDA_INPUT or HDA_OUTPUT : the index value (only for input direction) : bit mask to set : the bits value to set

Update the AMP values like snd_hda_codec_amp_update(), but for a stereo widget with the same mask and value.

Definition at line 1915 of file hda_codec.c.

int snd_hda_codec_amp_update ( struct hda_codec codec,
hda_nid_t  nid,
int  ch,
int  direction,
int  idx,
int  mask,
int  val 
)

snd_hda_codec_amp_update - update the AMP value : HD-audio codec : NID to read the AMP value : channel (left=0 or right=1) : HDA_INPUT or HDA_OUTPUT : the index value (only for input direction) : bit mask to set : the bits value to set

Update the AMP value with a bit mask. Returns 0 if the value is unchanged, 1 if changed.

Definition at line 1876 of file hda_codec.c.

int snd_hda_codec_build_controls ( struct hda_codec codec)

Definition at line 3732 of file hda_codec.c.

int snd_hda_codec_build_pcms ( struct hda_codec codec)

Definition at line 4222 of file hda_codec.c.

void snd_hda_codec_cleanup ( struct hda_codec codec,
struct hda_pcm_stream hinfo,
struct snd_pcm_substream substream 
)

Definition at line 4148 of file hda_codec.c.

int snd_hda_codec_configure ( struct hda_codec codec)

snd_hda_codec_configure - (Re-)configure the HD-audio codec : the HDA codec

Start parsing of the given codec tree and (re-)initialize the whole patch instance.

Returns 0 if successful or a negative error code.

Definition at line 1376 of file hda_codec.c.

unsigned int snd_hda_codec_get_pincfg ( struct hda_codec codec,
hda_nid_t  nid 
)

snd_hda_codec_get_pincfg - Obtain a pin-default configuration : the HDA codec : NID to get the pin config

Get the current pin config value of the given pin NID. If the pincfg value is cached or overridden via sysfs or driver, returns the cached value.

Definition at line 1066 of file hda_codec.c.

int snd_hda_codec_new ( struct hda_bus bus,
unsigned int  codec_addr,
struct hda_codec **  codecp 
)

snd_hda_codec_new - create a HDA codec : the bus to assign : the codec address : the pointer to store the generated codec

Returns 0 if successful, or a negative error code.

Definition at line 1238 of file hda_codec.c.

int snd_hda_codec_prepare ( struct hda_codec codec,
struct hda_pcm_stream hinfo,
unsigned int  stream,
unsigned int  format,
struct snd_pcm_substream substream 
)

Definition at line 4132 of file hda_codec.c.

unsigned int snd_hda_codec_read ( struct hda_codec codec,
hda_nid_t  nid,
int  direct,
unsigned int  verb,
unsigned int  parm 
)

snd_hda_codec_read - send a command and get the response : the HDA codec : NID to send the command : direct flag : the verb to send : the parameter for the verb

Send a single command and read the corresponding response.

Returns the obtained response value, or -1 for an error.

Definition at line 260 of file hda_codec.c.

int snd_hda_codec_reset ( struct hda_codec codec)

snd_hda_codec_reset - Clear all objects assigned to the codec : HD-audio codec

This frees the all PCM and control elements assigned to the codec, and clears the caches and restores the pin default configurations.

When a device is being used, it returns -EBSY. If successfully freed, returns zero.

Definition at line 2344 of file hda_codec.c.

int snd_hda_codec_set_pincfg ( struct hda_codec codec,
hda_nid_t  nid,
unsigned int  cfg 
)

snd_hda_codec_set_pincfg - Override a pin default configuration : the HDA codec : NID to set the pin config : the pin default config value

Override a pin default configuration value in the cache. This value can be read by snd_hda_codec_get_pincfg() in a higher priority than the real hardware value.

Definition at line 1050 of file hda_codec.c.

void snd_hda_codec_set_power_to_all ( struct hda_codec codec,
hda_nid_t  fg,
unsigned int  power_state,
bool  eapd_workaround 
)

Definition at line 3495 of file hda_codec.c.

void snd_hda_codec_setup_stream ( struct hda_codec codec,
hda_nid_t  nid,
u32  stream_tag,
int  channel_id,
int  format 
)

snd_hda_codec_setup_stream - set up the codec for streaming : the CODEC to set up : the NID to set up : stream tag to pass, it's between 0x1 and 0xf. : channel id to pass, zero based. : stream format.

Definition at line 1459 of file hda_codec.c.

int snd_hda_codec_write ( struct hda_codec codec,
hda_nid_t  nid,
int  direct,
unsigned int  verb,
unsigned int  parm 
)

snd_hda_codec_write - send a single command without waiting for response : the HDA codec : NID to send the command : direct flag : the verb to send : the parameter for the verb

Send a single command without waiting for response.

Returns 0 if successful, or a negative error code.

Definition at line 284 of file hda_codec.c.

int snd_hda_create_spdif_in_ctls ( struct hda_codec codec,
hda_nid_t  nid 
)

snd_hda_create_spdif_in_ctls - create Input SPDIF-related controls : the HDA codec : audio in widget NID

Creates controls related with the SPDIF input. Called from each patch supporting the SPDIF in.

Returns 0 if successful, or a negative error code.

Definition at line 3347 of file hda_codec.c.

int snd_hda_create_spdif_out_ctls ( struct hda_codec codec,
hda_nid_t  associated_nid,
hda_nid_t  cvt_nid 
)

snd_hda_create_spdif_out_ctls - create Output SPDIF-related controls : the HDA codec : audio out widget NID

Creates controls related with the SPDIF output. Called from each patch supporting the SPDIF out.

Returns 0 if successful, or a negative error code.

Definition at line 3147 of file hda_codec.c.

int snd_hda_create_spdif_share_sw ( struct hda_codec codec,
struct hda_multi_out mout 
)

snd_hda_create_spdif_share_sw - create Default PCM switch : the HDA codec : multi-out instance

Definition at line 3257 of file hda_codec.c.

int snd_hda_ctl_add ( struct hda_codec codec,
hda_nid_t  nid,
struct snd_kcontrol kctl 
)

snd_hda_ctl_add - Add a control element and assign to the codec : HD-audio codec : corresponding NID (optional) : the control element to assign

Add the given control element to an array inside the codec instance. All control elements belonging to a codec are supposed to be added by this function so that a proper clean-up works at the free or reconfiguration time.

If non-zero is passed, the NID is assigned to the control element. The assignment is shown in the codec proc file.

snd_hda_ctl_add() checks the control subdev id field whether HDA_SUBDEV_NID_FLAG bit is set. If set (and is zero), the lower bits value is taken as the NID to assign. The HDA_NID_ITEM_AMP bit specifies if kctl->private_value is a HDA amplifier value.

Definition at line 2212 of file hda_codec.c.

void snd_hda_ctls_clear ( struct hda_codec codec)

snd_hda_ctls_clear - Clear all controls assigned to the given codec : HD-audio codec

Definition at line 2276 of file hda_codec.c.

int snd_hda_delete_codec_preset ( struct hda_codec_preset_list preset)

Definition at line 88 of file hda_codec.c.

struct snd_kcontrol* snd_hda_find_mixer_ctl ( struct hda_codec codec,
const char name 
)
read

Definition at line 2176 of file hda_codec.c.

int snd_hda_get_conn_index ( struct hda_codec codec,
hda_nid_t  mux,
hda_nid_t  nid,
int  recursive 
)

snd_hda_get_conn_index - get the connection index of the given NID : the HDA codec : NID containing the list : NID to select : 1 when searching NID recursively, otherwise 0

Parses the connection list of the widget and checks whether the widget is present. If it is, return the connection index. Otherwise it returns -1.

Definition at line 575 of file hda_codec.c.

int snd_hda_get_connections ( struct hda_codec codec,
hda_nid_t  nid,
hda_nid_t conn_list,
int  max_conns 
)

snd_hda_get_connections - copy connection list : the HDA codec : NID to parse : connection list array; when NULL, checks only the size : max. number of connections to store

Parses the connection list of the given widget and stores the list of NIDs.

Returns the number of connections, or a negative error code.

Definition at line 369 of file hda_codec.c.

unsigned int snd_hda_get_default_vref ( struct hda_codec codec,
hda_nid_t  pin 
)

snd_hda_get_default_vref - Get the default (mic) VREF pin bits

Guess the suitable VREF pin bits to be set as the pin-control value. Note: the function doesn't set the AC_PINCTL_IN_EN bit.

Definition at line 5042 of file hda_codec.c.

const char* snd_hda_get_jack_connectivity ( u32  cfg)

snd_hda_get_jack_connectivity - Give a connectivity string of the jack : pin default config value

Parse the pin default config value and returns the string of the jack connectivity, i.e. external or internal connection.

Definition at line 155 of file hda_codec.c.

const char* snd_hda_get_jack_location ( u32  cfg)

snd_hda_get_jack_location - Give a location string of the jack : pin default config value

Parse the pin default config value and returns the string of the jack location, e.g. "Rear", "Front", etc.

Definition at line 121 of file hda_codec.c.

const char* snd_hda_get_jack_type ( u32  cfg)

snd_hda_get_jack_type - Give a type string of the jack : pin default config value

Parse the pin default config value and returns the string of the jack type, i.e. the purpose of the jack, such as Line-Out or CD.

Definition at line 170 of file hda_codec.c.

int snd_hda_get_raw_connections ( struct hda_codec codec,
hda_nid_t  nid,
hda_nid_t conn_list,
int  max_conns 
)

snd_hda_get_raw_connections - copy connection list without cache : the HDA codec : NID to parse : connection list array : max. number of connections to store

Like snd_hda_get_connections(), copy the connection list but without checking through the connection-list cache. Currently called only from hda_proc.c, so not exported.

Definition at line 419 of file hda_codec.c.

int snd_hda_get_sub_nodes ( struct hda_codec codec,
hda_nid_t  nid,
hda_nid_t start_id 
)

snd_hda_get_sub_nodes - get the range of sub nodes : the HDA codec : NID to parse : the pointer to store the start NID

Parse the NID and store the start NID of its sub-nodes. Returns the number of sub-nodes.

Definition at line 318 of file hda_codec.c.

int snd_hda_input_mux_info ( const struct hda_input_mux imux,
struct snd_ctl_elem_info uinfo 
)

snd_hda_input_mux_info_info - Info callback helper for the input-mux enum

Definition at line 4729 of file hda_codec.c.

int snd_hda_input_mux_put ( struct hda_codec codec,
const struct hda_input_mux imux,
struct snd_ctl_elem_value ucontrol,
hda_nid_t  nid,
unsigned int cur_val 
)

snd_hda_input_mux_info_put - Put callback helper for the input-mux enum

Definition at line 4750 of file hda_codec.c.

int snd_hda_is_supported_format ( struct hda_codec codec,
hda_nid_t  nid,
unsigned int  format 
)

snd_hda_is_supported_format - Check the validity of the format : HD-audio codec : NID to check : the HD-audio format value to check

Check whether the given node supports the format value.

Returns 1 if supported, 0 if not.

Definition at line 4013 of file hda_codec.c.

int snd_hda_lock_devices ( struct hda_bus bus)

Definition at line 2289 of file hda_codec.c.

int snd_hda_mixer_amp_switch_get ( struct snd_kcontrol kcontrol,
struct snd_ctl_elem_value ucontrol 
)

snd_hda_mixer_amp_switch_get - Get callback for a standard AMP mixer switch

The control element is supposed to have the private_value field set up via HDA_COMPOSE_AMP_VAL*() or related macros.

Definition at line 2670 of file hda_codec.c.

int snd_hda_mixer_amp_switch_info ( struct snd_kcontrol kcontrol,
struct snd_ctl_elem_info uinfo 
)

snd_hda_mixer_amp_switch_info - Info callback for a standard AMP mixer switch

The control element is supposed to have the private_value field set up via HDA_COMPOSE_AMP_VAL*() or related macros.

Definition at line 2651 of file hda_codec.c.

int snd_hda_mixer_amp_switch_put ( struct snd_kcontrol kcontrol,
struct snd_ctl_elem_value ucontrol 
)

snd_hda_mixer_amp_switch_put - Put callback for a standard AMP mixer switch

The control element is supposed to have the private_value field set up via HDA_COMPOSE_AMP_VAL*() or related macros.

Definition at line 2696 of file hda_codec.c.

int snd_hda_mixer_amp_tlv ( struct snd_kcontrol kcontrol,
int  op_flag,
unsigned int  size,
unsigned int __user _tlv 
)

snd_hda_mixer_amp_volume_put - TLV callback for a standard AMP mixer volume

The control element is supposed to have the private_value field set up via HDA_COMPOSE_AMP_VAL*() or related macros.

Definition at line 2094 of file hda_codec.c.

int snd_hda_mixer_amp_volume_get ( struct snd_kcontrol kcontrol,
struct snd_ctl_elem_value ucontrol 
)

snd_hda_mixer_amp_volume_get - Get callback for a standard AMP mixer volume

The control element is supposed to have the private_value field set up via HDA_COMPOSE_AMP_VAL*() or related macros.

Definition at line 2039 of file hda_codec.c.

int snd_hda_mixer_amp_volume_info ( struct snd_kcontrol kcontrol,
struct snd_ctl_elem_info uinfo 
)

snd_hda_mixer_amp_volume_info - Info callback for a standard AMP mixer

The control element is supposed to have the private_value field set up via HDA_COMPOSE_AMP_VAL*() or related macros.

Definition at line 1978 of file hda_codec.c.

int snd_hda_mixer_amp_volume_put ( struct snd_kcontrol kcontrol,
struct snd_ctl_elem_value ucontrol 
)

snd_hda_mixer_amp_volume_put - Put callback for a standard AMP mixer volume

The control element is supposed to have the private_value field set up via HDA_COMPOSE_AMP_VAL*() or related macros.

Definition at line 2064 of file hda_codec.c.

int snd_hda_mixer_bind_ctls_get ( struct snd_kcontrol kcontrol,
struct snd_ctl_elem_value ucontrol 
)

snd_hda_mixer_bind_ctls_get - Get callback for a generic bound control

The control element is supposed to have the private_value field set up via HDA_BIND_VOL() or HDA_BIND_SW() macros.

Definition at line 2815 of file hda_codec.c.

int snd_hda_mixer_bind_ctls_info ( struct snd_kcontrol kcontrol,
struct snd_ctl_elem_info uinfo 
)

snd_hda_mixer_bind_ctls_info - Info callback for a generic bound control

The control element is supposed to have the private_value field set up via HDA_BIND_VOL() or HDA_BIND_SW() macros.

Definition at line 2792 of file hda_codec.c.

int snd_hda_mixer_bind_ctls_put ( struct snd_kcontrol kcontrol,
struct snd_ctl_elem_value ucontrol 
)

snd_hda_mixer_bind_ctls_put - Put callback for a generic bound control

The control element is supposed to have the private_value field set up via HDA_BIND_VOL() or HDA_BIND_SW() macros.

Definition at line 2838 of file hda_codec.c.

int snd_hda_mixer_bind_switch_get ( struct snd_kcontrol kcontrol,
struct snd_ctl_elem_value ucontrol 
)

snd_hda_mixer_bind_switch_get - Get callback for a bound volume control

The control element is supposed to have the private_value field set up via HDA_BIND_MUTE*() macros.

Definition at line 2739 of file hda_codec.c.

int snd_hda_mixer_bind_switch_put ( struct snd_kcontrol kcontrol,
struct snd_ctl_elem_value ucontrol 
)

snd_hda_mixer_bind_switch_put - Put callback for a bound volume control

The control element is supposed to have the private_value field set up via HDA_BIND_MUTE*() macros.

Definition at line 2762 of file hda_codec.c.

int snd_hda_mixer_bind_tlv ( struct snd_kcontrol kcontrol,
int  op_flag,
unsigned int  size,
unsigned int __user tlv 
)

snd_hda_mixer_bind_tlv - TLV callback for a generic bound control

The control element is supposed to have the private_value field set up via HDA_BIND_VOL() macro.

Definition at line 2867 of file hda_codec.c.

int snd_hda_multi_out_analog_cleanup ( struct hda_codec codec,
struct hda_multi_out mout 
)

snd_hda_multi_out_analog_cleanup - clean up the setting for analog out

Definition at line 5008 of file hda_codec.c.

int snd_hda_multi_out_analog_open ( struct hda_codec codec,
struct hda_multi_out mout,
struct snd_pcm_substream substream,
struct hda_pcm_stream hinfo 
)

snd_hda_multi_out_analog_open - open analog outputs

Open analog outputs and set up the hw-constraints. If the digital outputs can be opened as slave, open the digital outputs, too.

Definition at line 4894 of file hda_codec.c.

int snd_hda_multi_out_analog_prepare ( struct hda_codec codec,
struct hda_multi_out mout,
unsigned int  stream_tag,
unsigned int  format,
struct snd_pcm_substream substream 
)

snd_hda_multi_out_analog_prepare - Preapre the analog outputs.

Set up the i/o for analog out. When the digital out is available, copy the front out to digital out, too.

Definition at line 4943 of file hda_codec.c.

int snd_hda_multi_out_dig_cleanup ( struct hda_codec codec,
struct hda_multi_out mout 
)

snd_hda_multi_out_dig_cleanup - clean-up the digital out stream

Definition at line 4864 of file hda_codec.c.

int snd_hda_multi_out_dig_close ( struct hda_codec codec,
struct hda_multi_out mout 
)

snd_hda_multi_out_dig_close - release the digital out stream

Definition at line 4877 of file hda_codec.c.

int snd_hda_multi_out_dig_open ( struct hda_codec codec,
struct hda_multi_out mout 
)

snd_hda_multi_out_dig_open - open the digital out in the exclusive mode

Definition at line 4832 of file hda_codec.c.

int snd_hda_multi_out_dig_prepare ( struct hda_codec codec,
struct hda_multi_out mout,
unsigned int  stream_tag,
unsigned int  format,
struct snd_pcm_substream substream 
)

snd_hda_multi_out_dig_prepare - prepare the digital out stream

Definition at line 4848 of file hda_codec.c.

int snd_hda_override_amp_caps ( struct hda_codec codec,
hda_nid_t  nid,
int  dir,
unsigned int  caps 
)

snd_hda_override_amp_caps - Override the AMP capabilities : the CODEC to clean up : the NID to clean up : either HDA_INPUT or HDA_OUTPUT : the capability bits to set

Override the cached AMP caps bits value by the given one. This function is useful if the driver needs to adjust the AMP ranges, e.g. limit to 0dB, etc.

Returns zero if successful or a negative error code.

Definition at line 1735 of file hda_codec.c.

int snd_hda_override_conn_list ( struct hda_codec codec,
hda_nid_t  nid,
int  len,
const hda_nid_t list 
)

snd_hda_override_conn_list - add/modify the connection-list to cache : the HDA codec : NID to parse : number of connection list entries : the list of connection entries

Add or modify the given connection-list to the cache. If the corresponding cache already exists, invalidate it and append a new one.

Returns zero or a negative error code.

Definition at line 536 of file hda_codec.c.

int snd_hda_override_pin_caps ( struct hda_codec codec,
hda_nid_t  nid,
unsigned int  caps 
)

snd_hda_override_pin_caps - Override the pin capabilities : the CODEC : the NID to override : the capability bits to set

Override the cached PIN capabilitiy bits value by the given one.

Returns zero if successful or a negative error code.

Definition at line 1776 of file hda_codec.c.

u32 snd_hda_query_pin_caps ( struct hda_codec codec,
hda_nid_t  nid 
)

snd_hda_query_pin_caps - Query PIN capabilities : the HD-auio codec : the NID to query

Query PIN capabilities for the given widget. Returns the obtained capability bits.

When cap bits have been already read, this doesn't read again but returns the cached value.

Definition at line 1759 of file hda_codec.c.

int snd_hda_query_supported_pcm ( struct hda_codec codec,
hda_nid_t  nid,
u32 ratesp,
u64 formatsp,
unsigned int bpsp 
)

snd_hda_query_supported_pcm - query the supported PCM rates and formats : the HDA codec : NID to query : the pointer to store the detected rate bitflags : the pointer to store the detected formats : the pointer to store the detected format widths

Queries the supported PCM rates and formats. The NULL , or argument is ignored.

Returns 0 if successful, otherwise a negative error code.

Definition at line 3907 of file hda_codec.c.

int snd_hda_queue_unsol_event ( struct hda_bus bus,
u32  res,
u32  res_ex 
)

snd_hda_queue_unsol_event - add an unsolicited event to queue : the BUS : unsolicited event (lower 32bit of RIRB entry) : codec addr and flags (upper 32bit or RIRB entry)

Adds the given event to the queue. The events are processed in the workqueue asynchronously. Call this function in the interrupt hanlder when RIRB receives an unsolicited event.

Returns 0 if successful, or a negative error code.

Definition at line 615 of file hda_codec.c.

void snd_hda_sequence_write ( struct hda_codec codec,
const struct hda_verb seq 
)

snd_hda_sequence_write - sequence writes : the HDA codec : VERB array to send

Send the commands sequentially from the given array. The array must be terminated with NID=0.

Definition at line 302 of file hda_codec.c.

void snd_hda_set_vmaster_tlv ( struct hda_codec codec,
hda_nid_t  nid,
int  dir,
unsigned int tlv 
)

Definition at line 2137 of file hda_codec.c.

void snd_hda_shutup_pins ( struct hda_codec codec)

snd_hda_shutup_pins - Shut up all pins : the HDA codec

Clear all pin controls to shup up before suspend for avoiding click noise. The controls aren't cached so that they can be resumed properly.

Definition at line 1103 of file hda_codec.c.

void snd_hda_spdif_ctls_assign ( struct hda_codec codec,
int  idx,
hda_nid_t  nid 
)

Definition at line 3209 of file hda_codec.c.

void snd_hda_spdif_ctls_unassign ( struct hda_codec codec,
int  idx 
)

Definition at line 3198 of file hda_codec.c.

struct hda_spdif_out* snd_hda_spdif_out_of_nid ( struct hda_codec codec,
hda_nid_t  nid 
)
read

Definition at line 3184 of file hda_codec.c.

void snd_hda_sync_vmaster_hook ( struct hda_vmaster_mute_hook hook)

Definition at line 2629 of file hda_codec.c.

void snd_hda_unlock_devices ( struct hda_bus bus)

Definition at line 2323 of file hda_codec.c.

void snd_print_pcm_bits ( int  pcm,
char buf,
int  buflen 
)

snd_print_pcm_bits - Print the supported PCM fmt bits to the string buffer : PCM caps bits : the string buffer to write : the max buffer length

used by hda_proc.c and hda_eld.c

Definition at line 5221 of file hda_codec.c.

Variable Documentation

struct hda_ctl_ops snd_hda_bind_sw
Initial value:

Definition at line 2892 of file hda_codec.c.

struct hda_ctl_ops snd_hda_bind_vol
Initial value:

Definition at line 2884 of file hda_codec.c.

const char* snd_hda_pcm_type_name[HDA_PCM_NTYPES]
Initial value:
= {
"Audio", "SPDIF", "HDMI", "Modem"
}

Definition at line 4159 of file hda_codec.c.