Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | sound/pci/hda/hda_codec.c |
static int snd_hda_spdif_out_switch_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
int idx = kcontrol->private_value;
struct hda_spdif_out *spdif;
if (WARN_ON(codec->spdif_out.used <= idx)... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_codec.c | void snd_hda_spdif_ctls_unassign(struct hda_codec *codec, int idx) {
struct hda_spdif_out *spdif;
if (WARN_ON(codec->spdif_out.used <= idx))
return;
mutex_lock(&codec->spdif_mutex);
spdif = snd_array_elem(&codec->spdif_out, idx);
spdif->nid = (u16)-1;
mutex_unlock(&codec->spdif_mutex);
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_codec.c | void snd_hda_spdif_ctls_assign(struct hda_codec *codec, int idx,
hda_nid_t nid) {
struct hda_spdif_out *spdif;
unsigned short val;
if (WARN_ON(codec->spdif_out.used <= idx))
return;
mutex_lock(&codec->spdif_mutex);
spdif = snd_array_elem(&codec->spdif_out, idx);
if (spdif... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_codec.c | static int spdif_share_sw_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct hda_multi_out *mout = snd_kcontrol_chip(kcontrol);
ucontrol->value.integer.value[0] = mout->share_spdif;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_codec.c |
static int spdif_share_sw_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct hda_multi_out *mout = snd_kcontrol_chip(kcontrol);
mout->share_spdif = !!ucontrol->value.integer.value[0];
return 0;
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_codec.c |
static int snd_hda_spdif_in_switch_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
hda_nid_t nid = kcontrol->private_value;
unsigned int val = !!ucontrol->value.integer.value[0];
int change;
... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_codec.c | static void hda_exec_init_verbs(struct hda_codec *codec) {
if (codec->init_verbs.list)
snd_hda_sequence_write(codec, codec->init_verbs.list);
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_codec.c | static void update_power_acct(struct hda_codec *codec, bool on) {
unsigned long delta = jiffies - codec->power_jiffies;
if (on)
codec->power_on_acct += delta;
else
codec->power_off_acct += delta;
codec->power_jiffies += delta;
} | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_codec.c |
void snd_hda_update_power_acct(struct hda_codec *codec) {
update_power_acct(codec, hda_codec_is_power_on(codec));
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_codec.c | static void hda_call_codec_resume(struct hda_codec *codec) {
snd_hdac_enter_pm(&codec->core);
if (codec->core.regmap)
regcache_mark_dirty(codec->core.regmap);
codec->power_jiffies = jiffies;
hda_set_power_state(codec, AC_PWRST_D0);
restore_shutup_pins(codec);
hda_exec_init_verbs(codec);
snd_hda_jack... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_codec.c |
static int hda_codec_pm_restore(struct device *dev) {
dev->power.power_state = PMSG_RESTORE;
return pm_runtime_force_resume(dev);
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_codec.c |
static int hda_pcm_default_prepare(struct hda_pcm_stream *hinfo,
struct hda_codec *codec,
unsigned int stream_tag, unsigned int format,
struct snd_pcm_substream *substream) {
snd_hda_codec_setup_stream(codec, hin... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_codec.c | static int get_empty_pcm_device(struct hda_bus *bus, unsigned int type) {
/* assigned to static slots up to dev#10; if more needed, assign
* the later slot dynamically (when CONFIG_SND_DYNAMIC_MINORS=y)
*/
static const int audio_idx[HDA_PCM_NTYPES][5] = {
[HDA_PCM_TYPE_AUDIO] = {0, 2, 4, 5, -1},
... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_codec.c | int snd_hda_codec_build_pcms(struct hda_codec *codec) {
struct hda_bus *bus = codec->bus;
struct hda_pcm *cpcm;
int dev, err;
err = snd_hda_codec_parse_pcms(codec);
if (err < 0)
return err;
list_for_each_entry(cpcm, &codec->pcm_list_head, list) {
if (cpcm->pcm)
continue; /* already attached ... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_codec.c | void snd_hda_codec_set_power_save(struct hda_codec *codec, int delay) {
struct device *dev = hda_codec_dev(codec);
if (delay == 0 && codec->auto_runtime_pm)
delay = 3000;
if (delay > 0) {
pm_runtime_set_autosuspend_delay(dev, delay);
pm_runtime_use_autosuspend(dev);
pm_runtime_allow(dev);
if... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_codec.c | int snd_hda_check_amp_list_power(struct hda_codec *codec,
struct hda_loopback_check *check,
hda_nid_t nid) {
const struct hda_amp_list *p;
int ch, v;
if (!check->amplist)
return 0;
for (p = check->amplist; p->nid; p++) {
if (p->nid == ni... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_codec.c | int snd_hda_enum_helper_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo, int num_items,
const char *const *texts) {
static const char *const texts_default[] = {"Disabled", "Enabled"};
if (!texts || !num_items) {
num_items = 2;
te... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_codec.c |
static void cleanup_dig_out_stream(struct hda_codec *codec, hda_nid_t nid) {
snd_hda_codec_cleanup_stream(codec, nid);
if (codec->follower_dig_outs) {
const hda_nid_t *d;
for (d = codec->follower_dig_outs; *d; d++)
snd_hda_codec_cleanup_stream(codec, *d);
}
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_codec.c | int snd_hda_multi_out_dig_close(struct hda_codec *codec,
struct hda_multi_out *mout) {
mutex_lock(&codec->spdif_mutex);
mout->dig_out_used = 0;
mutex_unlock(&codec->spdif_mutex);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_codec.c | unsigned int snd_hda_get_default_vref(struct hda_codec *codec, hda_nid_t pin) {
unsigned int pincap;
unsigned int oldval;
oldval = snd_hda_codec_read(codec, pin, 0, AC_VERB_GET_PIN_WIDGET_CONTROL, 0);
pincap = snd_hda_query_pin_caps(codec, pin);
pincap = (pincap & AC_PINCAP_VREF) >> AC_PINCAP_VREF_SHIFT;
i... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_codec.c | int _snd_hda_set_pin_ctl(struct hda_codec *codec, hda_nid_t pin,
unsigned int val, bool cached) {
val = snd_hda_correct_pin_ctl(codec, pin, val);
snd_hda_codec_set_pin_target(codec, pin, val);
if (cached)
return snd_hda_codec_write_cache(codec, pin, 0,
... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_codec.c | int snd_hda_add_imux_item(struct hda_codec *codec, struct hda_input_mux *imux,
const char *label, int index, int *type_idx) {
int i, label_idx = 0;
if (imux->num_items >= HDA_MAX_NUM_INPUTS) {
codec_err(codec, "hda_codec: Too many imux items!\n");
return -EINVAL;
}
for (i = 0; ... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_codec.c | void snd_print_pcm_bits(int pcm, char *buf, int buflen) {
static const unsigned int bits[] = {8, 16, 20, 24, 32};
int i, j;
for (i = 0, j = 0; i < ARRAY_SIZE(bits); i++)
if (pcm & (AC_SUPPCM_BITS_8 << i))
j += scnprintf(buf + j, buflen - j, " %d", bits[i]);
buf[j] = '\0';
} | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_controller.c | static inline struct azx_dev *
azx_assign_device(struct azx *chip, struct snd_pcm_substream *substream) {
struct hdac_stream *s;
s = snd_hdac_stream_assign(azx_bus(chip), substream);
if (!s)
return NULL;
return stream_to_azx_dev(s);
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_controller.c |
static inline struct hda_pcm_stream *
to_hda_pcm_stream(struct snd_pcm_substream *substream) {
struct azx_pcm *apcm = snd_pcm_substream_chip(substream);
return &apcm->info->stream[substream->stream];
} | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_controller.c | static int azx_pcm_prepare(struct snd_pcm_substream *substream) {
struct azx_pcm *apcm = snd_pcm_substream_chip(substream);
struct azx *chip = apcm->chip;
struct azx_dev *azx_dev = get_azx_dev(substream);
struct hda_pcm_stream *hinfo = to_hda_pcm_stream(substream);
struct snd_pcm_runtime *runtime = substream-... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_controller.c |
static void azx_pcm_free(struct snd_pcm *pcm) {
struct azx_pcm *apcm = pcm->private_data;
if (apcm) {
list_del(&apcm->list);
apcm->info->pcm = NULL;
kfree(apcm);
}
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_controller.c | static int azx_single_wait_for_response(struct azx *chip, unsigned int addr) {
int timeout = 50;
while (timeout--) {
if (azx_readw(chip, IRS) & AZX_IRS_VALID) {
/* reuse rirb.res as the response return value */
azx_bus(chip)->rirb.res[addr] = azx_readl(chip, IR);
return 0;
}
udelay(1... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_controller.c | static int azx_send_cmd(struct hdac_bus *bus, unsigned int val) {
struct azx *chip = bus_to_azx(bus);
if (chip->disabled)
return 0;
if (chip->single_cmd)
return azx_single_send_cmd(bus, val);
else
return snd_hdac_bus_send_cmd(bus, val);
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_controller.c |
int snd_hda_codec_load_dsp_prepare(struct hda_codec *codec, unsigned int format,
unsigned int byte_size,
struct snd_dma_buffer *bufp) {
struct hdac_bus *bus = &codec->bus->core;
struct azx *chip = bus_to_azx(bus);
struct azx_dev *azx_dev;
st... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_controller.c |
void snd_hda_codec_load_dsp_cleanup(struct hda_codec *codec,
struct snd_dma_buffer *dmab) {
struct hdac_bus *bus = &codec->bus->core;
struct azx *chip = bus_to_azx(bus);
struct azx_dev *azx_dev = azx_get_dsp_loader_dev(chip);
struct hdac_stream *hstr = azx_stream(azx_dev);
... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_controller.c |
void azx_stop_chip(struct azx *chip) { snd_hdac_bus_stop_chip(azx_bus(chip)); } | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_controller.c | int azx_codec_configure(struct azx *chip) {
struct hda_codec *codec, *next;
int success = 0;
list_for_each_codec(codec, &chip->bus) {
if (!snd_hda_codec_configure(codec))
success++;
}
if (success) {
list_for_each_codec_safe(codec, next, &chip->bus) {
if (!codec->configured) {
co... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_controller.c |
static int stream_direction(struct azx *chip, unsigned char index) {
if (index >= chip->capture_index_offset &&
index < chip->capture_index_offset + chip->capture_streams)
return SNDRV_PCM_STREAM_CAPTURE;
return SNDRV_PCM_STREAM_PLAYBACK;
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_controller.c |
void azx_free_streams(struct azx *chip) {
struct hdac_bus *bus = azx_bus(chip);
struct hdac_stream *s;
while (!list_empty(&bus->stream_list)) {
s = list_first_entry(&bus->stream_list, struct hdac_stream, list);
list_del(&s->list);
kfree(stream_to_azx_dev(s));
}
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_cs_dsp_ctl.c |
static unsigned int wmfw_convert_flags(unsigned int in) {
unsigned int out, rd, wr, vol;
rd = SNDRV_CTL_ELEM_ACCESS_READ;
wr = SNDRV_CTL_ELEM_ACCESS_WRITE;
vol = SNDRV_CTL_ELEM_ACCESS_VOLATILE;
out = 0;
if (in) {
out |= rd;
if (in & WMFW_CTL_FLAG_WRITEABLE)
out |= wr;
if (in & WMFW_CTL... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_cs_dsp_ctl.c |
int hda_cs_dsp_read_ctl(struct cs_dsp *dsp, const char *name, int type,
unsigned int alg, void *buf, size_t len) {
int ret;
mutex_lock(&dsp->pwr_lock);
ret =
cs_dsp_coeff_read_ctrl(cs_dsp_get_ctl(dsp, name, type, alg), 0, buf, len);
mutex_unlock(&dsp->pwr_lock);
return ret;
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_eld.c |
static void hdmi_print_sad_info(int i, struct cea_sad *a,
struct snd_info_buffer *buffer) {
char buf[SND_PRINT_RATES_ADVISED_BUFSIZE];
snd_iprintf(buffer, "sad%d_coding_type\t[0x%x] %s\n", i, a->format,
cea_audio_coding_type_names[a->format]);
snd_iprintf(buffer, "s... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c | static inline void restore_pin_ctl(struct hda_codec *codec, hda_nid_t pin) {
update_pin_ctl(codec, pin, snd_hda_codec_get_pin_target(codec, pin));
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c | static int find_idx_in_nid_list(hda_nid_t nid, const hda_nid_t *list,
int nums) {
int i;
for (i = 0; i < nums; i++)
if (list[i] == nid)
return i;
return -1;
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c | static bool is_dac_already_used(struct hda_codec *codec, hda_nid_t nid) {
struct hda_gen_spec *spec = codec->spec;
const struct nid_path *path;
int i;
snd_array_for_each(&spec->paths, i, path) {
if (path->path[0] == nid)
return true;
}
return false;
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c | static bool is_ctl_used(struct hda_codec *codec, unsigned int val, int type) {
struct hda_gen_spec *spec = codec->spec;
const struct nid_path *path;
int i;
val &= AMP_VAL_COMPARE_MASK;
snd_array_for_each(&spec->paths, i, path) {
if ((path->ctls[type] & AMP_VAL_COMPARE_MASK) == val)
return true;
}... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c |
static void print_nid_path(struct hda_codec *codec, const char *pfx,
struct nid_path *path) {
char buf[40];
char *pos = buf;
int i;
*pos = 0;
for (i = 0; i < path->depth; i++)
pos += scnprintf(pos, sizeof(buf) - (pos - buf), "%s%02x",
pos != buf ? ":" : ""... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c | static bool has_amp_out(struct hda_codec *codec, struct nid_path *path,
int idx) {
hda_nid_t nid = path->path[idx];
unsigned int caps = get_wcaps(codec, nid);
unsigned int type = get_wcaps_type(caps);
if (!(caps & AC_WCAP_OUT_AMP))
return false;
if (type == AC_WID_PIN && !idx)
... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c | static bool is_active_nid(struct hda_codec *codec, hda_nid_t nid,
unsigned int dir, unsigned int idx) {
struct hda_gen_spec *spec = codec->spec;
int type = get_wcaps_type(get_wcaps(codec, nid));
const struct nid_path *path;
int i, n;
if (nid == codec->core.afg)
return true;
s... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c | static bool is_stereo_amps(struct hda_codec *codec, hda_nid_t nid, int dir) {
unsigned int wcaps = get_wcaps(codec, nid);
hda_nid_t conn;
if (wcaps & AC_WCAP_STEREO)
return true;
if (dir != HDA_INPUT || get_wcaps_type(wcaps) != AC_WID_AUD_MIX)
return false;
if (snd_hda_get_num_conns(codec, nid) != 1)... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c | static void init_amp(struct hda_codec *codec, hda_nid_t nid, int dir, int idx) {
unsigned int caps = query_amp_caps(codec, nid, dir);
int val = get_amp_val_to_activate(codec, nid, dir, caps, false);
if (is_stereo_amps(codec, nid, dir))
snd_hda_codec_amp_init_stereo(codec, nid, dir, idx, 0xff, val);
else
... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c |
static void activate_amp(struct hda_codec *codec, hda_nid_t nid, int dir,
int idx, int idx_to_check, bool enable) {
unsigned int caps;
unsigned int mask, val;
caps = query_amp_caps(codec, nid, dir);
val = get_amp_val_to_activate(codec, nid, dir, caps, enable);
mask = get_amp_mask_to... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c | static void sync_power_state_change(struct hda_codec *codec, hda_nid_t nid) {
if (nid) {
msleep(10);
snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_POWER_STATE, 0);
}
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c | void snd_hda_activate_path(struct hda_codec *codec, struct nid_path *path,
bool enable, bool add_aamix) {
struct hda_gen_spec *spec = codec->spec;
int i;
path->active = enable;
if (enable && (spec->power_down_unused || codec->power_save_node))
path_power_update(codec, path, code... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c | static void set_pin_eapd(struct hda_codec *codec, hda_nid_t pin, bool enable) {
struct hda_gen_spec *spec = codec->spec;
if (spec->own_eapd_ctl ||
!(snd_hda_query_pin_caps(codec, pin) & AC_PINCAP_EAPD))
return;
if (spec->keep_eapd_on && !enable)
return;
if (codec->inv_eapd)
enable = !enable;
... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c | static void resume_path_from_idx(struct hda_codec *codec, int path_idx) {
struct nid_path *path = snd_hda_get_path_from_idx(codec, path_idx);
if (path)
snd_hda_activate_path(codec, path, path->active, false);
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c | static struct snd_kcontrol_new *add_control(struct hda_gen_spec *spec, int type,
const char *name, int cidx,
unsigned long val) {
struct snd_kcontrol_new *knew;
knew = snd_hda_gen_add_kctl(spec, name, &control_templates[type]);... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c | static int hda_gen_bind_mute_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
unsigned long pval;
int err;
mutex_lock(&codec->control_mutex);
pval = kcontrol->private_value;
kcontrol->private_va... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c | static int assign_out_path_ctls(struct hda_codec *codec,
struct nid_path *path) {
struct hda_gen_spec *spec = codec->spec;
hda_nid_t nid;
unsigned int val;
int badness = 0;
if (!path)
return BAD_SHARED_VOL * 2;
if (path->ctls[NID_PATH_VOL_CTL] || path->ctls[NID_PATH_MUT... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c | static hda_nid_t get_primary_out(struct hda_codec *codec, int idx) {
struct hda_gen_spec *spec = codec->spec;
struct auto_pin_cfg *cfg = &spec->autocfg;
if (cfg->line_outs > idx)
return spec->private_dac_nids[idx];
idx -= cfg->line_outs;
if (spec->multi_ios > idx)
return spec->multi_io[idx].dac;
re... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c | static int count_multiio_pins(struct hda_codec *codec,
hda_nid_t reference_pin) {
struct hda_gen_spec *spec = codec->spec;
struct auto_pin_cfg *cfg = &spec->autocfg;
unsigned int defcfg = snd_hda_codec_get_pincfg(codec, reference_pin);
unsigned int location = get_defcfg_location(de... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c | static int create_extra_outs(struct hda_codec *codec, int num_pins,
const int *paths, const char *pfx) {
int i;
for (i = 0; i < num_pins; i++) {
const char *name;
char tmp[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
int err, idx = 0;
if (num_pins == 2 && i == 1 && !strcmp(pfx, "Sp... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c | static int indep_hp_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
struct hda_gen_spec *spec = codec->spec;
unsigned int select = ucontrol->value.enumerated.item[0];
int ret = 0;
mutex_lock(&spec->pcm_mu... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c |
static int ch_mode_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
struct hda_gen_spec *spec = codec->spec;
ucontrol->value.enumerated.item[0] =
(spec->ext_channel_count - spec->min_channel_count) / 2;
... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c |
static int ch_mode_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
struct hda_gen_spec *spec = codec->spec;
int i, ch;
ch = ucontrol->value.enumerated.item[0];
if (ch < 0 || ch > spec->multi_ios)
retu... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c |
static int loopback_mixing_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
struct hda_gen_spec *spec = codec->spec;
ucontrol->value.enumerated.item[0] = spec->aamix_mode;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c |
static int create_loopback_mixing_ctl(struct hda_codec *codec) {
struct hda_gen_spec *spec = codec->spec;
if (!spec->mixer_nid)
return 0;
if (!snd_hda_gen_add_kctl(spec, NULL, &loopback_mixing_enum))
return -ENOMEM;
spec->have_aamix_ctl = 1;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c | static int create_out_jack_modes(struct hda_codec *codec, int num_pins,
hda_nid_t *pins) {
struct hda_gen_spec *spec = codec->spec;
int i;
for (i = 0; i < num_pins; i++) {
hda_nid_t pin = pins[i];
if (pin == spec->hp_mic_pin)
continue;
if (get_out_jack_num_items... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c |
static int in_jack_mode_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
hda_nid_t nid = kcontrol->private_value;
unsigned int vref_caps = get_vref_caps(codec, nid);
unsigned int idx;
idx = snd_hda_co... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c | static int hp_mic_jack_mode_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo) {
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
hda_nid_t nid = kcontrol->private_value;
int out_jacks = get_out_jack_num_items(codec, nid);
int in_jacks = get_in_jack_num_i... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c |
static int get_cur_hp_mic_jack_mode(struct hda_codec *codec, hda_nid_t nid) {
int out_jacks = get_out_jack_num_items(codec, nid);
int in_jacks = get_in_jack_num_items(codec, nid);
unsigned int val = snd_hda_codec_get_pin_target(codec, nid);
int idx = 0;
if (val & PIN_OUT) {
if (out_jacks > 1 && val == P... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c |
static int hp_mic_jack_mode_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
hda_nid_t nid = kcontrol->private_value;
int out_jacks = get_out_jack_num_items(codec, nid);
int in_jacks = get_in_jack_nu... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c | static int new_analog_input(struct hda_codec *codec, int input_idx,
hda_nid_t pin, const char *ctlname, int ctlidx,
hda_nid_t mix_nid) {
struct hda_gen_spec *spec = codec->spec;
struct nid_path *path;
unsigned int mix_val, mute_val;
int err, idx;
if (!l... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c | static int fill_input_pin_labels(struct hda_codec *codec) {
struct hda_gen_spec *spec = codec->spec;
const struct auto_pin_cfg *cfg = &spec->autocfg;
int i;
for (i = 0; i < cfg->num_inputs; i++) {
hda_nid_t pin = cfg->inputs[i].pin;
const char *label;
int j, idx;
if (!is_input_pin(codec, pin))... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c | static int create_input_ctls(struct hda_codec *codec) {
struct hda_gen_spec *spec = codec->spec;
const struct auto_pin_cfg *cfg = &spec->autocfg;
hda_nid_t mixer = spec->mixer_nid;
int num_adcs;
int i, err;
unsigned int val;
num_adcs = fill_adc_nids(codec);
if (num_adcs < 0)
return 0;
err = fill... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c |
static int mux_enum_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
return mux_select(codec, adc_idx, ucontrol->value.enumerated.item[0]);
... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c |
static int cap_vol_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
return cap_put_caller(kcontrol, ucontrol, snd_hda_mixer_amp_volume_put,
NID_PATH_VOL_CTL);
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c | static int cap_single_sw_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
struct hda_gen_spec *spec = codec->spec;
int ret;
ret = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
if (ret < 0)
ret... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c | static int create_bind_cap_vol_ctl(struct hda_codec *codec, int idx,
unsigned int vol_ctl, unsigned int sw_ctl) {
struct hda_gen_spec *spec = codec->spec;
struct snd_kcontrol_new *knew;
if (vol_ctl) {
knew = snd_hda_gen_add_kctl(spec, NULL, &cap_vol_temp);
if (!knew)
... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c | static int create_mute_led_cdev(struct hda_codec *codec,
int (*callback)(struct led_classdev *,
enum led_brightness),
bool micmute) {
struct hda_gen_spec *spec = codec->spec;
struct led_classdev *cdev;
... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c | static void pin_power_up_callback(struct hda_codec *codec,
struct hda_jack_callback *jack) {
pin_power_callback(codec, jack, true);
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c | static void pin_power_down_callback(struct hda_codec *codec,
struct hda_jack_callback *jack) {
pin_power_callback(codec, jack, false);
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c | static void add_pin_power_ctls(struct hda_codec *codec, int num_pins,
const hda_nid_t *pins, bool on) {
int i;
hda_jack_callback_fn cb =
on ? pin_power_up_callback : pin_power_down_callback;
for (i = 0; i < num_pins && pins[i]; i++) {
if (is_jack_detectable(codec, pins[i]... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c | static void sync_pin_power_ctls(struct hda_codec *codec, int num_pins,
const hda_nid_t *pins) {
int i;
for (i = 0; i < num_pins && pins[i]; i++)
if (is_jack_detectable(codec, pins[i]))
set_pin_power_jack(codec, pins[i], -1);
} | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c | static int add_fake_paths(struct hda_codec *codec, hda_nid_t nid, int num_pins,
const hda_nid_t *pins) {
struct hda_gen_spec *spec = codec->spec;
struct nid_path *path;
int i;
for (i = 0; i < num_pins; i++) {
if (!pins[i])
break;
if (get_nid_path(codec, nid, pins[i], 0))... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c | static void do_automute(struct hda_codec *codec, int num_pins,
const hda_nid_t *pins, int *paths, bool mute) {
struct hda_gen_spec *spec = codec->spec;
int i;
for (i = 0; i < num_pins; i++) {
hda_nid_t nid = pins[i];
unsigned int val, oldval;
if (!nid)
break;
oldval... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c | static int automute_mode_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo) {
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
struct hda_gen_spec *spec = codec->spec;
static const char *const texts3[] = {"Disabled", "Speaker Only",
... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c |
static int playback_pcm_close(struct hda_pcm_stream *hinfo,
struct hda_codec *codec,
struct snd_pcm_substream *substream) {
struct hda_gen_spec *spec = codec->spec;
mutex_lock(&spec->pcm_mutex);
spec->active_streams &= ~(1 << STREAM_MULTI_OUT);
call_p... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c |
static int capture_pcm_open(struct hda_pcm_stream *hinfo,
struct hda_codec *codec,
struct snd_pcm_substream *substream) {
call_pcm_capture_hook(hinfo, codec, substream, HDA_GEN_PCM_ACT_OPEN);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c |
static int alt_playback_pcm_cleanup(struct hda_pcm_stream *hinfo,
struct hda_codec *codec,
struct snd_pcm_substream *substream) {
snd_hda_codec_cleanup_stream(codec, hinfo->nid);
call_pcm_playback_hook(hinfo, codec, substream, HDA_GEN_PCM_ACT_... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c | static void setup_pcm_stream(struct hda_pcm_stream *str,
const struct hda_pcm_stream *default_str,
const struct hda_pcm_stream *spec_str,
hda_nid_t nid) {
*str = *default_str;
if (nid)
str->nid = nid;
if (spec_str) {
if... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c | static void set_output_and_unmute(struct hda_codec *codec, int path_idx) {
struct nid_path *path;
hda_nid_t pin;
path = snd_hda_get_path_from_idx(codec, path_idx);
if (!path || !path->depth)
return;
pin = path->path[path->depth - 1];
restore_pin_ctl(codec, pin);
snd_hda_activate_path(codec, path, pat... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c |
static void init_aamix_paths(struct hda_codec *codec) {
struct hda_gen_spec *spec = codec->spec;
if (!spec->have_aamix_ctl)
return;
if (!has_aamix_out_paths(spec))
return;
update_aamix_paths(codec, spec->aamix_mode, spec->out_paths[0],
spec->aamix_out_paths[0], spec->autocfg.line_... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c | static void clear_unsol_on_unused_pins(struct hda_codec *codec) {
const struct hda_pincfg *pin;
int i;
snd_array_for_each(&codec->init_pins, i, pin) {
hda_nid_t nid = pin->nid;
if (is_jack_detectable(codec, nid) && !snd_hda_jack_tbl_get(codec, nid))
snd_hda_codec_write_cache(codec, nid, 0, AC_VERB_... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c | int snd_hda_gen_init(struct hda_codec *codec) {
struct hda_gen_spec *spec = codec->spec;
if (spec->init_hook)
spec->init_hook(codec);
if (!spec->skip_verbs)
snd_hda_apply_verbs(codec);
init_multi_out(codec);
init_extra_out(codec);
init_multi_io(codec);
init_aamix_paths(codec);
init_analog_inp... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c | void snd_hda_gen_free(struct hda_codec *codec) {
snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_FREE);
snd_hda_gen_spec_free(codec->spec);
kfree(codec->spec);
codec->spec = NULL;
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_generic.c | int snd_hda_gen_check_power_status(struct hda_codec *codec, hda_nid_t nid) {
struct hda_gen_spec *spec = codec->spec;
return snd_hda_check_amp_list_power(codec, &spec->loopback, nid);
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_hwdep.c | static int hda_hwdep_ioctl_compat(struct snd_hwdep *hw, struct file *file,
unsigned int cmd, unsigned long arg) {
return hda_hwdep_ioctl(hw, file, cmd, (unsigned long)compat_ptr(arg));
}
#endif | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_hwdep.c | int snd_hda_create_hwdep(struct hda_codec *codec) {
char hwname[16];
struct snd_hwdep *hwdep;
int err;
sprintf(hwname, "HDA Codec %d", codec->addr);
err = snd_hwdep_new(codec->card, hwname, codec->addr, &hwdep);
if (err < 0)
return err;
codec->hwdep = hwdep;
sprintf(hwdep->name, "HDA Codec %d", cod... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_intel.c | static void bxt_reduce_dma_latency(struct azx *chip) {
u32 val;
val = azx_readl(chip, VS_EM4L);
val &= (0x3 << 20);
azx_writel(chip, VS_EM4L, val);
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_intel.c | static int intel_ml_lctl_set_power(struct azx *chip, int state) {
struct hdac_bus *bus = azx_bus(chip);
u32 val;
int timeout;
val = readl(bus->mlcap + AZX_ML_BASE + AZX_REG_ML_LCTL);
val &= ~AZX_ML_LCTL_SPA;
val |= state << AZX_ML_LCTL_SPA_SHIFT;
writel(val, bus->mlcap + AZX_ML_BASE + AZX_REG_ML_LCTL);
... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_intel.c | static int azx_get_delay_from_lpib(struct azx *chip, struct azx_dev *azx_dev,
unsigned int pos) {
struct snd_pcm_substream *substream = azx_dev->core.substream;
int stream = substream->stream;
unsigned int lpib_pos = azx_get_pos_lpib(chip, azx_dev);
int delay;
if (stream ==... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_intel.c | static int azx_position_check(struct azx *chip, struct azx_dev *azx_dev) {
struct hda_intel *hda = container_of(chip, struct hda_intel, chip);
int ok;
ok = azx_position_ok(chip, azx_dev);
if (ok == 1) {
azx_dev->irq_pending = 0;
return ok;
} else if (ok == 0) {
azx_dev->irq_pending = 1;
sche... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_intel.c | static void azx_irq_pending_work(struct work_struct *work) {
struct hda_intel *hda =
container_of(work, struct hda_intel, irq_pending_work);
struct azx *chip = &hda->chip;
struct hdac_bus *bus = azx_bus(chip);
struct hdac_stream *s;
int pending, ok;
if (!hda->irq_pending_warned) {
dev_info(chip->... | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.