Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | sound/pci/lx6464es/lx_core.c | int lx_level_peaks(struct lx6464es *chip, int is_capture, int channels,
u32 *r_levels) {
int err = 0;
int i;
mutex_lock(&chip->msg_lock);
for (i = 0; i < channels; i += 4) {
u32 s0, s1, s2, s3;
lx_message_init(&chip->rmh, CMD_12_GET_PEAK);
chip->rmh.cmd[0] |= PIPE_INFO_TO_CMD(is... | [
0,
0
] |
Linux Kernel | sound/pci/lx6464es/lx_core.h |
static inline int lx_stream_pause(struct lx6464es *chip, u32 pipe,
int is_capture) {
snd_printdd("->lx_stream_pause\n");
return lx_stream_set_state(chip, pipe, is_capture, SSTATE_PAUSE);
} | [
0,
0
] |
Linux Kernel | sound/pci/maestro3.c | static u16 snd_m3_assp_read(struct snd_m3 *chip, u16 region, u16 index) {
snd_m3_outw(chip, region & MEMTYPE_MASK, DSP_PORT_MEMORY_TYPE);
snd_m3_outw(chip, index, DSP_PORT_MEMORY_INDEX);
return snd_m3_inw(chip, DSP_PORT_MEMORY_DATA);
} | [
0,
0
] |
Linux Kernel | sound/pci/maestro3.c | static int snd_m3_pcm_start(struct snd_m3 *chip, struct m3_dma *s,
struct snd_pcm_substream *subs) {
if (!s || !subs)
return -EINVAL;
snd_m3_inc_timer_users(chip);
switch (subs->stream) {
case SNDRV_PCM_STREAM_PLAYBACK:
chip->dacs_active++;
snd_m3_assp_write(chip, MEMTYP... | [
1,
0
] |
Linux Kernel | sound/pci/maestro3.c | static int snd_m3_pcm_stop(struct snd_m3 *chip, struct m3_dma *s,
struct snd_pcm_substream *subs) {
if (!s || !subs)
return -EINVAL;
snd_m3_assp_write(chip, MEMTYPE_INTERNAL_DATA,
s->inst.data + CDATA_INSTANCE_READY, 0);
snd_m3_dec_timer_users(chip);
switch (s... | [
1,
0
] |
Linux Kernel | sound/pci/maestro3.c | static void snd_m3_pcm_setup2(struct snd_m3 *chip, struct m3_dma *s,
struct snd_pcm_runtime *runtime) {
u32 freq;
if (!s->in_lists) {
s->index[0] =
snd_m3_add_list(chip, s->index_list[0], s->inst.data >> DP_SHIFT_COUNT);
s->index[1] =
snd_m3_add_list(chip, s->i... | [
1,
0
] |
Linux Kernel | sound/pci/maestro3.c | static int snd_m3_pcm_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *hw_params) {
struct m3_dma *s = substream->runtime->private_data;
s->buffer_addr = substream->runtime->dma_addr;
if (s->buffer_addr & 0x3) {
dev_err(substream->pcm->card->dev, "oh my... | [
1,
0
] |
Linux Kernel | sound/pci/maestro3.c | static int snd_m3_substream_open(struct snd_m3 *chip,
struct snd_pcm_substream *subs) {
int i;
struct m3_dma *s;
spin_lock_irq(&chip->reg_lock);
for (i = 0; i < chip->num_substreams; i++) {
s = &chip->substreams[i];
if (!s->opened)
goto __found;
}
spin_unlock_... | [
0,
0
] |
Linux Kernel | sound/pci/maestro3.c |
static int snd_m3_playback_open(struct snd_pcm_substream *subs) {
struct snd_m3 *chip = snd_pcm_substream_chip(subs);
struct snd_pcm_runtime *runtime = subs->runtime;
int err;
err = snd_m3_substream_open(chip, subs);
if (err < 0)
return err;
runtime->hw = snd_m3_playback;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/pci/maestro3.c | static int snd_m3_ac97_wait(struct snd_m3 *chip) {
int i = 10000;
do {
if (!(snd_m3_inb(chip, 0x30) & 1))
return 0;
cpu_relax();
} while (i-- > 0);
dev_err(chip->card->dev, "ac97 serial bus busy\n");
return 1;
} | [
0,
0
] |
Linux Kernel | sound/pci/maestro3.c |
static unsigned short snd_m3_ac97_read(struct snd_ac97 *ac97,
unsigned short reg) {
struct snd_m3 *chip = ac97->private_data;
unsigned short data = 0xffff;
if (snd_m3_ac97_wait(chip))
goto fail;
snd_m3_outb(chip, 0x80 | (reg & 0x7f), CODEC_COMMAND);
if (snd_m3_ac97... | [
1,
0
] |
Linux Kernel | sound/pci/maestro3.c | static int snd_m3_try_read_vendor(struct snd_m3 *chip) {
u16 ret;
if (snd_m3_ac97_wait(chip))
return 1;
snd_m3_outb(chip, 0x80 | (AC97_VENDOR_ID1 & 0x7f), 0x30);
if (snd_m3_ac97_wait(chip))
return 1;
ret = snd_m3_inw(chip, 0x32);
return (ret == 0) || (ret == 0xffff);
} | [
0,
1
] |
Linux Kernel | sound/pci/maestro3.c | static int snd_m3_mixer(struct snd_m3 *chip) {
struct snd_ac97_bus *pbus;
struct snd_ac97_template ac97;
#ifndef CONFIG_SND_MAESTRO3_INPUT
struct snd_ctl_elem_id elem_id;
#endif
int err;
static const struct snd_ac97_bus_ops ops = {
.write = snd_m3_ac97_write,
.read = snd_m3_ac97_read,
};
err ... | [
1,
1
] |
Linux Kernel | sound/pci/maestro3.c | static int snd_m3_assp_client_init(struct snd_m3 *chip, struct m3_dma *s,
int index) {
int data_bytes =
2 * (MINISRC_TMP_BUFFER_SIZE / 2 + MINISRC_IN_BUFFER_SIZE / 2 + 1 +
MINISRC_OUT_BUFFER_SIZE / 2 + 1);
int address, i;
/*
* align instance address to 256 b... | [
1,
0
] |
Linux Kernel | sound/pci/maestro3.c | static void snd_m3_amp_enable(struct snd_m3 *chip, int enable) {
int io = chip->iobase;
u16 gpo, polarity;
if (!chip->external_amp)
return;
polarity = enable ? 0 : 1;
polarity = polarity << chip->amp_gpio;
gpo = 1 << chip->amp_gpio;
outw(~gpo, io + GPIO_MASK);
outw(inw(io + GPIO_DIRECTION) | gpo... | [
1,
0
] |
Linux Kernel | sound/pci/maestro3.c | static void snd_m3_hv_init(struct snd_m3 *chip) {
unsigned long io = chip->iobase;
u16 val = GPI_VOL_DOWN | GPI_VOL_UP;
if (!chip->is_omnibook)
return;
outw(0xffff, io + GPIO_MASK);
outw(0x0000, io + GPIO_DATA);
outw(~val, io + GPIO_MASK);
outw(inw(io + GPIO_DIRECTION) & ~val, io + GPIO_DIRECTION);... | [
1,
0
] |
Linux Kernel | sound/pci/maestro3.c | static void snd_m3_enable_ints(struct snd_m3 *chip) {
unsigned long io = chip->iobase;
unsigned short val;
/* TODO: MPU401 not supported yet */
val = ASSP_INT_ENABLE /*| MPU401_INT_ENABLE*/;
if (chip->hv_config & HV_CTRL_ENABLE)
val |= HV_INT_ENABLE;
outb(val, chip->iobase + HOST_INT_STATUS);
outw(va... | [
1,
1
] |
Linux Kernel | sound/pci/maestro3.c | static void snd_m3_free(struct snd_card *card) {
struct snd_m3 *chip = card->private_data;
struct m3_dma *s;
int i;
cancel_work_sync(&chip->hwvol_work);
if (chip->substreams) {
spin_lock_irq(&chip->reg_lock);
for (i = 0; i < chip->num_substreams; i++) {
s = &chip->substreams[i];
if (s->... | [
1,
0
] |
Linux Kernel | sound/pci/maestro3.c | static int m3_resume(struct device *dev) {
struct snd_card *card = dev_get_drvdata(dev);
struct snd_m3 *chip = card->private_data;
int i, dsp_index;
if (chip->suspend_mem == NULL)
return 0;
snd_m3_outw(chip, 0, 0x54);
snd_m3_outw(chip, 0, 0x56);
snd_m3_chip_init(chip);
snd_m3_assp_halt(chip);
s... | [
0,
0
] |
Linux Kernel | sound/pci/maestro3.c | static int snd_m3_input_register(struct snd_m3 *chip) {
struct input_dev *input_dev;
int err;
input_dev = devm_input_allocate_device(&chip->pci->dev);
if (!input_dev)
return -ENOMEM;
snprintf(chip->phys, sizeof(chip->phys), "pci-%s/input0",
pci_name(chip->pci));
input_dev->name = chip->car... | [
1,
0
] |
Linux Kernel | sound/pci/mixart/mixart.c | static int mixart_set_clock(struct mixart_mgr *mgr, struct mixart_pipe *pipe,
unsigned int rate) {
struct mixart_msg request;
struct mixart_clock_properties clock_properties;
struct mixart_clock_properties_resp clock_prop_resp;
int err;
switch (pipe->status) {
case PIPE_CLOCK_SE... | [
1,
0
] |
Linux Kernel | sound/pci/mixart/mixart.c | int snd_mixart_kill_ref_pipe(struct mixart_mgr *mgr, struct mixart_pipe *pipe,
int monitoring) {
int err = 0;
if (pipe->status == PIPE_UNDEFINED)
return 0;
if (monitoring)
pipe->monitoring = 0;
else
pipe->references--;
if ((pipe->references <= 0) && (pipe->monitorin... | [
1,
0
] |
Linux Kernel | sound/pci/mixart/mixart.c | static int mixart_set_stream_state(struct mixart_stream *stream, int start) {
struct snd_mixart *chip;
struct mixart_stream_state_req stream_state_req;
struct mixart_msg request;
if (!stream->substream)
return -EINVAL;
memset(&stream_state_req, 0, sizeof(stream_state_req));
stream_state_req.stream_cou... | [
1,
0
] |
Linux Kernel | sound/pci/mixart/mixart.c | static int snd_mixart_trigger(struct snd_pcm_substream *subs, int cmd) {
struct mixart_stream *stream = subs->runtime->private_data;
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
dev_dbg(subs->pcm->card->dev, "SNDRV_PCM_TRIGGER_START\n");
if (mixart_set_stream_state(stream, 1))
return -EINVAL;
... | [
1,
1
] |
Linux Kernel | sound/pci/mixart/mixart.c |
static int mixart_sync_nonblock_events(struct mixart_mgr *mgr) {
unsigned long timeout = jiffies + HZ;
while (atomic_read(&mgr->msg_processed) > 0) {
if (time_after(jiffies, timeout)) {
dev_err(&mgr->pci->dev, "mixart: cannot process nonblock events!\n");
return -EBUSY;
}
schedule_timeout_u... | [
1,
0
] |
Linux Kernel | sound/pci/mixart/mixart.c | static int snd_mixart_hw_params(struct snd_pcm_substream *subs,
struct snd_pcm_hw_params *hw) {
struct snd_mixart *chip = snd_pcm_substream_chip(subs);
struct mixart_mgr *mgr = chip->mgr;
struct mixart_stream *stream = subs->runtime->private_data;
snd_pcm_format_t format;
int e... | [
1,
0
] |
Linux Kernel | sound/pci/mixart/mixart.c | static int snd_mixart_close(struct snd_pcm_substream *subs) {
struct snd_mixart *chip = snd_pcm_substream_chip(subs);
struct mixart_mgr *mgr = chip->mgr;
struct mixart_stream *stream = subs->runtime->private_data;
mutex_lock(&mgr->setup_mutex);
dev_dbg(chip->card->dev, "snd_mixart_close C%d/P%d/Sub%d\n", ch... | [
1,
0
] |
Linux Kernel | sound/pci/mixart/mixart.c | static int snd_mixart_pcm_digital(struct snd_mixart *chip) {
int err;
struct snd_pcm *pcm;
char name[32];
sprintf(name, "miXart AES/EBU %d", chip->chip_idx);
err = snd_pcm_new(chip->card, name, MIXART_PCM_DIGITAL,
MIXART_PLAYBACK_STREAMS, MIXART_CAPTURE_STREAMS, &pcm);
if (err < 0) {
... | [
1,
0
] |
Linux Kernel | sound/pci/mixart/mixart.c |
static int snd_mixart_chip_free(struct snd_mixart *chip) {
kfree(chip);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/pci/mixart/mixart.c |
static int snd_mixart_chip_dev_free(struct snd_device *device) {
struct snd_mixart *chip = device->device_data;
return snd_mixart_chip_free(chip);
} | [
0,
0
] |
Linux Kernel | sound/pci/mixart/mixart.c | static int snd_mixart_create(struct mixart_mgr *mgr, struct snd_card *card,
int idx) {
int err;
struct snd_mixart *chip;
static const struct snd_device_ops ops = {
.dev_free = snd_mixart_chip_dev_free,
};
chip = kzalloc(sizeof(*chip), GFP_KERNEL);
if (!chip)
return -E... | [
0,
0
] |
Linux Kernel | sound/pci/mixart/mixart.c |
int snd_mixart_create_pcm(struct snd_mixart *chip) {
int err;
err = snd_mixart_pcm_analog(chip);
if (err < 0)
return err;
if (chip->mgr->board_type == MIXART_DAUGHTER_TYPE_AES) {
err = snd_mixart_pcm_digital(chip);
if (err < 0)
return err;
}
return err;
} | [
1,
0
] |
Linux Kernel | sound/pci/mixart/mixart.c | static void snd_mixart_proc_init(struct snd_mixart *chip) {
struct snd_info_entry *entry;
snd_card_ro_proc_new(chip->card, "board_info", chip, snd_mixart_proc_read);
if (!snd_card_proc_new(chip->card, "mixart_BA0", &entry)) {
entry->content = SNDRV_INFO_CONTENT_DATA;
entry->private_data = chip->mgr;
... | [
0,
0
] |
Linux Kernel | sound/pci/mixart/mixart_core.c | int snd_mixart_send_msg_wait_notif(struct mixart_mgr *mgr,
struct mixart_msg *request,
u32 notif_event) {
int err;
wait_queue_entry_t wait;
long timeout;
if (snd_BUG_ON(!notif_event))
return -EINVAL;
if (snd_BUG_ON((notif_event & MSG_T... | [
1,
0
] |
Linux Kernel | sound/pci/mixart/mixart_hwdep.c | static int mixart_wait_nice_for_register_value(struct mixart_mgr *mgr,
u32 offset, int is_egal,
u32 value,
unsigned long timeout) {
unsigned long end_time = jiffies + (timeout *... | [
1,
0
] |
Linux Kernel | sound/pci/mixart/mixart_hwdep.c | static int mixart_first_init(struct mixart_mgr *mgr) {
u32 k;
int err;
struct mixart_msg request;
err = mixart_enum_connectors(mgr);
if (err < 0)
return err;
err = mixart_enum_physio(mgr);
if (err < 0)
return err;
/* though why not here */
request.message_id = MSG_SYSTEM_SEND_SYNCHRO_CMD;
... | [
1,
0
] |
Linux Kernel | sound/pci/mixart/mixart_mixer.c | static int mixart_analog_vol_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_mixart *chip = snd_kcontrol_chip(kcontrol);
mutex_lock(&chip->mgr->mixer_mutex);
if (kcontrol->private_value == 0) {
ucontrol->value.integer.value[0] = chip->analo... | [
0,
0
] |
Linux Kernel | sound/pci/mixart/mixart_mixer.c |
static int mixart_audio_sw_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_mixart *chip = snd_kcontrol_chip(kcontrol);
mutex_lock(&chip->mgr->mixer_mutex);
ucontrol->value.integer.value[0] = chip->analog_playback_active[0];
ucontrol->value.in... | [
0,
0
] |
Linux Kernel | sound/pci/mixart/mixart_mixer.c | static int mixart_audio_sw_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_mixart *chip = snd_kcontrol_chip(kcontrol);
int i, changed = 0;
mutex_lock(&chip->mgr->mixer_mutex);
for (i = 0; i < 2; i++) {
if (chip->analog_playback_active[i] !=... | [
1,
0
] |
Linux Kernel | sound/pci/mixart/mixart_mixer.c | int mixart_update_capture_stream_level(struct snd_mixart *chip, int is_aes) {
int err, i, idx;
struct mixart_pipe *pipe;
struct mixart_msg request;
struct mixart_set_in_audio_level_req set_level;
u32 status = 0;
if (is_aes) {
idx = 1;
pipe = &chip->pipe_in_dig;
} else {
idx = 0;
pipe = &c... | [
1,
0
] |
Linux Kernel | sound/pci/mixart/mixart_mixer.c | static int mixart_pcm_sw_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_mixart *chip = snd_kcontrol_chip(kcontrol);
int changed = 0;
int is_aes = kcontrol->private_value & MIXART_VOL_AES_MASK;
int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->i... | [
0,
0
] |
Linux Kernel | sound/pci/mixart/mixart_mixer.c | static int mixart_update_monitoring(struct snd_mixart *chip, int channel) {
int err;
struct mixart_msg request;
struct mixart_set_out_audio_level audio_level;
u32 resp = 0;
if (chip->pipe_out_ana.status == PIPE_UNDEFINED)
return -EINVAL;
if (!channel)
request.uid = chip->pipe_out_ana.uid_left_conn... | [
1,
0
] |
Linux Kernel | sound/pci/mixart/mixart_mixer.c |
static int mixart_monitor_vol_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_mixart *chip = snd_kcontrol_chip(kcontrol);
int changed = 0;
int i;
mutex_lock(&chip->mgr->mixer_mutex);
for (i = 0; i < 2; i++) {
if (chip->monitoring_volu... | [
0,
0
] |
Linux Kernel | sound/pci/mixart/mixart_mixer.c | static int mixart_monitor_sw_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_mixart *chip = snd_kcontrol_chip(kcontrol);
mutex_lock(&chip->mgr->mixer_mutex);
ucontrol->value.integer.value[0] = chip->monitoring_active[0];
ucontrol->value.integ... | [
0,
0
] |
Linux Kernel | sound/pci/nm256/nm256.c | static void snd_nm256_load_one_coefficient(struct nm256 *chip, int stream,
u32 port, int which) {
u32 coeff_buf = chip->coeff_buf[stream];
u16 offset = snd_nm256_get_start_offset(which);
u16 size = coefficient_sizes[which];
snd_nm256_write_buffer(chip, coefficients + ... | [
0,
0
] |
Linux Kernel | sound/pci/nm256/nm256.c | static void snd_nm256_load_coefficient(struct nm256 *chip, int stream,
int number) {
u32 poffset = (stream == SNDRV_PCM_STREAM_CAPTURE ? NM_RECORD_ENABLE_REG
: NM_PLAYBACK_ENABLE_REG);
u32 addr = NM_COEFF_START_OFFSET;
ad... | [
0,
0
] |
Linux Kernel | sound/pci/nm256/nm256.c |
static int snd_nm256_playback_trigger(struct snd_pcm_substream *substream,
int cmd) {
struct nm256 *chip = snd_pcm_substream_chip(substream);
struct nm256_stream *s = substream->runtime->private_data;
int err = 0;
if (snd_BUG_ON(!s))
return -ENXIO;
spin_lock(&chip-... | [
1,
0
] |
Linux Kernel | sound/pci/nm256/nm256.c | static void snd_nm256_setup_stream(struct nm256 *chip, struct nm256_stream *s,
struct snd_pcm_substream *substream,
const struct snd_pcm_hardware *hw_ptr) {
struct snd_pcm_runtime *runtime = substream->runtime;
s->running = 0;
runtime->hw = *h... | [
1,
0
] |
Linux Kernel | sound/pci/nm256/nm256.c | static void snd_nm256_init_chip(struct nm256 *chip) {
snd_nm256_writeb(chip, 0x0, 0x11);
snd_nm256_writew(chip, 0x214, 0);
/* stop sounds.. */
// snd_nm256_playback_stop(chip);
// snd_nm256_capture_stop(chip);
} | [
0,
0
] |
Linux Kernel | sound/pci/nm256/nm256.c | static unsigned short snd_nm256_ac97_read(struct snd_ac97 *ac97,
unsigned short reg) {
struct nm256 *chip = ac97->private_data;
int idx = nm256_ac97_idx(reg);
if (idx < 0)
return 0;
return chip->ac97_regs[idx];
} | [
0,
0
] |
Linux Kernel | sound/pci/nm256/nm256.c | static int snd_nm256_mixer(struct nm256 *chip) {
struct snd_ac97_bus *pbus;
struct snd_ac97_template ac97;
int err;
static const struct snd_ac97_bus_ops ops = {
.reset = snd_nm256_ac97_reset,
.write = snd_nm256_ac97_write,
.read = snd_nm256_ac97_read,
};
chip->ac97_regs =
devm_kcall... | [
1,
0
] |
Linux Kernel | sound/pci/nm256/nm256.c | static int nm256_resume(struct device *dev) {
struct snd_card *card = dev_get_drvdata(dev);
struct nm256 *chip = card->private_data;
int i;
chip->in_resume = 1;
snd_nm256_init_chip(chip);
/* restore ac97 */
snd_ac97_resume(chip->ac97);
for (i = 0; i < 2; i++) {
struct nm256_stream *s = &chip->st... | [
1,
0
] |
Linux Kernel | sound/pci/nm256/nm256.c |
static void snd_nm256_free(struct snd_card *card) {
struct nm256 *chip = card->private_data;
if (chip->streams[SNDRV_PCM_STREAM_PLAYBACK].running)
snd_nm256_playback_stop(chip);
if (chip->streams[SNDRV_PCM_STREAM_CAPTURE].running)
snd_nm256_capture_stop(chip);
} | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/oxygen.c | static void ak4396_write(struct oxygen *chip, unsigned int codec, u8 reg,
u8 value) {
static const u8 codec_spi_map[4] = {0, 1, 2, 4};
struct generic_data *data = chip->model_data;
oxygen_write_spi(chip,
OXYGEN_SPI_TRIGGER | OXYGEN_SPI_DATA_LENGTH_2 |
... | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/oxygen.c |
static void claro_enable_hp(struct oxygen *chip) {
msleep(300);
oxygen_set_bits16(chip, OXYGEN_GPIO_CONTROL, GPIO_CLARO_HP);
oxygen_set_bits16(chip, OXYGEN_GPIO_DATA, GPIO_CLARO_HP);
} | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/oxygen.c |
static void claro_suspend(struct oxygen *chip) { claro_disable_hp(chip); } | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/oxygen.c |
static void meridian_resume(struct oxygen *chip) {
ak4396_registers_init(chip);
} | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/oxygen.c |
static void set_wm8785_params(struct oxygen *chip,
struct snd_pcm_hw_params *params) {
struct generic_data *data = chip->model_data;
unsigned int value;
value = WM8785_MCR_SLAVE | WM8785_FORMAT_LJUST;
if (params_rate(params) <= 48000)
value |= WM8785_OSR_SINGLE;
else if (pa... | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/oxygen.c |
static void set_ak5385_params(struct oxygen *chip,
struct snd_pcm_hw_params *params) {
unsigned int value;
if (params_rate(params) <= 54000)
value = GPIO_AK5385_DFS_NORMAL;
else if (params_rate(params) <= 108000)
value = GPIO_AK5385_DFS_DOUBLE;
else
value = GPIO_AK538... | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/oxygen.c |
static void set_no_params(struct oxygen *chip,
struct snd_pcm_hw_params *params) {} | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/oxygen.c |
static int hpf_put(struct snd_kcontrol *ctl, struct snd_ctl_elem_value *value) {
struct oxygen *chip = ctl->private_data;
struct generic_data *data = chip->model_data;
unsigned int reg;
int changed;
mutex_lock(&chip->mutex);
reg = data->wm8785_regs[WM8785_R2] & ~(WM8785_HPFR | WM8785_HPFL);
if (value->v... | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/oxygen.c |
static int meridian_dig_source_info(struct snd_kcontrol *ctl,
struct snd_ctl_elem_info *info) {
static const char *const names[2] = {"On-board", "Extension"};
return snd_ctl_enum_info(info, 1, 2, names);
} | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/oxygen.c |
static int claro_dig_source_info(struct snd_kcontrol *ctl,
struct snd_ctl_elem_info *info) {
static const char *const names[2] = {"Optical", "Coaxial"};
return snd_ctl_enum_info(info, 1, 2, names);
} | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/oxygen_io.c |
u32 oxygen_read32(struct oxygen *chip, unsigned int reg) {
return inl(chip->addr + reg);
} | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/oxygen_io.c |
void oxygen_write8(struct oxygen *chip, unsigned int reg, u8 value) {
outb(value, chip->addr + reg);
chip->saved_registers._8[reg] = value;
} | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/oxygen_io.c |
void oxygen_write16(struct oxygen *chip, unsigned int reg, u16 value) {
outw(value, chip->addr + reg);
chip->saved_registers._16[reg / 2] = cpu_to_le16(value);
} | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/oxygen_io.c | void oxygen_write_ac97(struct oxygen *chip, unsigned int codec,
unsigned int index, u16 data) {
unsigned int count, succeeded;
u32 reg;
reg = data;
reg |= index << OXYGEN_AC97_REG_ADDR_SHIFT;
reg |= OXYGEN_AC97_REG_DIR_WRITE;
reg |= codec << OXYGEN_AC97_REG_CODEC_SHIFT;
succeeded =... | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/oxygen_io.c |
void oxygen_write_ac97_masked(struct oxygen *chip, unsigned int codec,
unsigned int index, u16 data, u16 mask) {
u16 value = oxygen_read_ac97(chip, codec, index);
value &= ~mask;
value |= data & mask;
oxygen_write_ac97(chip, codec, index, value);
} | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/oxygen_io.c | static int oxygen_wait_spi(struct oxygen *chip) {
unsigned int count;
for (count = 50; count > 0; count--) {
udelay(4);
if ((oxygen_read8(chip, OXYGEN_SPI_CONTROL) & OXYGEN_SPI_BUSY) == 0)
return 0;
}
dev_err(chip->card->dev, "oxygen: SPI wait timeout\n");
return -EIO;
} | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/oxygen_lib.c |
static void oxygen_restore_ac97(struct oxygen *chip, unsigned int codec) {
unsigned int i;
oxygen_write_ac97(chip, codec, AC97_RESET, 0);
msleep(1);
for (i = 1; i < 0x40; ++i)
if (is_bit_set(ac97_registers_to_restore[codec], i))
oxygen_write_ac97(chip, codec, i * 2,
chip->sav... | [
1,
0
] |
Linux Kernel | sound/pci/oxygen/oxygen_lib.c |
void oxygen_pci_shutdown(struct pci_dev *pci) {
struct snd_card *card = pci_get_drvdata(pci);
struct oxygen *chip = card->private_data;
oxygen_shutdown(chip);
chip->model.cleanup(chip);
} | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/oxygen_mixer.c |
static int dac_volume_put(struct snd_kcontrol *ctl,
struct snd_ctl_elem_value *value) {
struct oxygen *chip = ctl->private_data;
unsigned int i;
int changed;
changed = 0;
mutex_lock(&chip->mutex);
for (i = 0; i < chip->model.dac_channels_mixer; ++i)
if (value->value.integer.v... | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/oxygen_mixer.c |
static int dac_mute_get(struct snd_kcontrol *ctl,
struct snd_ctl_elem_value *value) {
struct oxygen *chip = ctl->private_data;
mutex_lock(&chip->mutex);
value->value.integer.value[0] = !chip->dac_mute;
mutex_unlock(&chip->mutex);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/oxygen_mixer.c |
static unsigned int upmix_item_count(struct oxygen *chip) {
if (chip->model.dac_channels_pcm < 8)
return 2;
else if (chip->model.update_center_lfe_mix)
return 5;
else
return 3;
} | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/oxygen_mixer.c |
static int upmix_info(struct snd_kcontrol *ctl,
struct snd_ctl_elem_info *info) {
static const char *const names[5] = {
"Front",
"Front+Surround",
"Front+Surround+Back",
"Front+Surround+Center/LFE",
"Front+Surround+Center/LFE+Back",
};
struct oxygen *chip = ctl... | [
1,
0
] |
Linux Kernel | sound/pci/oxygen/oxygen_mixer.c |
static int spdif_switch_put(struct snd_kcontrol *ctl,
struct snd_ctl_elem_value *value) {
struct oxygen *chip = ctl->private_data;
int changed;
mutex_lock(&chip->mutex);
changed = value->value.integer.value[0] != chip->spdif_playback_enable;
if (changed) {
chip->spdif_playbac... | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/oxygen_mixer.c |
static u32 iec958_to_oxygen(struct snd_ctl_elem_value *value) {
u32 bits;
bits = value->value.iec958.status[0] &
(OXYGEN_SPDIF_NONAUDIO | OXYGEN_SPDIF_C | OXYGEN_SPDIF_PREEMPHASIS);
bits |= value->value.iec958.status[1] << OXYGEN_SPDIF_CATEGORY_SHIFT;
if (bits & OXYGEN_SPDIF_NONAUDIO)
bits |= OXY... | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/oxygen_mixer.c |
static inline void write_spdif_bits(struct oxygen *chip, u32 bits) {
oxygen_write32_masked(
chip, OXYGEN_SPDIF_OUTPUT_BITS, bits,
OXYGEN_SPDIF_NONAUDIO | OXYGEN_SPDIF_C | OXYGEN_SPDIF_PREEMPHASIS |
OXYGEN_SPDIF_CATEGORY_MASK | OXYGEN_SPDIF_ORIGINAL | OXYGEN_SPDIF_V);
} | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/oxygen_mixer.c |
static int spdif_default_get(struct snd_kcontrol *ctl,
struct snd_ctl_elem_value *value) {
struct oxygen *chip = ctl->private_data;
mutex_lock(&chip->mutex);
oxygen_to_iec958(chip->spdif_bits, value);
mutex_unlock(&chip->mutex);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/oxygen_mixer.c |
static int spdif_mask_get(struct snd_kcontrol *ctl,
struct snd_ctl_elem_value *value) {
value->value.iec958.status[0] = IEC958_AES0_NONAUDIO |
IEC958_AES0_CON_NOT_COPYRIGHT |
IEC958_AES0_CON_EMPHASIS;
value->value.iec958.... | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/oxygen_mixer.c |
static int monitor_put(struct snd_kcontrol *ctl,
struct snd_ctl_elem_value *value) {
struct oxygen *chip = ctl->private_data;
u8 bit = ctl->private_value;
int invert = ctl->private_value & (1 << 8);
u8 oldreg, newreg;
int changed;
spin_lock_irq(&chip->reg_lock);
oldreg = oxygen_re... | [
1,
0
] |
Linux Kernel | sound/pci/oxygen/oxygen_mixer.c |
static int ac97_volume_info(struct snd_kcontrol *ctl,
struct snd_ctl_elem_info *info) {
int stereo = (ctl->private_value >> 16) & 1;
info->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
info->count = stereo ? 2 : 1;
info->value.integer.min = 0;
info->value.integer.max = 0x1f;
return 0;
} | [
1,
0
] |
Linux Kernel | sound/pci/oxygen/oxygen_mixer.c |
static int ac97_volume_put(struct snd_kcontrol *ctl,
struct snd_ctl_elem_value *value) {
struct oxygen *chip = ctl->private_data;
unsigned int codec = (ctl->private_value >> 24) & 1;
int stereo = (ctl->private_value >> 16) & 1;
unsigned int index = ctl->private_value & 0xff;
u16 ol... | [
1,
0
] |
Linux Kernel | sound/pci/oxygen/oxygen_mixer.c |
static int ac97_fp_rec_volume_info(struct snd_kcontrol *ctl,
struct snd_ctl_elem_info *info) {
info->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
info->count = 2;
info->value.integer.min = 0;
info->value.integer.max = 7;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/oxygen_mixer.c |
static int add_controls(struct oxygen *chip,
const struct snd_kcontrol_new controls[],
unsigned int count) {
static const char *const known_ctl_names[CONTROL_COUNT] = {
[CONTROL_SPDIF_PCM] = SNDRV_CTL_NAME_IEC958("", PLAYBACK, PCM_STREAM),
[CONTROL_SPDIF_IN... | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/oxygen_pcm.c |
static int oxygen_rec_b_open(struct snd_pcm_substream *substream) {
return oxygen_open(substream, PCM_B);
} | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/oxygen_pcm.c | static unsigned int oxygen_play_channels(struct snd_pcm_hw_params *hw_params) {
switch (params_channels(hw_params)) {
default:
return OXYGEN_PLAY_CHANNELS_2;
case 4:
return OXYGEN_PLAY_CHANNELS_4;
case 6:
return OXYGEN_PLAY_CHANNELS_6;
case 8:
return OXYGEN_PLAY_CHANNELS_8;
}
} | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/oxygen_pcm.c |
static int oxygen_rec_c_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *hw_params) {
struct oxygen *chip = snd_pcm_substream_chip(substream);
bool is_spdif;
int err;
err = oxygen_hw_params(substream, hw_params);
if (err < 0)
return err;
is_sp... | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/oxygen_pcm.c |
static int oxygen_spdif_hw_free(struct snd_pcm_substream *substream) {
struct oxygen *chip = snd_pcm_substream_chip(substream);
spin_lock_irq(&chip->reg_lock);
oxygen_clear_bits32(chip, OXYGEN_SPDIF_CONTROL, OXYGEN_SPDIF_OUT_ENABLE);
spin_unlock_irq(&chip->reg_lock);
return oxygen_hw_free(substream);
} | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/oxygen_pcm.c | static snd_pcm_uframes_t oxygen_pointer(struct snd_pcm_substream *substream) {
struct oxygen *chip = snd_pcm_substream_chip(substream);
struct snd_pcm_runtime *runtime = substream->runtime;
unsigned int channel = oxygen_substream_channel(substream);
u32 curr_addr;
curr_addr = oxygen_read32(chip, channel_base... | [
1,
0
] |
Linux Kernel | sound/pci/oxygen/se6x.c |
static int se6x_get_model(struct oxygen *chip,
const struct pci_device_id *pci_id) {
chip->model = model_se6x;
return 0;
} | [
1,
0
] |
Linux Kernel | sound/pci/oxygen/se6x.c |
static int se6x_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) {
static int dev;
int err;
if (dev >= SNDRV_CARDS)
return -ENODEV;
if (!enable[dev]) {
++dev;
return -ENOENT;
}
err = oxygen_pci_probe(pci, index[dev], id[dev], THIS_MODULE, se6x_ids,
se6x_g... | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/virtuoso.c |
static int xonar_probe(struct pci_dev *pci,
const struct pci_device_id *pci_id) {
static int dev;
int err;
if (dev >= SNDRV_CARDS)
return -ENODEV;
if (!enable[dev]) {
++dev;
return -ENOENT;
}
err = oxygen_pci_probe(pci, index[dev], id[dev], THIS_MODULE, xonar_ids,
... | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/xonar_cs43xx.c |
static void xonar_d1_cleanup(struct oxygen *chip) {
xonar_disable_output(chip);
cs4362a_write(chip, 0x01, CS4362A_PDN | CS4362A_CPEN);
oxygen_clear_bits8(chip, OXYGEN_FUNCTION, OXYGEN_FUNCTION_RESET_CODEC);
} | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/xonar_cs43xx.c |
static void update_cs43xx_mute(struct oxygen *chip) {
u8 reg;
reg = CS4398_MUTEP_LOW | CS4398_PAMUTE;
if (chip->dac_mute)
reg |= CS4398_MUTE_B | CS4398_MUTE_A;
cs4398_write_cached(chip, 4, reg);
update_cs4362a_volumes(chip);
} | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/xonar_cs43xx.c |
static void update_cs43xx_center_lfe_mix(struct oxygen *chip, bool mixed) {
struct xonar_cs43xx *data = chip->model_data;
u8 reg;
reg = data->cs4362a_regs[9] & ~CS4362A_ATAPI_MASK;
if (mixed)
reg |= CS4362A_ATAPI_B_LR | CS4362A_ATAPI_A_LR;
else
reg |= CS4362A_ATAPI_B_R | CS4362A_ATAPI_A_L;
cs4362a... | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/xonar_cs43xx.c |
static int rolloff_info(struct snd_kcontrol *ctl,
struct snd_ctl_elem_info *info) {
static const char *const names[2] = {"Fast Roll-off", "Slow Roll-off"};
return snd_ctl_enum_info(info, 1, 2, names);
} | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/xonar_cs43xx.c |
static int rolloff_put(struct snd_kcontrol *ctl,
struct snd_ctl_elem_value *value) {
struct oxygen *chip = ctl->private_data;
struct xonar_cs43xx *data = chip->model_data;
int changed;
u8 reg;
mutex_lock(&chip->mutex);
reg = data->cs4398_regs[7];
if (value->value.enumerated.item[0... | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/xonar_cs43xx.c |
static void dump_cs4362a_registers(struct xonar_cs43xx *data,
struct snd_info_buffer *buffer) {
unsigned int i;
snd_iprintf(buffer, "\nCS4362A:");
for (i = 1; i <= 14; ++i)
snd_iprintf(buffer, " %02x", data->cs4362a_regs[i]);
snd_iprintf(buffer, "\n");
} | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/xonar_cs43xx.c |
static void dump_d1_registers(struct oxygen *chip,
struct snd_info_buffer *buffer) {
struct xonar_cs43xx *data = chip->model_data;
unsigned int i;
snd_iprintf(buffer, "\nCS4398: 7?");
for (i = 2; i < 8; ++i)
snd_iprintf(buffer, " %02x", data->cs4398_regs[i]);
snd_iprintf(bu... | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.