Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | sound/pci/es1938.c | static int snd_es1938_playback1_prepare(struct snd_pcm_substream *substream) {
struct es1938 *chip = snd_pcm_substream_chip(substream);
struct snd_pcm_runtime *runtime = substream->runtime;
int u, is8, mono;
unsigned int size = snd_pcm_lib_buffer_bytes(substream);
unsigned int count = snd_pcm_lib_period_bytes... | [
1,
0
] |
Linux Kernel | sound/pci/es1938.c |
static int snd_es1938_capture_copy_kernel(struct snd_pcm_substream *substream,
int channel, unsigned long pos,
void *dst, unsigned long count) {
struct snd_pcm_runtime *runtime = substream->runtime;
struct es1938 *chip = snd_pcm_su... | [
1,
0
] |
Linux Kernel | sound/pci/es1938.c |
static int snd_es1938_playback_close(struct snd_pcm_substream *substream) {
struct es1938 *chip = snd_pcm_substream_chip(substream);
switch (substream->number) {
case 0:
chip->playback1_substream = NULL;
break;
case 1:
chip->playback2_substream = NULL;
break;
default:
snd_BUG();
retu... | [
0,
0
] |
Linux Kernel | sound/pci/es1938.c |
static int snd_es1938_info_single(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo) {
int mask = (kcontrol->private_value >> 16) & 0xff;
uinfo->type =
mask == 1 ? SNDRV_CTL_ELEM_TYPE_BOOLEAN : SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 1;
uinfo->value.int... | [
1,
0
] |
Linux Kernel | sound/pci/es1938.c |
static int snd_es1938_get_double(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct es1938 *chip = snd_kcontrol_chip(kcontrol);
int left_reg = kcontrol->private_value & 0xff;
int right_reg = (kcontrol->private_value >> 8) & 0xff;
int shift_left = (kcon... | [
1,
0
] |
Linux Kernel | sound/pci/es1938.c | static int es1938_resume(struct device *dev) {
struct pci_dev *pci = to_pci_dev(dev);
struct snd_card *card = dev_get_drvdata(dev);
struct es1938 *chip = card->private_data;
const unsigned char *s;
unsigned char *d;
if (request_irq(pci->irq, snd_es1938_interrupt, IRQF_SHARED, KBUILD_MODNAME,
... | [
0,
0
] |
Linux Kernel | sound/pci/es1938.c | static int snd_es1938_create_gameport(struct es1938 *chip) {
struct gameport *gp;
chip->gameport = gp = gameport_allocate_port();
if (!gp) {
dev_err(chip->card->dev, "cannot allocate memory for gameport\n");
return -ENOMEM;
}
gameport_set_name(gp, "ES1938");
gameport_set_phys(gp, "pci%s/gameport0"... | [
0,
0
] |
Linux Kernel | sound/pci/es1968.c | static void __apu_set_register(struct es1968 *chip, u16 channel, u8 reg,
u16 data) {
if (snd_BUG_ON(channel >= NR_APUS))
return;
#ifdef CONFIG_PM_SLEEP
chip->apu_map[channel][reg] = data;
#endif
reg |= (channel << 4);
apu_index_set(chip, reg);
apu_data_set(chip, data);
} | [
0,
0
] |
Linux Kernel | sound/pci/es1968.c | static u16 apu_get_register(struct es1968 *chip, u16 channel, u8 reg) {
unsigned long flags;
u16 v;
spin_lock_irqsave(&chip->reg_lock, flags);
v = __apu_get_register(chip, channel, reg);
spin_unlock_irqrestore(&chip->reg_lock, flags);
return v;
}
#if 0
static void assp_set_register(struct es1968 *chip, u... | [
0,
0
] |
Linux Kernel | sound/pci/es1968.c | static void snd_es1968_bob_start(struct es1968 *chip) {
int prescale;
int divide;
/* first, find best prescaler value to match freq */
for (prescale = 5; prescale < 12; prescale++)
if (chip->bob_freq > (ESS_SYSCLK >> (prescale + 9)))
break;
/* next, back off prescaler whilst getting divider into o... | [
1,
0
] |
Linux Kernel | sound/pci/es1968.c | static void snd_es1968_bob_dec(struct es1968 *chip) {
chip->bobclient--;
if (chip->bobclient <= 0)
snd_es1968_bob_stop(chip);
else if (chip->bob_freq > ESM_BOB_FREQ) {
int max_freq = ESM_BOB_FREQ;
struct esschan *es;
list_for_each_entry(es, &chip->substream_list, list) {
if (max_freq < es->... | [
0,
0
] |
Linux Kernel | sound/pci/es1968.c | static int snd_es1968_calc_bob_rate(struct es1968 *chip, struct esschan *es,
struct snd_pcm_runtime *runtime) {
int freq = runtime->rate * 4;
if (es->fmt & ESS_FMT_STEREO)
freq <<= 1;
if (es->fmt & ESS_FMT_16BIT)
freq <<= 1;
freq /= es->frag_size;
if (freq < ESM_BO... | [
1,
0
] |
Linux Kernel | sound/pci/es1968.c |
static void snd_es1968_pcm_start(struct es1968 *chip, struct esschan *es) {
spin_lock(&chip->reg_lock);
__apu_set_register(chip, es->apu[0], 5, es->base[0]);
snd_es1968_trigger_apu(chip, es->apu[0], es->apu_mode[0]);
if (es->mode == ESM_MODE_CAPTURE) {
__apu_set_register(chip, es->apu[2], 5, es->base[2]);
... | [
0,
0
] |
Linux Kernel | sound/pci/es1968.c |
static void snd_es1968_pcm_stop(struct es1968 *chip, struct esschan *es) {
spin_lock(&chip->reg_lock);
snd_es1968_trigger_apu(chip, es->apu[0], 0);
snd_es1968_trigger_apu(chip, es->apu[1], 0);
if (es->mode == ESM_MODE_CAPTURE) {
snd_es1968_trigger_apu(chip, es->apu[2], 0);
snd_es1968_trigger_apu(chip, ... | [
0,
0
] |
Linux Kernel | sound/pci/es1968.c | static void init_capture_apu(struct es1968 *chip, struct esschan *es,
int channel, unsigned int pa, unsigned int bsize,
int mode, int route) {
int i, apu = es->apu[channel];
es->apu_mode[channel] = mode;
snd_es1968_program_wavecache(chip, es, channel, pa... | [
1,
0
] |
Linux Kernel | sound/pci/es1968.c | static int snd_es1968_pcm_prepare(struct snd_pcm_substream *substream) {
struct es1968 *chip = snd_pcm_substream_chip(substream);
struct snd_pcm_runtime *runtime = substream->runtime;
struct esschan *es = runtime->private_data;
es->dma_size = snd_pcm_lib_buffer_bytes(substream);
es->frag_size = snd_pcm_lib_p... | [
1,
0
] |
Linux Kernel | sound/pci/es1968.c |
static snd_pcm_uframes_t
snd_es1968_pcm_pointer(struct snd_pcm_substream *substream) {
struct es1968 *chip = snd_pcm_substream_chip(substream);
struct esschan *es = substream->runtime->private_data;
unsigned int ptr;
ptr = snd_es1968_get_dma_ptr(chip, es) << es->wav_shift;
return bytes_to_frames(substream-... | [
1,
0
] |
Linux Kernel | sound/pci/es1968.c | static struct esm_memory *snd_es1968_new_memory(struct es1968 *chip, int size) {
struct esm_memory *buf;
size = ALIGN(size, ESM_MEM_ALIGN);
mutex_lock(&chip->memory_mutex);
list_for_each_entry(buf, &chip->buf_list, list) {
if (buf->empty && buf->buf.bytes >= size)
goto __found;
}
mutex_unlock(&ch... | [
1,
0
] |
Linux Kernel | sound/pci/es1968.c |
static void snd_es1968_free_dmabuf(struct es1968 *chip) {
struct list_head *p;
if (!chip->dma.area)
return;
snd_dma_free_pages(&chip->dma);
while ((p = chip->buf_list.next) != &chip->buf_list) {
struct esm_memory *chunk = list_entry(p, struct esm_memory, list);
list_del(p);
kfree(chunk);
}
} | [
0,
0
] |
Linux Kernel | sound/pci/es1968.c | static int snd_es1968_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *hw_params) {
struct es1968 *chip = snd_pcm_substream_chip(substream);
struct snd_pcm_runtime *runtime = substream->runtime;
struct esschan *chan = runtime->private_data;
int size = para... | [
1,
0
] |
Linux Kernel | sound/pci/es1968.c | static int snd_es1968_alloc_apu_pair(struct es1968 *chip, int type) {
int apu;
for (apu = 0; apu < NR_APUS; apu += 2) {
if (chip->apu[apu] == ESM_APU_FREE && chip->apu[apu + 1] == ESM_APU_FREE) {
chip->apu[apu] = chip->apu[apu + 1] = type;
return apu;
}
}
return -EBUSY;
} | [
1,
0
] |
Linux Kernel | sound/pci/es1968.c | static void snd_es1968_free_apu_pair(struct es1968 *chip, int apu) {
chip->apu[apu] = chip->apu[apu + 1] = ESM_APU_FREE;
} | [
1,
0
] |
Linux Kernel | sound/pci/es1968.c | static int snd_es1968_mixer(struct es1968 *chip) {
struct snd_ac97_bus *pbus;
struct snd_ac97_template ac97;
#ifndef CONFIG_SND_ES1968_INPUT
struct snd_ctl_elem_id elem_id;
#endif
int err;
static const struct snd_ac97_bus_ops ops = {
.write = snd_es1968_ac97_write,
.read = snd_es1968_ac97_read,
... | [
1,
0
] |
Linux Kernel | sound/pci/es1968.c | static void snd_es1968_reset(struct es1968 *chip) {
outw(ESM_RESET_MAESTRO | ESM_RESET_DIRECTSOUND,
chip->io_port + ESM_PORT_HOST_IRQ);
udelay(10);
outw(0x0000, chip->io_port + ESM_PORT_HOST_IRQ);
udelay(10);
} | [
0,
0
] |
Linux Kernel | sound/pci/es1968.c | static int es1968_suspend(struct device *dev) {
struct snd_card *card = dev_get_drvdata(dev);
struct es1968 *chip = card->private_data;
if (!chip->do_pm)
return 0;
chip->in_suspend = 1;
cancel_work_sync(&chip->hwvol_work);
snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
snd_ac97_suspend(chip->a... | [
0,
0
] |
Linux Kernel | sound/pci/es1968.c | static int es1968_resume(struct device *dev) {
struct snd_card *card = dev_get_drvdata(dev);
struct es1968 *chip = card->private_data;
struct esschan *es;
if (!chip->do_pm)
return 0;
snd_es1968_chip_init(chip);
if (chip->dma.addr) {
/* set PCMBAR */
wave_set_register(chip, 0x01FC, chip->dma.a... | [
1,
0
] |
Linux Kernel | sound/pci/es1968.c | static inline int snd_es1968_create_gameport(struct es1968 *chip, int dev) {
return -ENOSYS;
} | [
0,
0
] |
Linux Kernel | sound/pci/es1968.c | static inline void snd_es1968_free_gameport(struct es1968 *chip) {}
#endif
#ifdef CONFIG_SND_ES1968_INPUT | [
0,
0
] |
Linux Kernel | sound/pci/fm801.c | static bool fm801_ac97_is_ready(struct fm801 *chip, unsigned int iterations) {
unsigned int idx;
for (idx = 0; idx < iterations; idx++) {
if (!(fm801_readw(chip, AC97_CMD) & FM801_AC97_BUSY))
return true;
udelay(10);
}
return false;
} | [
0,
0
] |
Linux Kernel | sound/pci/fm801.c |
static bool fm801_ac97_is_valid(struct fm801 *chip, unsigned int iterations) {
unsigned int idx;
for (idx = 0; idx < iterations; idx++) {
if (fm801_readw(chip, AC97_CMD) & FM801_AC97_VALID)
return true;
udelay(10);
}
return false;
} | [
0,
0
] |
Linux Kernel | sound/pci/fm801.c |
static int snd_fm801_update_bits(struct fm801 *chip, unsigned short reg,
unsigned short mask, unsigned short value) {
int change;
unsigned long flags;
unsigned short old, new;
spin_lock_irqsave(&chip->reg_lock, flags);
old = fm801_ioread16(chip, reg);
new = (old & ~mask) |... | [
0,
0
] |
Linux Kernel | sound/pci/fm801.c | static void snd_fm801_codec_write(struct snd_ac97 *ac97, unsigned short reg,
unsigned short val) {
struct fm801 *chip = ac97->private_data;
if (!fm801_ac97_is_ready(chip, 100)) {
dev_err(chip->card->dev, "AC'97 interface is busy (1)\n");
return;
}
/* write data and ad... | [
1,
0
] |
Linux Kernel | sound/pci/fm801.c | static unsigned short snd_fm801_codec_read(struct snd_ac97 *ac97,
unsigned short reg) {
struct fm801 *chip = ac97->private_data;
if (!fm801_ac97_is_ready(chip, 100)) {
dev_err(chip->card->dev, "AC'97 interface is busy (1)\n");
return 0;
}
/* read command */
... | [
1,
0
] |
Linux Kernel | sound/pci/fm801.c |
static int snd_fm801_capture_prepare(struct snd_pcm_substream *substream) {
struct fm801 *chip = snd_pcm_substream_chip(substream);
struct snd_pcm_runtime *runtime = substream->runtime;
chip->cap_size = snd_pcm_lib_buffer_bytes(substream);
chip->cap_count = snd_pcm_lib_period_bytes(substream);
spin_lock_irq... | [
0,
0
] |
Linux Kernel | sound/pci/fm801.c |
static snd_pcm_uframes_t
snd_fm801_capture_pointer(struct snd_pcm_substream *substream) {
struct fm801 *chip = snd_pcm_substream_chip(substream);
size_t ptr;
if (!(chip->cap_ctrl & FM801_START))
return 0;
spin_lock(&chip->reg_lock);
ptr = chip->cap_pos + (chip->cap_count - 1) - fm801_readw(chip, CAP_COU... | [
0,
0
] |
Linux Kernel | sound/pci/fm801.c | static irqreturn_t snd_fm801_interrupt(int irq, void *dev_id) {
struct fm801 *chip = dev_id;
unsigned short status;
unsigned int tmp;
status = fm801_readw(chip, IRQ_STATUS);
status &=
FM801_IRQ_PLAYBACK | FM801_IRQ_CAPTURE | FM801_IRQ_MPU | FM801_IRQ_VOLUME;
if (!status)
return IRQ_NONE;
fm801... | [
0,
1
] |
Linux Kernel | sound/pci/fm801.c |
static int snd_fm801_playback_open(struct snd_pcm_substream *substream) {
struct fm801 *chip = snd_pcm_substream_chip(substream);
struct snd_pcm_runtime *runtime = substream->runtime;
int err;
chip->playback_substream = substream;
runtime->hw = snd_fm801_playback;
snd_pcm_hw_constraint_list(runtime, 0, SN... | [
0,
0
] |
Linux Kernel | sound/pci/fm801.c | static int snd_fm801_pcm(struct fm801 *chip, int device) {
struct pci_dev *pdev = to_pci_dev(chip->dev);
struct snd_pcm *pcm;
int err;
err = snd_pcm_new(chip->card, "FM801", device, 1, 1, &pcm);
if (err < 0)
return err;
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_fm801_playback_ops);
snd_pc... | [
1,
0
] |
Linux Kernel | sound/pci/fm801.c | static void snd_fm801_tea575x_set_pins(struct snd_tea575x *tea, u8 pins) {
struct fm801 *chip = tea->private_data;
unsigned short reg = fm801_readw(chip, GPIO_CTRL);
struct snd_fm801_tea575x_gpio gpio = *get_tea575x_gpio(chip);
reg &= ~(FM801_GPIO_GP(gpio.data) | FM801_GPIO_GP(gpio.clk) |
FM801_GPIO... | [
1,
0
] |
Linux Kernel | sound/pci/fm801.c |
static int snd_fm801_get_single(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct fm801 *chip = snd_kcontrol_chip(kcontrol);
int reg = kcontrol->private_value & 0xff;
int shift = (kcontrol->private_value >> 8) & 0xff;
int mask = (kcontrol->private_valu... | [
1,
0
] |
Linux Kernel | sound/pci/fm801.c |
static int snd_fm801_info_double(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo) {
int mask = (kcontrol->private_value >> 16) & 0xff;
uinfo->type =
mask == 1 ? SNDRV_CTL_ELEM_TYPE_BOOLEAN : SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 2;
uinfo->value.integ... | [
1,
0
] |
Linux Kernel | sound/pci/fm801.c |
static int snd_fm801_get_double(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct fm801 *chip = snd_kcontrol_chip(kcontrol);
int reg = kcontrol->private_value & 0xff;
int shift_left = (kcontrol->private_value >> 8) & 0x0f;
int shift_right = (kcontrol->... | [
1,
0
] |
Linux Kernel | sound/pci/fm801.c | static void snd_fm801_chip_multichannel_init(struct fm801 *chip) {
unsigned short cmdw;
if (chip->multichannel) {
if (chip->secondary_addr) {
wait_for_codec(chip, chip->secondary_addr, AC97_VENDOR_ID1,
msecs_to_jiffies(50));
} else {
/* at address #3, so the loop is invert... | [
1,
0
] |
Linux Kernel | sound/pci/fm801.c | static void snd_fm801_free(struct snd_card *card) {
struct fm801 *chip = card->private_data;
unsigned short cmdw;
cmdw = fm801_readw(chip, IRQ_MASK);
cmdw |= 0x00c3;
fm801_writew(chip, IRQ_MASK, cmdw);
#ifdef CONFIG_SND_FM801_TEA575X_BOOL
if (!(chip->tea575x_tuner & TUNER_DISABLED)) {
snd_tea575x_exit... | [
1,
0
] |
Linux Kernel | sound/pci/fm801.c |
static int snd_card_fm801_probe(struct pci_dev *pci,
const struct pci_device_id *pci_id) {
return snd_card_free_on_error(&pci->dev, __snd_card_fm801_probe(pci, pci_id));
} | [
0,
0
] |
Linux Kernel | sound/pci/fm801.c |
static int snd_fm801_resume(struct device *dev) {
struct snd_card *card = dev_get_drvdata(dev);
struct fm801 *chip = card->private_data;
int i;
if (chip->tea575x_tuner & TUNER_ONLY) {
snd_fm801_chip_init(chip);
} else {
reset_codec(chip);
snd_fm801_chip_multichannel_init(chip);
snd_fm801_chi... | [
0,
0
] |
Linux Kernel | sound/pci/hda/cs35l41_hda.c |
static int cs35l41_init_dsp(struct cs35l41_hda *cs35l41) {
const struct firmware *coeff_firmware = NULL;
const struct firmware *wmfw_firmware = NULL;
struct cs_dsp *dsp = &cs35l41->cs_dsp;
char *coeff_filename = NULL;
char *wmfw_filename = NULL;
int ret;
if (!cs35l41->halo_initialized) {
cs35l41_con... | [
0,
0
] |
Linux Kernel | sound/pci/hda/cs35l41_hda.c | static void cs35l41_irq_release(struct cs35l41_hda *cs35l41) {
cs35l41_error_release(cs35l41->dev, cs35l41->regmap, cs35l41->irq_errors);
cs35l41->irq_errors = 0;
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/cs35l41_hda.c | static int cs35l41_system_suspend(struct device *dev) {
struct cs35l41_hda *cs35l41 = dev_get_drvdata(dev);
int ret;
dev_dbg(cs35l41->dev, "System Suspend\n");
if (cs35l41->hw_cfg.bst_type == CS35L41_EXT_BOOST_NO_VSPK_SWITCH) {
dev_err(cs35l41->dev, "System Suspend not supported\n");
return -EINVAL;
... | [
0,
0
] |
Linux Kernel | sound/pci/hda/cs35l41_hda.c | static int cs35l41_fw_load_ctl_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct cs35l41_hda *cs35l41 = snd_kcontrol_chip(kcontrol);
unsigned int ret = 0;
mutex_lock(&cs35l41->fw_mutex);
if (cs35l41->request_fw_load == ucontrol->value.integer.v... | [
1,
0
] |
Linux Kernel | sound/pci/hda/cs35l41_hda.c |
static int cs35l41_hda_bind(struct device *dev, struct device *master,
void *master_data) {
struct cs35l41_hda *cs35l41 = dev_get_drvdata(dev);
struct hda_component *comps = master_data;
int ret = 0;
if (!comps || cs35l41->index < 0 || cs35l41->index >= HDA_MAX_COMPONENTS)
retu... | [
1,
0
] |
Linux Kernel | sound/pci/hda/cs35l41_hda.c |
static void cs35l41_hda_unbind(struct device *dev, struct device *master,
void *master_data) {
struct cs35l41_hda *cs35l41 = dev_get_drvdata(dev);
struct hda_component *comps = master_data;
if (comps[cs35l41->index].dev == dev)
memset(&comps[cs35l41->index], 0, sizeof(*comps))... | [
1,
0
] |
Linux Kernel | sound/pci/hda/cs35l41_hda.c |
static irqreturn_t cs35l41_temp_warn(int irq, void *data) {
struct cs35l41_hda *cs35l41 = data;
dev_crit_ratelimited(cs35l41->dev, "Over temperature warning\n");
set_bit(CS35L41_TEMP_WARN_ERR_RLS_SHIFT, &cs35l41->irq_errors);
return IRQ_HANDLED;
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/cs35l41_hda.c |
static int cs35l41_get_speaker_id(struct device *dev, int amp_index,
int num_amps, int fixed_gpio_id) {
struct gpio_desc *speaker_id_desc;
int speaker_id = -ENODEV;
if (fixed_gpio_id >= 0) {
dev_dbg(dev, "Found Fixed Speaker ID GPIO (index = %d)\n", fixed_gpio_id);
spea... | [
0,
0
] |
Linux Kernel | sound/pci/hda/cs35l41_hda_spi.c |
static void cs35l41_hda_spi_remove(struct spi_device *spi) {
cs35l41_hda_remove(&spi->dev);
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_auto_parser.c |
static int compare_seq(const void *ap, const void *bp) {
const struct auto_out_pin *a = ap;
const struct auto_out_pin *b = bp;
return (int)(a->seq - b->seq);
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_auto_parser.c | static int compare_input_type(const void *ap, const void *bp) {
const struct auto_pin_cfg_item *a = ap;
const struct auto_pin_cfg_item *b = bp;
if (a->type != b->type)
return (int)(a->type - b->type);
if (a->is_headset_mic && b->is_headphone_mic)
return -1; /* don't swap */
else if (a->is_headphone_m... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_auto_parser.c | static void reorder_outputs(unsigned int nums, hda_nid_t *pins) {
switch (nums) {
case 3:
case 4:
swap(pins[1], pins[2]);
break;
}
} | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_auto_parser.c | static int fill_audio_out_name(struct hda_codec *codec, hda_nid_t nid,
const struct auto_pin_cfg *cfg, const char *name,
char *label, int maxlen, int *indexp) {
unsigned int def_conf = snd_hda_codec_get_pincfg(codec, nid);
int attr = snd_hda_get_input_pi... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_auto_parser.c | int snd_hda_get_pin_label(struct hda_codec *codec, hda_nid_t nid,
const struct auto_pin_cfg *cfg, char *label,
int maxlen, int *indexp) {
unsigned int def_conf = snd_hda_codec_get_pincfg(codec, nid);
const char *name = NULL;
int i;
bool hdmi;
if (indexp)
... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_auto_parser.c | int snd_hda_add_verbs(struct hda_codec *codec, const struct hda_verb *list) {
const struct hda_verb **v;
v = snd_array_new(&codec->verbs);
if (!v)
return -ENOMEM;
*v = list;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_auto_parser.c |
void __snd_hda_apply_fixup(struct hda_codec *codec, int id, int action,
int depth) {
const char *modelname = codec->fixup_name;
while (id >= 0) {
const struct hda_fixup *fix = codec->fixup_list + id;
if (++depth > 10)
break;
if (fix->chained_before)
__snd_hda_ap... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_auto_parser.c | void snd_hda_apply_fixup(struct hda_codec *codec, int action) {
if (codec->fixup_list)
__snd_hda_apply_fixup(codec, codec->fixup_id, action, 0);
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_auto_parser.c |
static bool pin_config_match(struct hda_codec *codec,
const struct hda_pintbl *pins,
bool match_all_pins) {
const struct hda_pincfg *pin;
int i;
snd_array_for_each(&codec->init_pins, i, pin) {
hda_nid_t nid = pin->nid;
u32 cfg = pin->cfg;
con... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_auto_parser.h |
static inline int auto_cfg_hp_outs(const struct auto_pin_cfg *cfg) {
return (cfg->line_out_type == AUTO_PIN_HP_OUT) ? cfg->line_outs
: cfg->hp_outs;
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_auto_parser.h | static inline const hda_nid_t *
auto_cfg_hp_pins(const struct auto_pin_cfg *cfg) {
return (cfg->line_out_type == AUTO_PIN_HP_OUT) ? cfg->line_out_pins
: cfg->hp_pins;
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_beep.c |
static void turn_on_beep(struct hda_beep *beep) {
if (beep->keep_power_at_enable)
snd_hda_power_up_pm(beep->codec);
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_beep.c | int snd_hda_enable_beep_device(struct hda_codec *codec, int enable) {
struct hda_beep *beep = codec->beep;
if (!beep)
return 0;
enable = !!enable;
if (beep->enabled != enable) {
beep->enabled = enable;
if (enable)
turn_on_beep(beep);
else
turn_off_beep(beep);
return 1;
}
retu... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_beep.c | void snd_hda_detach_beep_device(struct hda_codec *codec) {
if (!codec->bus->shutdown && codec->beep)
snd_device_free(codec->card, codec->beep);
} | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_beep.c |
static bool ctl_has_mute(struct snd_kcontrol *kcontrol) {
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
return query_amp_caps(codec, get_amp_nid(kcontrol),
get_amp_direction(kcontrol)) &
AC_AMPCAP_MUTE;
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_beep.c | int snd_hda_mixer_amp_switch_get_beep(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
struct hda_beep *beep = codec->beep;
int chs = get_amp_channels(kcontrol);
if (beep && (!beep->enabled || !ctl... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_bind.c | static void hda_codec_unsol_event(struct hdac_device *dev, unsigned int ev) {
struct hda_codec *codec = container_of(dev, struct hda_codec, core);
if (codec->bus->shutdown)
return;
/* ignore unsol events during system suspend/resume */
if (codec->core.dev.power.power_state.event != PM_EVENT_ON)
return... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_bind.c | static void request_codec_module(struct hda_codec *codec) {
#ifdef MODULE
char modalias[32];
const char *mod = NULL;
switch (codec->probe_id) {
case HDA_CODEC_ID_GENERIC_HDMI:
#if IS_MODULE(CONFIG_SND_HDA_CODEC_HDMI)
mod = "snd-hda-codec-hdmi";
#endif
break;
case HDA_CODEC_ID_GENERIC:
#if IS_MODULE(C... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_bind.c | static bool is_likely_hdmi_codec(struct hda_codec *codec) {
hda_nid_t nid;
if (!codec->wcaps)
return true;
for_each_hda_codec_node(nid, codec) {
unsigned int wcaps = get_wcaps(codec, nid);
switch (get_wcaps_type(wcaps)) {
case AC_WID_AUD_IN:
return false; /* HDMI parser supports only HDMI ... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_bind.c | int snd_hda_codec_configure(struct hda_codec *codec) {
int err;
if (codec->configured)
return 0;
if (is_generic_config(codec))
codec->probe_id = HDA_CODEC_ID_GENERIC;
else
codec->probe_id = 0;
if (!device_is_registered(&codec->core.dev)) {
err = snd_hdac_device_register(&codec->core);
i... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_codec.c | int snd_hda_override_conn_list(struct hda_codec *codec, hda_nid_t nid, int len,
const hda_nid_t *list) {
struct hda_conn_list *p;
p = lookup_conn_list(codec, nid);
if (p) {
list_del(&p->list);
kfree(p);
}
return add_conn_list(codec, nid, len, list);
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_codec.c | int snd_hda_get_devices(struct hda_codec *codec, hda_nid_t nid, u8 *dev_list,
int max_devices) {
unsigned int parm;
int i, dev_len, devices;
parm = snd_hda_get_num_devices(codec, nid);
if (!parm)
return 0;
dev_len = parm + 1;
dev_len = dev_len < max_devices ? dev_len : max_devi... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_codec.c | int snd_hda_set_dev_select(struct hda_codec *codec, hda_nid_t nid, int dev_id) {
int ret, num_devices;
if (!codec->dp_mst)
return 0;
/* AC_PAR_DEVLIST_LEN is 0 based. */
num_devices = snd_hda_get_num_devices(codec, nid) + 1;
/* If Device List Length is 0 (num_device = 1),
* the pin is not multi strea... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_codec.c | static struct hda_pincfg *look_up_pincfg(struct hda_codec *codec,
struct snd_array *array,
hda_nid_t nid) {
struct hda_pincfg *pin;
int i;
snd_array_for_each(array, i, pin) {
if (pin->nid == nid)
return pin;
}
return ... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_codec.c | int snd_hda_codec_set_pin_target(struct hda_codec *codec, hda_nid_t nid,
unsigned int val) {
struct hda_pincfg *pin;
pin = look_up_pincfg(codec, &codec->init_pins, nid);
if (!pin)
return -EINVAL;
pin->target = val;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_codec.c | static void hda_jackpoll_work(struct work_struct *work) {
struct hda_codec *codec =
container_of(work, struct hda_codec, jackpoll_work.work);
if (!codec->jackpoll_interval && snd_hdac_is_power_on(&codec->core))
return;
/* the power-up/down sequence triggers the runtime resume */
snd_hda_power_up_pm(... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_codec.c |
struct hda_pcm *snd_hda_codec_pcm_new(struct hda_codec *codec, const char *fmt,
...) {
struct hda_pcm *pcm;
va_list args;
pcm = kzalloc(sizeof(*pcm), GFP_KERNEL);
if (!pcm)
return NULL;
pcm->codec = codec;
va_start(args, fmt);
pcm->name = kvasprintf(GFP_KERNEL,... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_codec.c | void snd_hda_codec_disconnect_pcms(struct hda_codec *codec) {
struct hda_pcm *pcm;
list_for_each_entry(pcm, &codec->pcm_list_head, list) {
if (pcm->disconnected)
continue;
if (pcm->pcm)
snd_device_disconnect(codec->card, pcm->pcm);
snd_hda_codec_pcm_put(pcm);
pcm->disconnected = 1;
}
... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_codec.c | void __snd_hda_codec_cleanup_stream(struct hda_codec *codec, hda_nid_t nid,
int do_now) {
struct hda_cvt_setup *p;
if (!nid)
return;
if (codec->no_sticky_stream)
do_now = 1;
codec_dbg(codec, "hda_codec_cleanup_stream: NID=0x%x\n", nid);
p = get_hda_cvt_setup(code... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_codec.c |
static void really_cleanup_stream(struct hda_codec *codec,
struct hda_cvt_setup *q) {
hda_nid_t nid = q->nid;
if (q->stream_tag || q->channel_id)
snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_CHANNEL_STREAMID, 0);
if (q->format_id)
snd_hda_codec_write(codec, nid, 0, AC_... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_codec.c | static void purify_inactive_streams(struct hda_codec *codec) {
struct hda_codec *c;
struct hda_cvt_setup *p;
int i;
list_for_each_codec(c, codec->bus) {
snd_array_for_each(&c->cvt_setups, i, p) {
if (p->dirty)
really_cleanup_stream(c, p);
}
}
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/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) {
int ch, ret = 0;
if (snd_BUG_ON(mask & ~0xff))
mask &= 0xff;
for (ch = 0; ch < 2; ch++)
ret |= snd_hda_codec_amp_update(codec, nid, ch, direction, idx, mask, val)... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_codec.c | int snd_hda_codec_amp_init_stereo(struct hda_codec *codec, hda_nid_t nid,
int dir, int idx, int mask, int val) {
int ch, ret = 0;
if (snd_BUG_ON(mask & ~0xff))
mask &= 0xff;
for (ch = 0; ch < 2; ch++)
ret |= snd_hda_codec_amp_init(codec, nid, ch, dir, idx, mask, val);
... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_codec.c | int snd_hda_mixer_amp_volume_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo) {
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
u16 nid = get_amp_nid(kcontrol);
u8 chs = get_amp_channels(kcontrol);
int dir = get_amp_direction(kcontrol);
unsigned int... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_codec.c | static inline int update_amp_value(struct hda_codec *codec, hda_nid_t nid,
int ch, int dir, int idx, unsigned int ofs,
unsigned int val) {
unsigned int maxval;
if (val > 0)
val += ofs;
maxval = get_amp_max_value(codec, nid, dir, 0);
if ... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_codec.c | int snd_hda_mixer_amp_volume_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
hda_nid_t nid = get_amp_nid(kcontrol);
int chs = get_amp_channels(kcontrol);
int dir = get_amp_direction(kcontrol);
int... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_codec.c | int snd_hda_mixer_amp_tlv(struct snd_kcontrol *kcontrol, int op_flag,
unsigned int size, unsigned int __user *_tlv) {
unsigned int tlv[4];
if (size < 4 * sizeof(unsigned int))
return -ENOMEM;
get_ctl_amp_tlv(kcontrol, tlv);
if (copy_to_user(_tlv, tlv, sizeof(tlv)))
return -EFA... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_codec.c | void snd_hda_set_vmaster_tlv(struct hda_codec *codec, hda_nid_t nid, int dir,
unsigned int *tlv) {
u32 caps;
int nums, step;
caps = query_amp_caps(codec, nid, dir);
nums = (caps & AC_AMPCAP_NUM_STEPS) >> AC_AMPCAP_NUM_STEPS_SHIFT;
step = (caps & AC_AMPCAP_STEP_SIZE) >> AC_AMPCAP_... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_codec.c | static int find_empty_mixer_ctl_idx(struct hda_codec *codec, const char *name,
int start_idx) {
int i, idx;
for (i = 0, idx = start_idx; i < 16; i++, idx++) {
if (!find_mixer_ctl(codec, name, 0, idx))
return idx;
}
return -EBUSY;
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_codec.c | int snd_hda_ctl_add(struct hda_codec *codec, hda_nid_t nid,
struct snd_kcontrol *kctl) {
int err;
unsigned short flags = 0;
struct hda_nid_item *item;
if (kctl->id.subdevice & HDA_SUBDEV_AMP_FLAG) {
flags |= HDA_NID_ITEM_AMP;
if (nid == 0)
nid = get_amp_nid_(kctl->private_valu... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_codec.c | int snd_hda_lock_devices(struct hda_bus *bus) {
struct snd_card *card = bus->card;
struct hda_codec *codec;
spin_lock(&card->files_lock);
if (card->shutdown)
goto err_unlock;
card->shutdown = 1;
if (!list_empty(&card->ctl_files))
goto err_clear;
list_for_each_codec(codec, bus) {
struct hda_p... | [
1,
1
] |
Linux Kernel | sound/pci/hda/hda_codec.c | static int map_followers(struct hda_codec *codec, const char *const *followers,
const char *suffix, map_follower_func_t func,
void *data) {
struct hda_nid_item *items;
const char *const *s;
int i, err;
items = codec->mixers.list;
for (i = 0; i < codec->mixers... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_codec.c | static int init_follower_0dB(struct snd_kcontrol *follower,
struct snd_kcontrol *kctl, void *_arg) {
struct follower_init_arg *arg = _arg;
int _tlv[4];
const int *tlv = NULL;
int step;
int val;
if (kctl->vd[0].access & SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK) {
if (kctl->tlv.c !... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_codec.c | int snd_hda_mixer_amp_switch_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo) {
int chs = get_amp_channels(kcontrol);
uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
uinfo->count = chs == 3 ? 2 : 1;
uinfo->value.integer.min = 0;
uinfo->value.integer.max = 1;
... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_codec.c | static unsigned short convert_from_spdif_status(unsigned int sbits) {
unsigned short val = 0;
if (sbits & IEC958_AES0_PROFESSIONAL)
val |= AC_DIG1_PROFESSIONAL;
if (sbits & IEC958_AES0_NONAUDIO)
val |= AC_DIG1_NONAUDIO;
if (sbits & IEC958_AES0_PROFESSIONAL) {
if ((sbits & IEC958_AES0_PRO_EMPHASIS) ... | [
1,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.