Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | sound/mips/hal2.c |
static inline u32 hal2_read(u32 *reg) { return __raw_readl(reg); } | [
0,
0
] |
Linux Kernel | sound/mips/hal2.c |
static inline void hal2_write(u32 val, u32 *reg) { __raw_writel(val, reg); } | [
0,
0
] |
Linux Kernel | sound/mips/hal2.c |
static void hal2_i_setbit16(struct snd_hal2 *hal2, u16 addr, u16 bit) {
struct hal2_ctl_regs *regs = hal2->ctl_regs;
hal2_write(H2_READ_ADDR(addr), ®s->iar);
H2_INDIRECT_WAIT(regs);
hal2_write((hal2_read(®s->idr0) & 0xffff) | bit, ®s->idr0);
hal2_write(0, ®s->idr1);
hal2_write(0, ®s->idr2);... | [
0,
0
] |
Linux Kernel | sound/mips/hal2.c |
static int hal2_gain_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 = 0;
switch ((int)kcontrol->private_value) {
case H2_MIX_OUTPUT_ATT:
uinfo->value.integer.max = 31;
... | [
1,
0
] |
Linux Kernel | sound/mips/hal2.c |
static int hal2_gain_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_hal2 *hal2 = snd_kcontrol_chip(kcontrol);
u32 old, new;
int l, r;
l = ucontrol->value.integer.value[0];
r = ucontrol->value.integer.value[1];
switch ((int)kcontrol->private_v... | [
0,
0
] |
Linux Kernel | sound/mips/hal2.c |
static void hal2_set_adc_rate(struct snd_hal2 *hal2) {
unsigned int master = hal2->adc.master;
int inc = hal2->adc.inc;
int mod = hal2->adc.mod;
hal2_i_write16(hal2, H2I_BRES2_C1, (master == 44100) ? 1 : 0);
hal2_i_write32(hal2, H2I_BRES2_C2, ((0xffff & (inc - mod - 1)) << 16) | inc);
} | [
1,
0
] |
Linux Kernel | sound/mips/hal2.c | static void hal2_start_adc(struct snd_hal2 *hal2) {
struct hal2_pbus *pbus = &hal2->adc.pbus;
pbus->pbus->pbdma_dptr = hal2->adc.desc_dma;
pbus->pbus->pbdma_ctrl = pbus->ctrl | HPC3_PDMACTRL_ACT;
hal2_i_setbit16(hal2, H2I_DMA_PORT_EN, H2I_DMA_PORT_EN_CODECR);
} | [
1,
0
] |
Linux Kernel | sound/mips/hal2.c |
static int hal2_playback_open(struct snd_pcm_substream *substream) {
struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_hal2 *hal2 = snd_pcm_substream_chip(substream);
runtime->hw = hal2_pcm_hw;
return hal2_alloc_dmabuf(hal2, &hal2->dac, DMA_TO_DEVICE);
} | [
0,
0
] |
Linux Kernel | sound/mips/hal2.c |
static int hal2_playback_trigger(struct snd_pcm_substream *substream, int cmd) {
struct snd_hal2 *hal2 = snd_pcm_substream_chip(substream);
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
hal2_start_dac(hal2);
break;
case SNDRV_PCM_TRIGGER_STOP:
hal2_stop_dac(hal2);
break;
default:
return -... | [
0,
0
] |
Linux Kernel | sound/mips/hal2.c |
static int hal2_playback_ack(struct snd_pcm_substream *substream) {
struct snd_hal2 *hal2 = snd_pcm_substream_chip(substream);
struct hal2_codec *dac = &hal2->dac;
return snd_pcm_indirect_playback_transfer(substream, &dac->pcm_indirect,
hal2_playback_transfer);
} | [
0,
0
] |
Linux Kernel | sound/mips/hal2.c |
static int hal2_capture_open(struct snd_pcm_substream *substream) {
struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_hal2 *hal2 = snd_pcm_substream_chip(substream);
runtime->hw = hal2_pcm_hw;
return hal2_alloc_dmabuf(hal2, &hal2->adc, DMA_FROM_DEVICE);
} | [
0,
0
] |
Linux Kernel | sound/mips/hal2.c | static int hal2_pcm_create(struct snd_hal2 *hal2) {
struct snd_pcm *pcm;
int err;
err = snd_pcm_new(hal2->card, "SGI HAL2 Audio", 0, 1, 1, &pcm);
if (err < 0)
return err;
pcm->private_data = hal2;
strcpy(pcm->name, "SGI HAL2");
/* set operators */
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &... | [
1,
0
] |
Linux Kernel | sound/mips/hal2.c |
static int hal2_remove(struct platform_device *pdev) {
struct snd_card *card = platform_get_drvdata(pdev);
snd_card_free(card);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/mips/sgio2audio.c | static int write_ad1843_reg(void *priv, int reg, int word) {
struct snd_sgio2audio *chip = priv;
int val;
unsigned long flags;
spin_lock_irqsave(&chip->ad1843_lock, flags);
writeq((reg << CODEC_CONTROL_ADDRESS_SHIFT) |
(word << CODEC_CONTROL_WORD_SHIFT),
&mace->perif.audio.codec_contro... | [
0,
0
] |
Linux Kernel | sound/mips/sgio2audio.c |
static int sgio2audio_gain_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo) {
struct snd_sgio2audio *chip = snd_kcontrol_chip(kcontrol);
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 2;
uinfo->value.integer.min = 0;
uinfo->value.integer.max =
... | [
0,
0
] |
Linux Kernel | sound/mips/sgio2audio.c |
static int sgio2audio_gain_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_sgio2audio *chip = snd_kcontrol_chip(kcontrol);
int newvol, oldvol;
oldvol = ad1843_get_gain(&chip->ad1843, kcontrol->private_value);
newvol = (ucontrol->value.integer... | [
0,
0
] |
Linux Kernel | sound/mips/sgio2audio.c | static int snd_sgio2audio_dma_push_frag(struct snd_sgio2audio *chip,
unsigned int ch, unsigned int count) {
int ret;
s64 l, r;
unsigned long dst_base, dst_pos, src_mask;
unsigned char *src_base;
int src_pos;
u64 *dst;
s16 *src;
unsigned long flags;
struct snd_pc... | [
1,
0
] |
Linux Kernel | sound/mips/sgio2audio.c | static int snd_sgio2audio_dma_start(struct snd_pcm_substream *substream) {
struct snd_sgio2audio *chip = snd_pcm_substream_chip(substream);
struct snd_sgio2audio_chan *chan = substream->runtime->private_data;
int ch = chan->idx;
writeq(CHANNEL_CONTROL_RESET, &mace->perif.audio.chan[ch].control);
udelay(10);
... | [
1,
0
] |
Linux Kernel | sound/mips/sgio2audio.c | static irqreturn_t snd_sgio2audio_dma_in_isr(int irq, void *dev_id) {
struct snd_sgio2audio_chan *chan = dev_id;
struct snd_pcm_substream *substream;
struct snd_sgio2audio *chip;
int count, ch;
substream = chan->substream;
chip = snd_pcm_substream_chip(substream);
ch = chan->idx;
count = CHANNEL_RING_... | [
0,
0
] |
Linux Kernel | sound/mips/sgio2audio.c |
static int snd_sgio2audio_playback2_open(struct snd_pcm_substream *substream) {
struct snd_sgio2audio *chip = snd_pcm_substream_chip(substream);
struct snd_pcm_runtime *runtime = substream->runtime;
runtime->hw = snd_sgio2audio_pcm_hw;
runtime->private_data = &chip->channel[2];
return 0;
} | [
0,
0
] |
Linux Kernel | sound/mips/snd-n64.c |
static u32 n64mi_read_reg(struct n64audio *priv, const u8 reg) {
return readl(priv->mi_reg_base + reg);
} | [
0,
0
] |
Linux Kernel | sound/mips/snd-n64.c |
static int n64audio_pcm_open(struct snd_pcm_substream *substream) {
struct snd_pcm_runtime *runtime = substream->runtime;
int err;
runtime->hw = n64audio_pcm_hw;
err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS);
if (err < 0)
return err;
err =
snd_pcm_hw_constraint_step(r... | [
0,
0
] |
Linux Kernel | sound/mips/snd-n64.c |
static snd_pcm_uframes_t
n64audio_pcm_pointer(struct snd_pcm_substream *substream) {
struct n64audio *priv = substream->pcm->private_data;
return bytes_to_frames(substream->runtime, priv->chan.pos);
} | [
1,
0
] |
Linux Kernel | sound/mips/snd-n64.c |
static int n64audio_pcm_close(struct snd_pcm_substream *substream) {
struct n64audio *priv = substream->pcm->private_data;
priv->chan.substream = NULL;
return 0;
} | [
1,
0
] |
Linux Kernel | sound/oss/dmasound/dmasound.h |
static inline int dmasound_set_bass(int bass) {
return dmasound.mach.setBass ? dmasound.mach.setBass(bass) : 50;
} | [
0,
0
] |
Linux Kernel | sound/oss/dmasound/dmasound_atari.c |
static ssize_t ata_ct_u16le(const u_char __user *userPtr, size_t userCount,
u_char frame[], ssize_t *frameUsed,
ssize_t frameLeft) {
ssize_t count, used;
count = frameLeft;
if (!dmasound.soft.stereo) {
u_short *p = (u_short *)&frame[*frameUsed];
c... | [
1,
0
] |
Linux Kernel | sound/oss/dmasound/dmasound_atari.c | static ssize_t ata_ctx_s8(const u_char __user *userPtr, size_t userCount,
u_char frame[], ssize_t *frameUsed,
ssize_t frameLeft) {
long bal = expand_bal;
long hSpeed = dmasound.hard.speed, sSpeed = dmasound.soft.speed;
ssize_t used, usedf;
used = userCount;
... | [
1,
0
] |
Linux Kernel | sound/oss/dmasound/dmasound_atari.c |
static int AtaSetBass(int bass) {
dmasound.bass = TONE_VOXWARE_TO_DB(bass);
atari_microwire_cmd(MW_LM1992_BASS(dmasound.bass));
return TONE_DB_TO_VOXWARE(dmasound.bass);
} | [
0,
0
] |
Linux Kernel | sound/oss/dmasound/dmasound_atari.c | static void TTSilence(void) {
tt_dmasnd.ctrl = DMASND_CTRL_OFF;
atari_microwire_cmd(MW_LM1992_PSG_HIGH);
} | [
0,
0
] |
Linux Kernel | sound/oss/dmasound/dmasound_atari.c |
static int TTSetVolume(int volume) {
dmasound.volume_left = VOLUME_VOXWARE_TO_DB(volume & 0xff);
atari_microwire_cmd(MW_LM1992_BALLEFT(dmasound.volume_left));
dmasound.volume_right = VOLUME_VOXWARE_TO_DB((volume & 0xff00) >> 8);
atari_microwire_cmd(MW_LM1992_BALRIGHT(dmasound.volume_right));
return VOLUME_D... | [
0,
0
] |
Linux Kernel | sound/oss/dmasound/dmasound_atari.c |
static void __init FalconMixerInit(void) {
dmasound.volume_left = (tt_dmasnd.output_atten & 0xf00) >> 8;
dmasound.volume_right = (tt_dmasnd.output_atten & 0xf0) >> 4;
} | [
0,
0
] |
Linux Kernel | sound/oss/dmasound/dmasound_atari.c |
static int TTMixerIoctl(u_int cmd, u_long arg) {
int data;
switch (cmd) {
case SOUND_MIXER_READ_RECMASK:
return IOCTL_OUT(arg, 0);
case SOUND_MIXER_READ_DEVMASK:
return IOCTL_OUT(arg, SOUND_MASK_VOLUME | SOUND_MASK_TREBLE |
SOUND_MASK_BASS |
... | [
1,
0
] |
Linux Kernel | sound/oss/dmasound/dmasound_atari.c |
static int AtaWriteSqSetup(void) {
write_sq_ignore_int = 0;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/oss/dmasound/dmasound_atari.c |
static int AtaSqOpen(fmode_t mode) {
write_sq_ignore_int = 1;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/oss/dmasound/dmasound_atari.c | static int __init dmasound_atari_init(void) {
if (MACH_IS_ATARI && ATARIHW_PRESENT(PCM_8BIT)) {
if (ATARIHW_PRESENT(CODEC)) {
dmasound.mach = machFalcon;
dmasound.mach.default_soft = def_soft;
dmasound.mach.default_hard = def_hard_falcon;
is_falcon = 1;
} else if (ATARIHW_PRESENT(MICRO... | [
1,
0
] |
Linux Kernel | sound/oss/dmasound/dmasound_core.c | static inline void sound_silence(void) { dmasound.mach.silence(); } | [
0,
0
] |
Linux Kernel | sound/oss/dmasound/dmasound_core.c |
static int sq_allocate_buffers(struct sound_queue *sq, int num, int size) {
int i;
if (sq->buffers)
return 0;
sq->numBufs = num;
sq->bufSize = size;
sq->buffers = kmalloc_array(num, sizeof(char *), GFP_KERNEL);
if (!sq->buffers)
return -ENOMEM;
for (i = 0; i < num; i++) {
sq->buffers[i] = dm... | [
1,
0
] |
Linux Kernel | sound/oss/dmasound/dmasound_core.c | static void sq_reset_output(void) {
sound_silence();
write_sq.active = 0;
write_sq.count = 0;
write_sq.rear_size = 0;
/* write_sq.front = (write_sq.rear+1) % write_sq.max_count;*/
write_sq.front = 0;
write_sq.rear = -1; /* same as for set-up */
/* OK - we can unlock the parameters and fragment settings... | [
0,
0
] |
Linux Kernel | sound/oss/dmasound/dmasound_core.c | static int sq_fsync(void) {
int rc = 0;
int timeout = 5;
write_sq.syncing |= 1;
sq_play();
while (write_sq.active) {
wait_event_interruptible_timeout(write_sq.sync_queue, !write_sq.active, HZ);
if (signal_pending(current)) {
/* While waiting for audio output to drain, an
* interrupt occ... | [
0,
0
] |
Linux Kernel | sound/oss/dmasound/dmasound_core.c | static int shared_resources_are_mine(fmode_t md) {
if (shared_resource_owner)
return (shared_resource_owner & md) != 0;
else {
shared_resource_owner = md;
return 1;
}
} | [
1,
1
] |
Linux Kernel | sound/oss/dmasound/dmasound_core.c | static int set_queue_frags(struct sound_queue *sq, int bufs, int size) {
if (sq->locked) {
#ifdef DEBUG_DMASOUND
printk("dmasound_core: tried to set_queue_frags on a locked queue\n");
#endif
return -EINVAL;
}
if ((size < MIN_FRAG_SIZE) || (size > MAX_FRAG_SIZE))
return -EINVAL;
size = (1 << size);
... | [
1,
0
] |
Linux Kernel | sound/oss/dmasound/dmasound_core.c | static int sq_init(void) {
const struct file_operations *fops = &sq_fops;
sq_unit = register_sound_dsp(fops, -1);
if (sq_unit < 0) {
printk(KERN_ERR "dmasound_core: couldn't register fops\n");
return sq_unit;
}
write_sq_init_waitqueue();
if (shared_resource_owner == 0) {
dmasound.soft = dmaso... | [
0,
0
] |
Linux Kernel | sound/oss/dmasound/dmasound_core.c |
static int state_release(struct inode *inode, struct file *file) {
mutex_lock(&dmasound_core_mutex);
state.busy = 0;
module_put(dmasound.mach.owner);
mutex_unlock(&dmasound_core_mutex);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/oss/dmasound/dmasound_core.c |
static int state_init(void) {
state_unit = register_sound_special(&state_fops, SND_DEV_STATUS);
if (state_unit < 0)
return state_unit;
state.busy = 0;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/oss/dmasound/dmasound_core.c | *Config &Setup **This function is called by _one_ chipset -
specific driver * /
int dmasound_init(void) {
int res;
if (irq_installed)
return -EBUSY;
/* Set default settings. */
if ((res = sq_init()) < 0)
return res;
/* Set up /dev/sndstat. */
if ((res = state_init()) < 0)
return ... | [
0,
0
] |
Linux Kernel | sound/oss/dmasound/dmasound_core.c | static int __maybe_unused dmasound_setup(char *str) {
int ints[6], size;
str = get_options(str, ARRAY_SIZE(ints), ints);
/* FIXME: other than in the most naive of cases there is no sense in these
* buffers being other than powers of two. This is not checked yet.
*/
switch (ints[0]) {
case 3:
i... | [
1,
1
] |
Linux Kernel | sound/oss/dmasound/dmasound_paula.c | static void AmiInit(void) {
int period, i;
AmiSilence();
if (dmasound.soft.speed)
period = amiga_colorclock / dmasound.soft.speed - 1;
else
period = amiga_audio_min_period;
dmasound.hard = dmasound.soft;
dmasound.trans_write = &transAmiga;
if (period < amiga_audio_min_period) {
period = am... | [
0,
0
] |
Linux Kernel | sound/oss/dmasound/dmasound_paula.c |
static int AmiSetVolume(int volume) {
dmasound.volume_left = VOLUME_VOXWARE_TO_AMI(volume & 0xff);
custom.aud[0].audvol = dmasound.volume_left;
dmasound.volume_right = VOLUME_VOXWARE_TO_AMI((volume & 0xff00) >> 8);
custom.aud[1].audvol = dmasound.volume_right;
if (dmasound.hard.size == 16) {
if (dmasound... | [
0,
0
] |
Linux Kernel | sound/oss/dmasound/dmasound_paula.c |
static int AmiStateInfo(char *buffer, size_t space) {
int len = 0;
len += sprintf(buffer + len, "\tsound.volume_left = %d [0...64]\n",
dmasound.volume_left);
len += sprintf(buffer + len, "\tsound.volume_right = %d [0...64]\n",
dmasound.volume_right);
if (len >= space) {
p... | [
1,
0
] |
Linux Kernel | sound/oss/dmasound/dmasound_paula.c | static int __init amiga_audio_probe(struct platform_device *pdev) {
dmasound.mach = machAmiga;
dmasound.mach.default_hard = def_hard;
dmasound.mach.default_soft = def_soft;
return dmasound_init();
} | [
0,
0
] |
Linux Kernel | sound/oss/dmasound/dmasound_q40.c |
static ssize_t q40_ct_u8(const u_char __user *userPtr, size_t userCount,
u_char frame[], ssize_t *frameUsed,
ssize_t frameLeft) {
ssize_t count, used;
u_char *p = (u_char *)&frame[*frameUsed];
used = count = min_t(size_t, userCount, frameLeft);
if (copy_from_u... | [
0,
0
] |
Linux Kernel | sound/oss/dmasound/dmasound_q40.c | static ssize_t q40_ctx_law(const u_char __user *userPtr, size_t userCount,
u_char frame[], ssize_t *frameUsed,
ssize_t frameLeft) {
unsigned char *table = (unsigned char *)(dmasound.soft.format == AFMT_MU_LAW
? dmasou... | [
1,
0
] |
Linux Kernel | sound/oss/dmasound/dmasound_q40.c | static ssize_t q40_ctc_law(const u_char __user *userPtr, size_t userCount,
u_char frame[], ssize_t *frameUsed,
ssize_t frameLeft) {
unsigned char *table = (unsigned char *)(dmasound.soft.format == AFMT_MU_LAW
? dmasou... | [
1,
0
] |
Linux Kernel | sound/oss/dmasound/dmasound_q40.c | static void Q40PlayNextFrame(int index) {
u_char *start;
u_long size;
u_char speed;
int error;
start = write_sq.buffers[write_sq.front];
size = (write_sq.count == index ? write_sq.rear_size : write_sq.block_size);
q40_pp = start;
q40_sc = size;
write_sq.front = (write_sq.front + 1) % write_sq.max_c... | [
0,
0
] |
Linux Kernel | sound/parisc/harmony.c |
static int snd_harmony_set_data_format(struct snd_harmony *h, int fmt,
int force) {
int o = h->st.format;
int n;
switch (fmt) {
case SNDRV_PCM_FORMAT_S16_BE:
n = HARMONY_DF_16BIT_LINEAR;
break;
case SNDRV_PCM_FORMAT_A_LAW:
n = HARMONY_DF_8BIT_ALAW;
brea... | [
1,
0
] |
Linux Kernel | sound/parisc/harmony.c |
static int snd_harmony_capture_close(struct snd_pcm_substream *ss) {
struct snd_harmony *h = snd_pcm_substream_chip(ss);
h->csubs = NULL;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/parisc/harmony.c | static int snd_harmony_pcm_init(struct snd_harmony *h) {
struct snd_pcm *pcm;
int err;
if (snd_BUG_ON(!h))
return -EINVAL;
harmony_disable_interrupts(h);
err = snd_pcm_new(h->card, "harmony", 0, 1, 1, &pcm);
if (err < 0)
return err;
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_harmony_... | [
1,
0
] |
Linux Kernel | sound/parisc/harmony.c |
static int snd_harmony_volume_put(struct snd_kcontrol *kc,
struct snd_ctl_elem_value *ucontrol) {
struct snd_harmony *h = snd_kcontrol_chip(kc);
int shift_left = (kc->private_value) & 0xff;
int shift_right = (kc->private_value >> 8) & 0xff;
int mask = (kc->private_value >> 16)... | [
1,
0
] |
Linux Kernel | sound/parisc/harmony.c |
static void snd_harmony_mixer_reset(struct snd_harmony *h) {
harmony_mute(h);
harmony_reset(h);
h->st.gain = HARMONY_GAIN_DEFAULT;
harmony_unmute(h);
} | [
0,
0
] |
Linux Kernel | sound/parisc/harmony.c |
static int __init alsa_harmony_init(void) {
return register_parisc_driver(&snd_harmony_driver);
} | [
0,
0
] |
Linux Kernel | sound/pci/ac97/ac97_codec.c | static inline unsigned short snd_ac97_read_cache(struct snd_ac97 *ac97,
unsigned short reg) {
if (!test_bit(reg, ac97->reg_accessed)) {
ac97->regs[reg] = ac97->bus->ops->read(ac97, reg);
}
return ac97->regs[reg];
} | [
1,
0
] |
Linux Kernel | sound/pci/ac97/ac97_codec.c | int snd_ac97_update_bits(struct snd_ac97 *ac97, unsigned short reg,
unsigned short mask, unsigned short value) {
int change;
if (!snd_ac97_valid_reg(ac97, reg))
return -EINVAL;
mutex_lock(&ac97->reg_mutex);
change = snd_ac97_update_bits_nolock(ac97, reg, mask, value);
mutex_unloc... | [
0,
0
] |
Linux Kernel | sound/pci/ac97/ac97_codec.c | static int snd_ac97_ad18xx_update_pcm_bits(struct snd_ac97 *ac97, int codec,
unsigned short mask,
unsigned short value) {
int change;
unsigned short old, new, cfg;
mutex_lock(&ac97->page_mutex);
old = ac97->spec.ad18xx.pcmreg... | [
0,
0
] |
Linux Kernel | sound/pci/ac97/ac97_codec.c | static int snd_ac97_put_volsw(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
int reg = kcontrol->private_value & 0xff;
int shift = (kcontrol->private_value >> 8) & 0x0f;
int rshift = (kcontrol->private_valu... | [
1,
0
] |
Linux Kernel | sound/pci/ac97/ac97_codec.c | static void set_inv_eapd(struct snd_ac97 *ac97, struct snd_kcontrol *kctl) {
kctl->private_value = AC97_SINGLE_VALUE(AC97_POWERDOWN, 15, 1, 0);
snd_ac97_update_bits(ac97, AC97_POWERDOWN, (1 << 15), (1 << 15));
ac97->scaps |= AC97_SCAP_INV_EAPD;
} | [
0,
0
] |
Linux Kernel | sound/pci/ac97/ac97_codec.c |
static int snd_ac97_spdif_default_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
mutex_lock(&ac97->reg_mutex);
ucontrol->value.iec958.status[0] = ac97->spdif_status & 0xff;
ucontrol->value.iec... | [
1,
0
] |
Linux Kernel | sound/pci/ac97/ac97_codec.c | static int snd_ac97_put_spsa(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
int reg = kcontrol->private_value & 0xff;
int shift = (kcontrol->private_value >> 8) & 0x0f;
int mask = (kcontrol->private_value >>... | [
1,
0
] |
Linux Kernel | sound/pci/ac97/ac97_codec.c |
static int snd_ac97_ad18xx_pcm_get_bits(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
int codec = kcontrol->private_value & 3;
int lshift = (kcontrol->private_value >> 8) & 0x0f;
int rshift = (k... | [
1,
0
] |
Linux Kernel | sound/pci/ac97/ac97_codec.c |
static int snd_ac97_bus_free(struct snd_ac97_bus *bus) {
if (bus) {
snd_ac97_bus_proc_done(bus);
kfree(bus->pcms);
if (bus->private_free)
bus->private_free(bus);
kfree(bus);
}
return 0;
} | [
0,
0
] |
Linux Kernel | sound/pci/ac97/ac97_codec.c |
static int snd_ac97_bus_dev_free(struct snd_device *device) {
struct snd_ac97_bus *bus = device->device_data;
return snd_ac97_bus_free(bus);
} | [
0,
0
] |
Linux Kernel | sound/pci/ac97/ac97_codec.c | static int snd_ac97_try_volume_mix(struct snd_ac97 *ac97, int reg) {
unsigned short val, mask = AC97_MUTE_MASK_MONO;
if (!snd_ac97_valid_reg(ac97, reg))
return 0;
switch (reg) {
case AC97_MASTER_TONE:
return ac97->caps & AC97_BC_BASS_TREBLE ? 1 : 0;
case AC97_HEADPHONE:
return ac97->caps & AC97_... | [
1,
0
] |
Linux Kernel | sound/pci/ac97/ac97_codec.c |
static int snd_ac97_try_bit(struct snd_ac97 *ac97, int reg, int bit) {
unsigned short mask, val, orig, res;
mask = 1 << bit;
orig = snd_ac97_read(ac97, reg);
val = orig ^ mask;
snd_ac97_write(ac97, reg, val);
res = snd_ac97_read(ac97, reg);
snd_ac97_write_cache(ac97, reg, orig);
return res == val;
} | [
0,
0
] |
Linux Kernel | sound/pci/ac97/ac97_codec.c |
static struct snd_kcontrol *
snd_ac97_cnew(const struct snd_kcontrol_new *_template, struct snd_ac97 *ac97) {
struct snd_kcontrol_new template;
memcpy(&template, _template, sizeof(template));
template.index = ac97->num;
return snd_ctl_new1(&template, ac97);
} | [
1,
0
] |
Linux Kernel | sound/pci/ac97/ac97_codec.c | static int snd_ac97_cmute_new_stereo(struct snd_card *card, char *name, int reg,
int check_stereo, int check_amix,
struct snd_ac97 *ac97) {
struct snd_kcontrol *kctl;
int err;
unsigned short val, val1, mute_mask;
if (!snd_ac97_valid_reg(... | [
1,
0
] |
Linux Kernel | sound/pci/ac97/ac97_codec.c |
static const unsigned int *find_db_scale(unsigned int maxval) {
switch (maxval) {
case 0x0f:
return db_scale_4bit;
case 0x1f:
return db_scale_5bit;
case 0x3f:
return db_scale_6bit;
}
return NULL;
} | [
1,
0
] |
Linux Kernel | sound/pci/ac97/ac97_codec.c | static int snd_ac97_modem_build(struct snd_card *card, struct snd_ac97 *ac97) {
int err, idx;
snd_ac97_write(ac97, AC97_GPIO_CFG, 0xffff & ~(AC97_GPIO_LINE1_OH));
snd_ac97_write(ac97, AC97_GPIO_POLARITY, 0xffff & ~(AC97_GPIO_LINE1_OH));
snd_ac97_write(ac97, AC97_GPIO_STICKY, 0xffff);
snd_ac97_write(ac97, AC9... | [
0,
0
] |
Linux Kernel | sound/pci/ac97/ac97_codec.c | static const struct ac97_codec_id *
look_for_codec_id(const struct ac97_codec_id *table, unsigned int id) {
const struct ac97_codec_id *pid;
for (pid = table; pid->id; pid++)
if (pid->id == (id & pid->mask))
return pid;
return NULL;
} | [
0,
0
] |
Linux Kernel | sound/pci/ac97/ac97_codec.c |
void snd_ac97_get_name(struct snd_ac97 *ac97, unsigned int id, char *name,
int modem) {
const struct ac97_codec_id *pid;
sprintf(name, "0x%x %c%c%c", id, printable(id >> 24), printable(id >> 16),
printable(id >> 8));
pid = look_for_codec_id(snd_ac97_codec_id_vendors, id);
if (... | [
1,
0
] |
Linux Kernel | sound/pci/ac97/ac97_codec.c | int snd_ac97_bus(struct snd_card *card, int num,
const struct snd_ac97_bus_ops *ops, void *private_data,
struct snd_ac97_bus **rbus) {
int err;
struct snd_ac97_bus *bus;
static const struct snd_device_ops dev_ops = {
.dev_free = snd_ac97_bus_dev_free,
};
if (snd_BUG_ON... | [
0,
0
] |
Linux Kernel | sound/pci/ac97/ac97_codec.c | static void ac97_device_release(struct device *dev) {} | [
0,
0
] |
Linux Kernel | sound/pci/ac97/ac97_codec.c | static int snd_ac97_dev_disconnect(struct snd_device *device) {
struct snd_ac97 *ac97 = device->device_data;
if (ac97->dev.bus)
device_unregister(&ac97->dev);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/pci/ac97/ac97_codec.c | int snd_ac97_update_power(struct snd_ac97 *ac97, int reg, int powerup) {
int i;
if (!ac97)
return 0;
if (reg) {
if (reg == AC97_SPDIF)
reg = AC97_PCM_FRONT_DAC_RATE;
for (i = 0; i < PWIDX_SIZE; i++) {
if (power_regs[i].reg == reg) {
if (powerup)
ac97->power_up |= (1 <<... | [
0,
0
] |
Linux Kernel | sound/pci/ac97/ac97_codec.c | void snd_ac97_suspend(struct snd_ac97 *ac97) {
if (!ac97)
return;
if (ac97->build_ops->suspend)
ac97->build_ops->suspend(ac97);
#ifdef CONFIG_SND_AC97_POWER_SAVE
cancel_delayed_work_sync(&ac97->power_work);
#endif
snd_ac97_powerdown(ac97);
} | [
0,
0
] |
Linux Kernel | sound/pci/ac97/ac97_codec.c | static void snd_ac97_restore_status(struct snd_ac97 *ac97) {
int i;
for (i = 2; i < 0x7c; i += 2) {
if (i == AC97_POWERDOWN || i == AC97_EXTENDED_ID)
continue;
if (test_bit(i, ac97->reg_accessed)) {
snd_ac97_write(ac97, i, ac97->regs[i]);
snd_ac97_read(ac97, i);
}
}
} | [
0,
0
] |
Linux Kernel | sound/pci/ac97/ac97_codec.c |
static struct snd_kcontrol *ctl_find(struct snd_ac97 *ac97, const char *name,
const char *suffix) {
struct snd_ctl_elem_id sid;
memset(&sid, 0, sizeof(sid));
set_ctl_name(sid.name, name, suffix);
sid.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
return snd_ctl_find_id(ac97->bus->ca... | [
1,
0
] |
Linux Kernel | sound/pci/ac97/ac97_codec.c | static int snd_ac97_rename_ctl(struct snd_ac97 *ac97, const char *src,
const char *dst, const char *suffix) {
struct snd_kcontrol *kctl = ctl_find(ac97, src, suffix);
char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
if (kctl) {
set_ctl_name(name, dst, suffix);
snd_ctl_rename(ac97-... | [
0,
0
] |
Linux Kernel | sound/pci/ac97/ac97_codec.c | static void snd_ac97_rename_vol_ctl(struct snd_ac97 *ac97, const char *src,
const char *dst) {
snd_ac97_rename_ctl(ac97, src, dst, "Switch");
snd_ac97_rename_ctl(ac97, src, dst, "Volume");
} | [
0,
0
] |
Linux Kernel | sound/pci/ac97/ac97_codec.c | static int bind_hp_volsw_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
int err = snd_ac97_put_volsw(kcontrol, ucontrol);
if (err > 0) {
unsigned long priv_saved = kcontrol->private_value;
kcontrol->private_value =
(kcontrol->private_value & ~0... | [
1,
0
] |
Linux Kernel | sound/pci/ac97/ac97_codec.c | static int tune_hp_only(struct snd_ac97 *ac97) {
struct snd_kcontrol *msw = ctl_find(ac97, "Master Playback Switch", NULL);
struct snd_kcontrol *mvol = ctl_find(ac97, "Master Playback Volume", NULL);
if (!msw || !mvol)
return -ENOENT;
msw->put = bind_hp_volsw_put;
mvol->put = bind_hp_volsw_put;
snd_ac97... | [
0,
0
] |
Linux Kernel | sound/pci/ac97/ac97_codec.c | static int tune_swap_surround(struct snd_ac97 *ac97) {
if (snd_ac97_swap_ctl(ac97, "Master Playback", "Surround Playback",
"Switch") ||
snd_ac97_swap_ctl(ac97, "Master Playback", "Surround Playback", "Volume"))
return -ENOENT;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/pci/ac97/ac97_codec.c |
static int master_mute_sw_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
int err = snd_ac97_put_volsw(kcontrol, ucontrol);
if (err > 0) {
struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
int shift = (kcontrol->private_value >> 8) & 0x0f;
int ... | [
1,
0
] |
Linux Kernel | sound/pci/ac97/ac97_codec.c |
static int hp_master_mute_sw_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
int err = bind_hp_volsw_put(kcontrol, ucontrol);
if (err > 0) {
struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
int shift = (kcontrol->private_value >> 8) & 0x0f;
... | [
1,
0
] |
Linux Kernel | sound/pci/ac97/ac97_codec.c | static int apply_quirk_str(struct snd_ac97 *ac97, const char *typestr) {
int i;
const struct quirk_table *q;
for (i = 0; i < ARRAY_SIZE(applicable_quirks); i++) {
q = &applicable_quirks[i];
if (q->name && !strcmp(typestr, q->name))
return apply_quirk(ac97, i);
}
if (*typestr >= '0' && *typestr... | [
0,
0
] |
Linux Kernel | sound/pci/ac97/ac97_codec.c | int snd_ac97_tune_hardware(struct snd_ac97 *ac97,
const struct ac97_quirk *quirk,
const char *override) {
int result;
if (override && strcmp(override, "-1") && strcmp(override, "default")) {
result = apply_quirk_str(ac97, override);
if (result < 0)
... | [
1,
0
] |
Linux Kernel | sound/pci/ac97/ac97_patch.c | static int ac97_surround_jack_mode_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo) {
static const char *const texts[] = {"Shared", "Independent"};
return snd_ctl_enum_info(uinfo, 1, 2, texts);
} | [
0,
0
] |
Linux Kernel | sound/pci/ac97/ac97_patch.c | static inline int is_shared_surrout(struct snd_ac97 *ac97) {
return !ac97->indep_surround && is_surround_on(ac97);
} | [
0,
0
] |
Linux Kernel | sound/pci/ac97/ac97_patch.c | static inline int is_shared_clfeout(struct snd_ac97 *ac97) {
return !ac97->indep_surround && is_clfe_on(ac97);
} | [
0,
0
] |
Linux Kernel | sound/pci/ac97/ac97_patch.c | static inline int is_shared_micin(struct snd_ac97 *ac97) {
return !ac97->indep_surround && !is_clfe_on(ac97);
} | [
0,
0
] |
Linux Kernel | sound/pci/ac97/ac97_patch.c |
static int
snd_ac97_ymf7x3_spdif_source_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
unsigned short val;
val = ac97->regs[AC97_YMF7X3_DIT_CTRL];
ucontrol->value.enumerated.item[0] = (val >> 1) & ... | [
0,
0
] |
Linux Kernel | sound/pci/ac97/ac97_patch.c |
static int patch_yamaha_ymf7x3_3d(struct snd_ac97 *ac97) {
struct snd_kcontrol *kctl;
int err;
kctl = snd_ac97_cnew(&snd_ac97_controls_3d[0], ac97);
err = snd_ctl_add(ac97->bus->card, kctl);
if (err < 0)
return err;
strcpy(kctl->id.name, "3D Control - Wide");
kctl->private_value = AC97_SINGLE_VALUE(... | [
1,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.