Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | sound/pci/oxygen/xonar_dg.c |
int cs4245_shadow_control(struct oxygen *chip,
enum cs4245_shadow_operation op) {
struct dg *data = chip->model_data;
unsigned char addr;
int ret;
for (addr = 1; addr < ARRAY_SIZE(data->cs4245_shadow); addr++) {
ret = (op == CS4245_SAVE_TO_SHADOW ? cs4245_read_spi(chip, addr)
... | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/xonar_dg.c |
void dg_resume(struct oxygen *chip) {
cs4245_shadow_control(chip, CS4245_LOAD_FROM_SHADOW);
msleep(2500);
oxygen_set_bits16(chip, OXYGEN_GPIO_DATA, GPIO_OUTPUT_ENABLE);
} | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/xonar_dg.c |
void set_cs4245_dac_params(struct oxygen *chip,
struct snd_pcm_hw_params *params) {
struct dg *data = chip->model_data;
unsigned char dac_ctrl;
unsigned char mclk_freq;
dac_ctrl = data->cs4245_shadow[CS4245_DAC_CTRL_1] & ~CS4245_DAC_FM_MASK;
mclk_freq = data->cs4245_shadow[CS4245_... | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/xonar_dg_mixer.c | static int output_select_apply(struct oxygen *chip) {
struct dg *data = chip->model_data;
data->cs4245_shadow[CS4245_SIGNAL_SEL] &= ~CS4245_A_OUT_SEL_MASK;
if (data->output_sel == PLAYBACK_DST_HP) {
oxygen_set_bits8(chip, OXYGEN_GPIO_DATA, GPIO_HP_REAR);
} else if (data->output_sel == PLAYBACK_DST_HP_FP) ... | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/xonar_dg_mixer.c |
static int hp_stereo_volume_get(struct snd_kcontrol *ctl,
struct snd_ctl_elem_value *val) {
struct oxygen *chip = ctl->private_data;
struct dg *data = chip->model_data;
unsigned int tmp;
mutex_lock(&chip->mutex);
tmp = (~data->cs4245_shadow[CS4245_DAC_A_CTRL]) & 255;
val->v... | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/xonar_dg_mixer.c | static int hp_mute_get(struct snd_kcontrol *ctl,
struct snd_ctl_elem_value *val) {
struct oxygen *chip = ctl->private_data;
struct dg *data = chip->model_data;
mutex_lock(&chip->mutex);
val->value.integer.value[0] =
!(data->cs4245_shadow[CS4245_DAC_CTRL_1] & CS4245_MUTE_DAC);
mut... | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/xonar_dg_mixer.c |
static int hp_mute_put(struct snd_kcontrol *ctl,
struct snd_ctl_elem_value *val) {
struct oxygen *chip = ctl->private_data;
struct dg *data = chip->model_data;
int ret;
int changed;
if (val->value.integer.value[0] > 1)
return -EINVAL;
mutex_lock(&chip->mutex);
data->cs4245_sha... | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/xonar_dg_mixer.c |
static int input_vol_put(struct snd_kcontrol *ctl,
struct snd_ctl_elem_value *value) {
struct oxygen *chip = ctl->private_data;
struct dg *data = chip->model_data;
unsigned int idx = ctl->private_value;
int changed = 0;
int ret = 0;
if (value->value.integer.value[0] < 2 * -12 ||
... | [
1,
0
] |
Linux Kernel | sound/pci/oxygen/xonar_dg_mixer.c |
static int hpf_get(struct snd_kcontrol *ctl, struct snd_ctl_elem_value *value) {
struct oxygen *chip = ctl->private_data;
struct dg *data = chip->model_data;
value->value.enumerated.item[0] =
!!(data->cs4245_shadow[CS4245_ADC_CTRL] & CS4245_HPF_FREEZE);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/xonar_dg_mixer.c |
static int hpf_put(struct snd_kcontrol *ctl, struct snd_ctl_elem_value *value) {
struct oxygen *chip = ctl->private_data;
struct dg *data = chip->model_data;
u8 reg;
int changed;
mutex_lock(&chip->mutex);
reg = data->cs4245_shadow[CS4245_ADC_CTRL] & ~CS4245_HPF_FREEZE;
if (value->value.enumerated.item[0... | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/xonar_hdmi.c |
void xonar_hdmi_pcm_hardware_filter(unsigned int channel,
struct snd_pcm_hardware *hardware) {
if (channel == PCM_MULTICH) {
hardware->rates = SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 |
SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_192000;
hardware->rate_m... | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/xonar_hdmi.c | void xonar_set_hdmi_params(struct oxygen *chip, struct xonar_hdmi *hdmi,
struct snd_pcm_hw_params *params) {
hdmi->params[0] = 0;
switch (params_rate(params)) {
case 44100:
hdmi->params[1] = IEC958_AES3_CON_FS_44100;
break;
case 48000:
hdmi->params[1] = IEC958_AES3_CON_FS_... | [
1,
0
] |
Linux Kernel | sound/pci/oxygen/xonar_lib.c |
int xonar_gpio_bit_switch_put(struct snd_kcontrol *ctl,
struct snd_ctl_elem_value *value) {
struct oxygen *chip = ctl->private_data;
u16 bit = ctl->private_value;
bool invert = ctl->private_value & XONAR_GPIO_BIT_INVERT;
u16 old_bits, new_bits;
int changed;
spin_lock_irq(&chi... | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/xonar_pcm179x.c |
static inline void pcm1796_write_i2c(struct oxygen *chip, unsigned int codec,
u8 reg, u8 value) {
oxygen_write_i2c(chip, I2C_DEVICE_PCM1796(codec), reg, value);
} | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/xonar_pcm179x.c |
static void pcm1796_write_cached(struct oxygen *chip, unsigned int codec,
u8 reg, u8 value) {
struct xonar_pcm179x *data = chip->model_data;
if (value != data->pcm1796_regs[codec][reg - PCM1796_REG_BASE])
pcm1796_write(chip, codec, reg, value);
} | [
1,
0
] |
Linux Kernel | sound/pci/oxygen/xonar_pcm179x.c |
static void cs2000_write_cached(struct oxygen *chip, u8 reg, u8 value) {
struct xonar_pcm179x *data = chip->model_data;
if (value != data->cs2000_regs[reg])
cs2000_write(chip, reg, value);
} | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/xonar_pcm179x.c |
static void pcm1796_init(struct oxygen *chip) {
struct xonar_pcm179x *data = chip->model_data;
data->pcm1796_regs[0][18 - PCM1796_REG_BASE] =
PCM1796_FMT_24_I2S | PCM1796_ATLD;
if (!data->broken_i2c)
data->pcm1796_regs[0][18 - PCM1796_REG_BASE] |= PCM1796_MUTE;
data->pcm1796_regs[0][19 - PCM1796_REG... | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/xonar_pcm179x.c |
static void xonar_d2_init(struct oxygen *chip) {
struct xonar_pcm179x *data = chip->model_data;
data->generic.anti_pop_delay = 300;
data->generic.output_enable_bit = GPIO_D2_OUTPUT_ENABLE;
data->dacs = 4;
pcm1796_init(chip);
oxygen_set_bits16(chip, OXYGEN_GPIO_CONTROL, GPIO_D2_ALT);
oxygen_clear_bits1... | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/xonar_pcm179x.c |
static void xonar_hdav_init(struct oxygen *chip) {
struct xonar_hdav *data = chip->model_data;
oxygen_write16(chip, OXYGEN_2WIRE_BUS_STATUS,
OXYGEN_2WIRE_LENGTH_8 | OXYGEN_2WIRE_INTERRUPT_MASK |
OXYGEN_2WIRE_SPEED_STANDARD);
data->pcm179x.generic.anti_pop_delay = 100;
da... | [
1,
0
] |
Linux Kernel | sound/pci/oxygen/xonar_pcm179x.c | static void cs2000_registers_init(struct oxygen *chip) {
struct xonar_pcm179x *data = chip->model_data;
cs2000_write(chip, CS2000_GLOBAL_CFG, CS2000_FREEZE);
cs2000_write(chip, CS2000_DEV_CTRL, 0);
cs2000_write(chip, CS2000_DEV_CFG_1,
CS2000_R_MOD_SEL_1 | (0 << CS2000_R_SEL_SHIFT) |
... | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/xonar_pcm179x.c |
static void xonar_xense_init(struct oxygen *chip) {
struct xonar_pcm179x *data = chip->model_data;
data->generic.ext_power_reg = OXYGEN_GPI_DATA;
data->generic.ext_power_int_reg = OXYGEN_GPI_INTERRUPT_MASK;
data->generic.ext_power_bit = GPI_EXT_POWER;
xonar_init_ext_power(chip);
data->generic.anti_pop_de... | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/xonar_pcm179x.c |
static void xonar_d2_cleanup(struct oxygen *chip) {
xonar_disable_output(chip);
} | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/xonar_pcm179x.c |
static void xonar_d2_suspend(struct oxygen *chip) { xonar_d2_cleanup(chip); } | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/xonar_pcm179x.c |
static void xonar_st_resume(struct oxygen *chip) {
cs2000_registers_init(chip);
xonar_stx_resume(chip);
} | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/xonar_pcm179x.c |
static void update_pcm1796_volume(struct oxygen *chip) {
struct xonar_pcm179x *data = chip->model_data;
unsigned int i;
s8 gain_offset;
gain_offset = data->hp_active ? data->hp_gain_offset : 0;
for (i = 0; i < data->dacs; ++i) {
pcm1796_write_cached(chip, i, 16, chip->dac_volume[i * 2] + gain_offset);
... | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/xonar_pcm179x.c |
static int rolloff_get(struct snd_kcontrol *ctl,
struct snd_ctl_elem_value *value) {
struct oxygen *chip = ctl->private_data;
struct xonar_pcm179x *data = chip->model_data;
value->value.enumerated.item[0] =
(data->pcm1796_regs[0][19 - PCM1796_REG_BASE] & PCM1796_FLT_MASK) !=
P... | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/xonar_pcm179x.c |
static int st_output_switch_info(struct snd_kcontrol *ctl,
struct snd_ctl_elem_info *info) {
static const char *const names[3] = {"Speakers", "Headphones",
"FP Headphones"};
return snd_ctl_enum_info(info, 1, 3, names);
} | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/xonar_pcm179x.c |
static int st_hp_volume_offset_put(struct snd_kcontrol *ctl,
struct snd_ctl_elem_value *value) {
static const s8 offsets[] = {2 * -18, 2 * -12, 2 * -6, 0};
struct oxygen *chip = ctl->private_data;
struct xonar_pcm179x *data = chip->model_data;
s8 offset;
int changed;
if... | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/xonar_pcm179x.c |
static int xonar_hdav_mixer_init(struct oxygen *chip) {
int err;
err = snd_ctl_add(chip->card, snd_ctl_new1(&hdav_hdmi_control, chip));
if (err < 0)
return err;
err = add_pcm1796_controls(chip);
if (err < 0)
return err;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/xonar_wm87x6.c |
static void wm8776_write_spi(struct oxygen *chip, unsigned int reg,
unsigned int value) {
oxygen_write_spi(chip,
OXYGEN_SPI_TRIGGER | OXYGEN_SPI_DATA_LENGTH_2 |
OXYGEN_SPI_CLOCK_160 | (1 << OXYGEN_SPI_CODEC_SHIFT) |
OXYGEN_... | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/xonar_wm87x6.c | static void wm8776_write(struct oxygen *chip, unsigned int reg,
unsigned int value) {
struct xonar_wm87x6 *data = chip->model_data;
if ((chip->model.function_flags & OXYGEN_FUNCTION_2WIRE_SPI_MASK) ==
OXYGEN_FUNCTION_SPI)
wm8776_write_spi(chip, reg, value);
else
wm8776_writ... | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/xonar_wm87x6.c |
static void wm8776_init(struct oxygen *chip) {
struct xonar_wm87x6 *data = chip->model_data;
data->wm8776_regs[WM8776_HPLVOL] = (0x79 - 60) | WM8776_HPZCEN;
data->wm8776_regs[WM8776_HPRVOL] = (0x79 - 60) | WM8776_HPZCEN;
data->wm8776_regs[WM8776_ADCIFCTRL] =
WM8776_ADCFMT_LJUST | WM8776_ADCWL_24 | WM877... | [
1,
0
] |
Linux Kernel | sound/pci/oxygen/xonar_wm87x6.c |
static void wm8766_init(struct oxygen *chip) {
struct xonar_wm87x6 *data = chip->model_data;
data->wm8766_regs[WM8766_DAC_CTRL] =
WM8766_PL_LEFT_LEFT | WM8766_PL_RIGHT_RIGHT;
wm8766_registers_init(chip);
} | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/xonar_wm87x6.c |
static void set_wm87x6_dac_params(struct oxygen *chip,
struct snd_pcm_hw_params *params) {} | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/xonar_wm87x6.c |
static void update_wm8776_volume(struct oxygen *chip) {
struct xonar_wm87x6 *data = chip->model_data;
u8 to_change;
if (chip->dac_volume[0] == chip->dac_volume[1]) {
if (chip->dac_volume[0] != data->wm8776_regs[WM8776_DACLVOL] ||
chip->dac_volume[1] != data->wm8776_regs[WM8776_DACRVOL]) {
wm87... | [
1,
0
] |
Linux Kernel | sound/pci/oxygen/xonar_wm87x6.c |
static void update_wm87x6_mute(struct oxygen *chip) {
update_wm8776_mute(chip);
wm8766_write_cached(chip, WM8766_DAC_CTRL2,
WM8766_ZCD | (chip->dac_mute ? WM8766_DMUTE_MASK : 0));
} | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/xonar_wm87x6.c |
static int wm8776_field_volume_info(struct snd_kcontrol *ctl,
struct snd_ctl_elem_info *info) {
info->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
info->count = 1;
info->value.integer.min = (ctl->private_value >> 8) & 0xf;
info->value.integer.max = (ctl->private_value >> 12) & 0xf;
... | [
1,
0
] |
Linux Kernel | sound/pci/oxygen/xonar_wm87x6.c |
static void wm8776_field_set_from_ctl(struct snd_kcontrol *ctl) {
struct oxygen *chip = ctl->private_data;
struct xonar_wm87x6 *data = chip->model_data;
unsigned int value, reg_index, mode;
u8 min, max, shift;
u16 mask, reg_value;
bool invert;
if ((data->wm8776_regs[WM8776_ALCCTRL1] & WM8776_LCSEL_MASK)... | [
1,
0
] |
Linux Kernel | sound/pci/oxygen/xonar_wm87x6.c |
static int wm8776_field_enum_put(struct snd_kcontrol *ctl,
struct snd_ctl_elem_value *value) {
return wm8776_field_set(ctl, value->value.enumerated.item[0]);
} | [
0,
0
] |
Linux Kernel | sound/pci/oxygen/xonar_wm87x6.c | static int wm8776_input_mux_put(struct snd_kcontrol *ctl,
struct snd_ctl_elem_value *value) {
struct oxygen *chip = ctl->private_data;
struct xonar_wm87x6 *data = chip->model_data;
struct snd_kcontrol *other_ctl;
unsigned int mux_bit = ctl->private_value;
u16 reg;
int changed... | [
1,
0
] |
Linux Kernel | sound/pci/oxygen/xonar_wm87x6.c |
static int wm8776_input_vol_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 = 0xa5;
info->value.integer.max = 0xff;
return 0;
} | [
1,
0
] |
Linux Kernel | sound/pci/oxygen/xonar_wm87x6.c |
static void activate_control(struct oxygen *chip, struct snd_kcontrol *ctl,
unsigned int mode) {
unsigned int access;
if (ctl->private_value & mode)
access = 0;
else
access = SNDRV_CTL_ELEM_ACCESS_INACTIVE;
if ((ctl->vd[0].access & SNDRV_CTL_ELEM_ACCESS_INACTIVE) != access... | [
1,
0
] |
Linux Kernel | sound/pci/oxygen/xonar_wm87x6.c |
static int xonar_hdav_slim_mixer_init(struct oxygen *chip) {
unsigned int i;
struct snd_kcontrol *ctl;
int err;
for (i = 0; i < ARRAY_SIZE(hdav_slim_controls); ++i) {
ctl = snd_ctl_new1(&hdav_slim_controls[i], chip);
if (!ctl)
return -ENOMEM;
err = snd_ctl_add(chip->card, ctl);
if (err <... | [
0,
0
] |
Linux Kernel | sound/pci/pcxhr/pcxhr.c |
static int pcxhr_pll_freq_register(unsigned int freq, unsigned int *pllreg,
unsigned int *realfreq) {
unsigned int reg;
if (freq < 6900 || freq > 110000)
return -EINVAL;
reg = (28224000 * 2) / freq;
reg = (reg - 1) / 2;
if (reg < 0x200)
*pllreg = reg + 0x800;
els... | [
1,
0
] |
Linux Kernel | sound/pci/pcxhr/pcxhr.c |
int pcxhr_get_external_clock(struct pcxhr_mgr *mgr,
enum pcxhr_clock_type clock_type,
int *sample_rate) {
if (mgr->is_hr_stereo)
return hr222_get_external_clock(mgr, clock_type, sample_rate);
else
return pcxhr_sub_get_external_clock(mgr, clock_type... | [
0,
0
] |
Linux Kernel | sound/pci/pcxhr/pcxhr.c | static int pcxhr_trigger(struct snd_pcm_substream *subs, int cmd) {
struct pcxhr_stream *stream;
struct snd_pcm_substream *s;
struct snd_pcxhr *chip = snd_pcm_substream_chip(subs);
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
dev_dbg(chip->card->dev, "SNDRV_PCM_TRIGGER_START\n");
if (snd_pcm_stream_l... | [
1,
1
] |
Linux Kernel | sound/pci/pcxhr/pcxhr.c | int pcxhr_create_pcm(struct snd_pcxhr *chip) {
int err;
struct snd_pcm *pcm;
char name[32];
snprintf(name, sizeof(name), "pcxhr %d", chip->chip_idx);
err = snd_pcm_new(chip->card, name, 0, chip->nb_streams_play,
chip->nb_streams_capt, &pcm);
if (err < 0) {
dev_err(chip->card->dev, "... | [
1,
0
] |
Linux Kernel | sound/pci/pcxhr/pcxhr.c | static void pcxhr_proc_gpo_write(struct snd_info_entry *entry,
struct snd_info_buffer *buffer) {
struct snd_pcxhr *chip = entry->private_data;
struct pcxhr_mgr *mgr = chip->mgr;
char line[64];
int value;
if (!(mgr->dsp_loaded & (1 << PCXHR_FIRMWARE_DSP_MAIN_INDEX)))
retur... | [
1,
0
] |
Linux Kernel | sound/pci/pcxhr/pcxhr_core.c | void pcxhr_enable_dsp(struct pcxhr_mgr *mgr) { pcxhr_enable_irq(mgr, 1); } | [
0,
0
] |
Linux Kernel | sound/pci/pcxhr/pcxhr_core.c | int pcxhr_load_xilinx_binary(struct pcxhr_mgr *mgr,
const struct firmware *xilinx, int second) {
unsigned int i;
unsigned int chipsc;
unsigned char data;
unsigned char mask;
const unsigned char *image;
chipsc = PCXHR_INPL(mgr, PCXHR_PLX_CHIPSC);
/* REV01 cards do not support ... | [
1,
0
] |
Linux Kernel | sound/pci/pcxhr/pcxhr_core.c | int pcxhr_load_boot_binary(struct pcxhr_mgr *mgr, const struct firmware *boot) {
int err;
unsigned int physaddr = mgr->hostport.addr;
unsigned char dummy;
if (snd_BUG_ON(physaddr & 0xff))
return -EINVAL;
PCXHR_OUTPL(mgr, PCXHR_PLX_MBOX1, (physaddr >> 8));
err = pcxhr_send_it_dsp(mgr, PCXHR_IT_DOWNLOAD... | [
1,
0
] |
Linux Kernel | sound/pci/pcxhr/pcxhr_core.c | int pcxhr_load_dsp_binary(struct pcxhr_mgr *mgr, const struct firmware *dsp) {
int err;
unsigned char dummy;
err = pcxhr_send_it_dsp(mgr, PCXHR_IT_RESET_BOARD_FUNC, 0);
if (err)
return err;
err = pcxhr_send_it_dsp(mgr, PCXHR_IT_DOWNLOAD_DSP, 0);
if (err)
return err;
err = pcxhr_download_dsp(mgr, d... | [
0,
0
] |
Linux Kernel | sound/pci/pcxhr/pcxhr_core.c | void pcxhr_init_rmh(struct pcxhr_rmh *rmh, int cmd) {
if (snd_BUG_ON(cmd >= CMD_LAST_INDEX))
return;
rmh->cmd[0] = pcxhr_dsp_cmds[cmd].opcode;
rmh->cmd_len = 1;
rmh->stat_len = pcxhr_dsp_cmds[cmd].st_length;
rmh->dsp_stat = pcxhr_dsp_cmds[cmd].st_type;
rmh->cmd_idx = cmd;
} | [
0,
0
] |
Linux Kernel | sound/pci/pcxhr/pcxhr_core.c | void pcxhr_set_pipe_cmd_params(struct pcxhr_rmh *rmh, int capture,
unsigned int param1, unsigned int param2,
unsigned int param3) {
snd_BUG_ON(param1 > MASK_FIRST_FIELD);
if (capture)
rmh->cmd[0] |= 0x800;
if (param1)
rmh->cmd[0] |= (param1 << ... | [
1,
0
] |
Linux Kernel | sound/pci/pcxhr/pcxhr_core.c | static inline int pcxhr_pipes_running(struct pcxhr_mgr *mgr) {
int start_mask = PCXHR_INPL(mgr, PCXHR_PLX_MBOX2);
start_mask &= 0xffffff;
dev_dbg(&mgr->pci->dev, "CMD_PIPE_STATE MBOX2=0x%06x\n", start_mask);
return start_mask;
} | [
1,
0
] |
Linux Kernel | sound/pci/pcxhr/pcxhr_core.c | static int pcxhr_stop_pipes(struct pcxhr_mgr *mgr, int audio_mask) {
struct pcxhr_rmh rmh;
int err;
int audio = 0;
while (audio_mask) {
if (audio_mask & 1) {
pcxhr_init_rmh(&rmh, CMD_STOP_PIPE);
if (audio < PCXHR_PIPE_STATE_CAPTURE_OFFSET) {
pcxhr_set_pipe_cmd_params(&rmh, 0, audio, 0,... | [
1,
0
] |
Linux Kernel | sound/pci/pcxhr/pcxhr_core.c | static u_int64_t pcxhr_stream_read_position(struct pcxhr_mgr *mgr,
struct pcxhr_stream *stream) {
u_int64_t hw_sample_count;
struct pcxhr_rmh rmh;
int err, stream_mask;
stream_mask = stream->pipe->is_capture ? 1 : 1 << stream->substream->number;
pcxhr_init_rmh(&rm... | [
1,
0
] |
Linux Kernel | sound/pci/pcxhr/pcxhr_core.c | irqreturn_t pcxhr_interrupt(int irq, void *dev_id) {
struct pcxhr_mgr *mgr = dev_id;
unsigned int reg;
bool wake_thread = false;
reg = PCXHR_INPL(mgr, PCXHR_PLX_IRQCS);
if (!(reg & PCXHR_IRQCS_ACTIVE_PCIDB)) {
return IRQ_NONE;
}
/* clear interrupt */
reg = PCXHR_INPL(mgr, PCXHR_PLX_L2PCIDB);
PC... | [
0,
0
] |
Linux Kernel | sound/pci/pcxhr/pcxhr_hwdep.c | int pcxhr_setup_firmware(struct pcxhr_mgr *mgr) {
static const char *const fw_files[][5] = {
[0] = {"xlxint.dat", "xlxc882hr.dat", "dspe882.e56", "dspb882hr.b56",
"dspd882.d56"},
[1] = {"xlxint.dat", "xlxc882e.dat", "dspe882.e56", "dspb882e.b56",
"dspd882.d56"},
[2] = {"xlx... | [
1,
0
] |
Linux Kernel | sound/pci/pcxhr/pcxhr_mix22.c | static void hr222_config_akm(struct pcxhr_mgr *mgr, unsigned short data) {
unsigned short mask = 0x8000;
PCXHR_INPB(mgr, PCXHR_XLX_HIFREQ);
while (mask) {
PCXHR_OUTPB(mgr, PCXHR_XLX_DATA, data & mask ? PCXHR_DATA_CODEC : 0);
mask >>= 1;
}
/* termiate access to codec registers */
PCXHR_INPB(mgr, PC... | [
1,
0
] |
Linux Kernel | sound/pci/pcxhr/pcxhr_mix22.c | static int hr222_set_hw_playback_level(struct pcxhr_mgr *mgr, int idx,
int level) {
unsigned short cmd;
if (idx > 1 || level < 0 || level >= ARRAY_SIZE(g_hr222_p_level))
return -EINVAL;
if (idx == 0)
cmd = AKM_LEFT_LEVEL_CMD;
else
cmd = AKM_RIGHT_LEVEL_CMD;
... | [
0,
0
] |
Linux Kernel | sound/pci/pcxhr/pcxhr_mix22.c | static int hr222_set_hw_capture_level(struct pcxhr_mgr *mgr, int level_l,
int level_r, int level_mic) {
unsigned int data;
int i;
if (!mgr->capture_chips)
return -EINVAL; /* no PCX22 */
data = ((level_mic & 0xff) << 24); /* micro is mono, but apply */
data |= ((le... | [
1,
0
] |
Linux Kernel | sound/pci/pcxhr/pcxhr_mix22.c | int hr222_sub_init(struct pcxhr_mgr *mgr) {
unsigned char reg;
mgr->board_has_analog = 1;
mgr->xlx_cfg = PCXHR_CFG_SYNCDSP_MASK;
reg = PCXHR_INPB(mgr, PCXHR_XLX_STATUS);
if (reg & PCXHR_STAT_MIC_CAPS)
mgr->board_has_mic = 1; /* microphone available */
dev_dbg(&mgr->pci->dev, "MIC input available = %d\... | [
0,
0
] |
Linux Kernel | sound/pci/pcxhr/pcxhr_mix22.c | int hr222_update_analog_audio_level(struct snd_pcxhr *chip, int is_capture,
int channel) {
dev_dbg(chip->card->dev, "hr222_update_analog_audio_level(%s chan=%d)\n",
is_capture ? "capture" : "playback", channel);
if (is_capture) {
int level_l, level_r, level_mic;
... | [
0,
0
] |
Linux Kernel | sound/pci/pcxhr/pcxhr_mix22.c | int hr222_set_audio_source(struct snd_pcxhr *chip) {
int digital = 0;
chip->mgr->xlx_cfg &= ~(PCXHR_CFG_SRC_MASK | PCXHR_CFG_DATAIN_SEL_MASK |
PCXHR_CFG_DATA_UER1_SEL_MASK);
if (chip->audio_capture_source == SOURCE_DIGISRC) {
chip->mgr->xlx_cfg |= PCXHR_CFG_SRC_MASK;
digital = ... | [
1,
0
] |
Linux Kernel | sound/pci/pcxhr/pcxhr_mix22.c | int hr222_iec958_capture_byte(struct snd_pcxhr *chip, int aes_idx,
unsigned char *aes_bits) {
unsigned char idx = (unsigned char)(aes_idx * 8);
unsigned char temp = 0;
unsigned char mask = chip->mgr->board_has_aes1 ? PCXHR_SUER1_BIT_C_READ_MASK
... | [
1,
0
] |
Linux Kernel | sound/pci/pcxhr/pcxhr_mix22.c | int hr222_iec958_update_byte(struct snd_pcxhr *chip, int aes_idx,
unsigned char aes_bits) {
int i;
unsigned char new_bits = aes_bits;
unsigned char old_bits = chip->aes_bits[aes_idx];
unsigned char idx = (unsigned char)(aes_idx * 8);
for (i = 0; i < 8; i++) {
if ((old_bits & 0... | [
1,
0
] |
Linux Kernel | sound/pci/pcxhr/pcxhr_mix22.c |
static int hr222_mic_vol_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_pcxhr *chip = snd_kcontrol_chip(kcontrol);
mutex_lock(&chip->mgr->mixer_mutex);
ucontrol->value.integer.value[0] = chip->mic_volume;
mutex_unlock(&chip->mgr->mixer_mutex);
... | [
0,
0
] |
Linux Kernel | sound/pci/pcxhr/pcxhr_mix22.c |
static int hr222_mic_vol_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_pcxhr *chip = snd_kcontrol_chip(kcontrol);
int changed = 0;
mutex_lock(&chip->mgr->mixer_mutex);
if (chip->mic_volume != ucontrol->value.integer.value[0]) {
changed = 1... | [
0,
0
] |
Linux Kernel | sound/pci/pcxhr/pcxhr_mix22.c |
static int hr222_mic_boost_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_pcxhr *chip = snd_kcontrol_chip(kcontrol);
mutex_lock(&chip->mgr->mixer_mutex);
ucontrol->value.integer.value[0] = chip->mic_boost;
mutex_unlock(&chip->mgr->mixer_mutex... | [
0,
0
] |
Linux Kernel | sound/pci/pcxhr/pcxhr_mix22.c |
static int hr222_phantom_power_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_pcxhr *chip = snd_kcontrol_chip(kcontrol);
mutex_lock(&chip->mgr->mixer_mutex);
ucontrol->value.integer.value[0] = chip->phantom_power;
mutex_unlock(&chip->mgr-... | [
0,
0
] |
Linux Kernel | sound/pci/pcxhr/pcxhr_mix22.c |
static int hr222_phantom_power_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_pcxhr *chip = snd_kcontrol_chip(kcontrol);
int power, changed = 0;
mutex_lock(&chip->mgr->mixer_mutex);
power = !!ucontrol->value.integer.value[0];
if (chip-... | [
0,
0
] |
Linux Kernel | sound/pci/pcxhr/pcxhr_mixer.c | static int pcxhr_update_analog_audio_level(struct snd_pcxhr *chip,
int is_capture, int channel) {
int err, vol;
struct pcxhr_rmh rmh;
pcxhr_init_rmh(&rmh, CMD_ACCESS_IO_WRITE);
if (is_capture) {
rmh.cmd[0] |= IO_NUM_REG_IN_ANA_LEVEL;
rmh.cmd[2] = chip->analog_... | [
0,
0
] |
Linux Kernel | sound/pci/pcxhr/pcxhr_mixer.c |
static int pcxhr_audio_sw_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_pcxhr *chip = snd_kcontrol_chip(kcontrol);
mutex_lock(&chip->mgr->mixer_mutex);
ucontrol->value.integer.value[0] = chip->analog_playback_active[0];
ucontrol->value.integ... | [
0,
0
] |
Linux Kernel | sound/pci/pcxhr/pcxhr_mixer.c | static int pcxhr_update_audio_pipe_level(struct snd_pcxhr *chip, int capture,
int channel) {
int err;
struct pcxhr_rmh rmh;
struct pcxhr_pipe *pipe;
if (capture)
pipe = &chip->capture_pipe[0];
else
pipe = &chip->playback_pipe;
pcxhr_init_rmh(&rmh, CMD_AUDIO... | [
0,
1
] |
Linux Kernel | sound/pci/pcxhr/pcxhr_mixer.c | static int pcxhr_digital_vol_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo) {
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 2;
uinfo->value.integer.min = PCXHR_DIGITAL_LEVEL_MIN;
uinfo->value.integer.max = PCXHR_DIGITAL_LEVEL_MAX; /* 18.0 dB ... | [
0,
0
] |
Linux Kernel | sound/pci/pcxhr/pcxhr_mixer.c | static int pcxhr_pcm_sw_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_pcxhr *chip = snd_kcontrol_chip(kcontrol);
int changed = 0;
int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
int i, j;
mutex_lock(&chip->mgr->mixer_mutex);
j = idx... | [
0,
0
] |
Linux Kernel | sound/pci/pcxhr/pcxhr_mixer.c | static int pcxhr_monitor_vol_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_pcxhr *chip = snd_kcontrol_chip(kcontrol);
mutex_lock(&chip->mgr->mixer_mutex);
ucontrol->value.integer.value[0] = chip->monitoring_volume[0];
ucontrol->value.intege... | [
0,
0
] |
Linux Kernel | sound/pci/pcxhr/pcxhr_mixer.c | static int pcxhr_clock_type_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo) {
static const char *textsPCXHR[7] = {
"Internal", "WordClock", "AES Sync", "AES 1", "AES 2", "AES 3", "AES 4"};
static const char *textsHR22[3] = {"Internal", "AES Sync", "AES 1"}... | [
0,
0
] |
Linux Kernel | sound/pci/pcxhr/pcxhr_mixer.c |
static int pcxhr_clock_type_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct pcxhr_mgr *mgr = snd_kcontrol_chip(kcontrol);
ucontrol->value.enumerated.item[0] = mgr->use_clock_type;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/pci/pcxhr/pcxhr_mixer.c | static int pcxhr_iec958_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_pcxhr *chip = snd_kcontrol_chip(kcontrol);
unsigned char aes_bits;
int i, err;
mutex_lock(&chip->mgr->mixer_mutex);
for (i = 0; i < 5; i++) {
if (kcontrol->private_valu... | [
1,
0
] |
Linux Kernel | sound/pci/pcxhr/pcxhr_mixer.c | static int pcxhr_iec958_update_byte(struct snd_pcxhr *chip, int aes_idx,
unsigned char aes_bits) {
int i, err, cmd;
unsigned char new_bits = aes_bits;
unsigned char old_bits = chip->aes_bits[aes_idx];
struct pcxhr_rmh rmh;
for (i = 0; i < 8; i++) {
if ((old_bits & 0x01... | [
1,
0
] |
Linux Kernel | sound/pci/riptide/riptide.c |
static u32 atoh(const unsigned char *in, unsigned int len) {
u32 sum = 0;
unsigned int mult = 1;
unsigned char c;
while (len) {
int value;
c = in[len - 1];
value = hex_to_bin(c);
if (value >= 0)
sum += mult * value;
mult *= 16;
--len;
}
return sum;
} | [
1,
0
] |
Linux Kernel | sound/pci/riptide/riptide.c |
static void alloclbuspath(struct cmdif *cif, unsigned char source,
const unsigned char *path, unsigned char *mixer,
unsigned char *s) {
while (*path != 0xff) {
unsigned char sink, type;
sink = *path & (~SPLIT_PATH);
if (sink != E2SINK_MAX) {
snd_... | [
1,
0
] |
Linux Kernel | sound/pci/riptide/riptide.c |
static void freelbuspath(struct cmdif *cif, unsigned char source,
const unsigned char *path) {
while (*path != 0xff) {
unsigned char sink;
sink = *path & (~SPLIT_PATH);
if (sink != E2SINK_MAX) {
snd_printdd("free path 0x%x->0x%x\n", source, sink);
SEND_PCLR(cif, sour... | [
1,
0
] |
Linux Kernel | sound/pci/riptide/riptide.c |
static int getsourcesink(struct cmdif *cif, unsigned char source,
unsigned char sink, unsigned char *a,
unsigned char *b) {
union cmdret rptr = CMDRET_ZERO;
if (SEND_RSSV(cif, source, sink, &rptr) &&
SEND_RSSV(cif, source, sink, &rptr))
return -EIO;
*a... | [
0,
0
] |
Linux Kernel | sound/pci/riptide/riptide.c |
static int getmixer(struct cmdif *cif, short num, unsigned short *rval,
unsigned short *lval) {
union cmdret rptr = CMDRET_ZERO;
if (SEND_RDGV(cif, num, num, &rptr) && SEND_RDGV(cif, num, num, &rptr))
return -EIO;
*rval = rptr.retwords[0];
*lval = rptr.retwords[1];
snd_printdd("got m... | [
0,
0
] |
Linux Kernel | sound/pci/riptide/riptide.c | static int riptide_suspend(struct device *dev) {
struct snd_card *card = dev_get_drvdata(dev);
struct snd_riptide *chip = card->private_data;
chip->in_suspend = 1;
snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
snd_ac97_suspend(chip->ac97);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/pci/riptide/riptide.c |
static int snd_riptide_playback_close(struct snd_pcm_substream *substream) {
struct snd_riptide *chip = snd_pcm_substream_chip(substream);
struct pcmhw *data = get_pcmhwdev(substream);
int sub_num = substream->number;
substream->runtime->private_data = NULL;
chip->playback_substream[sub_num] = NULL;
kfree... | [
0,
0
] |
Linux Kernel | sound/pci/riptide/riptide.c |
static int snd_riptide_initialize(struct snd_riptide *chip) {
struct cmdif *cif;
unsigned int device_id;
int err;
if (snd_BUG_ON(!chip))
return -EINVAL;
cif = chip->cif;
if (!cif) {
cif = kzalloc(sizeof(struct cmdif), GFP_KERNEL);
if (!cif)
return -ENOMEM;
cif->hwport = (struct ript... | [
1,
0
] |
Linux Kernel | sound/pci/riptide/riptide.c |
static int snd_riptide_mixer(struct snd_riptide *chip) {
struct snd_ac97_bus *pbus;
struct snd_ac97_template ac97;
int err = 0;
static const struct snd_ac97_bus_ops ops = {
.write = snd_riptide_codec_write,
.read = snd_riptide_codec_read,
};
memset(&ac97, 0, sizeof(ac97));
ac97.private_data ... | [
1,
0
] |
Linux Kernel | sound/pci/rme32.c |
static inline unsigned int snd_rme32_pcm_byteptr(struct rme32 *rme32) {
return (readl(rme32->iobase + RME32_IO_GET_POS) & RME32_RCR_AUDIO_ADDR_MASK);
} | [
0,
0
] |
Linux Kernel | sound/pci/rme32.c | static void snd_rme32_setframelog(struct rme32 *rme32, int n_channels,
int is_playback) {
int frlog;
if (n_channels == 2) {
frlog = 1;
} else {
frlog = 3;
}
if (is_playback) {
frlog += (rme32->wcreg & RME32_WCR_MODE24) ? 2 : 1;
rme32->playback_frlog = frlog;... | [
0,
0
] |
Linux Kernel | sound/pci/rme32.c |
static int snd_rme32_setformat(struct rme32 *rme32, snd_pcm_format_t format) {
switch (format) {
case SNDRV_PCM_FORMAT_S16_LE:
rme32->wcreg &= ~RME32_WCR_MODE24;
break;
case SNDRV_PCM_FORMAT_S32_LE:
rme32->wcreg |= RME32_WCR_MODE24;
break;
default:
return -EINVAL;
}
writel(rme32->wcreg,... | [
1,
0
] |
Linux Kernel | sound/pci/rme32.c |
static void snd_rme32_pcm_start(struct rme32 *rme32, int from_pause) {
if (!from_pause) {
writel(0, rme32->iobase + RME32_IO_RESET_POS);
}
rme32->wcreg |= RME32_WCR_START;
writel(rme32->wcreg, rme32->iobase + RME32_IO_CONTROL_REGISTER);
} | [
1,
0
] |
Linux Kernel | sound/pci/rme32.c |
static void snd_rme32_set_buffer_constraint(struct rme32 *rme32,
struct snd_pcm_runtime *runtime) {
if (!rme32->fullduplex_mode) {
snd_pcm_hw_constraint_single(runtime, SNDRV_PCM_HW_PARAM_BUFFER_BYTES,
RME32_BUFFER_SIZE);
snd_pcm_hw... | [
0,
0
] |
Linux Kernel | sound/pci/rme32.c |
static int snd_rme32_playback_close(struct snd_pcm_substream *substream) {
struct rme32 *rme32 = snd_pcm_substream_chip(substream);
int spdif = 0;
spin_lock_irq(&rme32->lock);
rme32->playback_substream = NULL;
rme32->playback_periodsize = 0;
spdif = (rme32->wcreg & RME32_WCR_ADAT) == 0;
spin_unlock_irq(... | [
1,
0
] |
Linux Kernel | sound/pci/rme32.c | static void snd_rme32_pb_trans_copy(struct snd_pcm_substream *substream,
struct snd_pcm_indirect *rec,
size_t bytes) {
struct rme32 *rme32 = snd_pcm_substream_chip(substream);
memcpy_toio(rme32->iobase + RME32_IO_DATA_BUFFER + rec->hw_data,
... | [
1,
0
] |
Linux Kernel | sound/pci/rme32.c |
static int snd_rme32_capture_fd_ack(struct snd_pcm_substream *substream) {
struct rme32 *rme32 = snd_pcm_substream_chip(substream);
return snd_pcm_indirect_capture_transfer(substream, &rme32->capture_pcm,
snd_rme32_cp_trans_copy);
} | [
0,
0
] |
Linux Kernel | sound/pci/rme32.c |
static void snd_rme32_free_spdif_pcm(struct snd_pcm *pcm) {
struct rme32 *rme32 = (struct rme32 *)pcm->private_data;
rme32->spdif_pcm = NULL;
} | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.