Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
⌀
Function
large_stringlengths
11
3.45k
Label
list
Linux Kernel
sound/pci/ice1712/wtm.c
static int stac9460_mic_sw_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); unsigned char val; int id; id = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); if (id == 0) val = stac9460_get(ice, S...
[ 1, 0 ]
Linux Kernel
sound/pci/intel8x0.c
static unsigned short snd_intel8x0_codec_read(struct snd_ac97 *ac97, unsigned short reg) { struct intel8x0 *chip = ac97->private_data; unsigned short res; unsigned int tmp; if (snd_intel8x0_codec_semaphore(chip, ac97->num) < 0) { if (!chip->in_ac97_init) ...
[ 1, 0 ]
Linux Kernel
sound/pci/intel8x0.c
static unsigned short snd_intel8x0_ali_codec_read(struct snd_ac97 *ac97, unsigned short reg) { struct intel8x0 *chip = ac97->private_data; unsigned short data = 0xffff; if (snd_intel8x0_ali_codec_semaphore(chip)) goto __err; reg |= ALI_CPR_ADDR_READ; if ...
[ 1, 0 ]
Linux Kernel
sound/pci/intel8x0.c
static void snd_intel8x0_ali_codec_write(struct snd_ac97 *ac97, unsigned short reg, unsigned short val) { struct intel8x0 *chip = ac97->private_data; if (snd_intel8x0_ali_codec_semaphore(chip)) return; iputword(chip, ICHREG(AL...
[ 0, 0 ]
Linux Kernel
sound/pci/intel8x0.c
static irqreturn_t snd_intel8x0_interrupt(int irq, void *dev_id) { struct intel8x0 *chip = dev_id; struct ichdev *ichdev; unsigned int status; unsigned int i; status = igetdword(chip, chip->int_sta_reg); if (status == 0xffffffff) return IRQ_NONE; if ((status & chip->int_sta_mask) == 0) { if (sta...
[ 0, 0 ]
Linux Kernel
sound/pci/intel8x0.c
static int snd_intel8x0_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *hw_params) { struct intel8x0 *chip = snd_pcm_substream_chip(substream); struct ichdev *ichdev = get_ichdev(substream); int dbl = params_rate(hw_params) > 48000; int err; if (ichd...
[ 1, 0 ]
Linux Kernel
sound/pci/intel8x0.c
static int snd_intel8x0_pcm_prepare(struct snd_pcm_substream *substream) { struct intel8x0 *chip = snd_pcm_substream_chip(substream); struct snd_pcm_runtime *runtime = substream->runtime; struct ichdev *ichdev = get_ichdev(substream); ichdev->physbuf = runtime->dma_addr; ichdev->size = snd_pcm_lib_buffer_by...
[ 1, 0 ]
Linux Kernel
sound/pci/intel8x0.c
static snd_pcm_uframes_t snd_intel8x0_pcm_pointer(struct snd_pcm_substream *substream) { struct intel8x0 *chip = snd_pcm_substream_chip(substream); struct ichdev *ichdev = get_ichdev(substream); size_t ptr1, ptr; int civ, timeout = 10; unsigned int position; spin_lock(&chip->reg_lock); do { civ = ige...
[ 1, 0 ]
Linux Kernel
sound/pci/intel8x0.c
static int snd_intel8x0_capture_close(struct snd_pcm_substream *substream) { struct intel8x0 *chip = snd_pcm_substream_chip(substream); chip->ichd[ICHD_PCMIN].substream = NULL; return 0; }
[ 0, 0 ]
Linux Kernel
sound/pci/intel8x0.c
static int snd_intel8x0_capture2_close(struct snd_pcm_substream *substream) { struct intel8x0 *chip = snd_pcm_substream_chip(substream); chip->ichd[ICHD_PCM2IN].substream = NULL; return 0; }
[ 0, 0 ]
Linux Kernel
sound/pci/intel8x0.c
static int snd_intel8x0_spdif_open(struct snd_pcm_substream *substream) { struct intel8x0 *chip = snd_pcm_substream_chip(substream); int idx = chip->device_type == DEVICE_NFORCE ? NVD_SPBAR : ICHD_SPBAR; return snd_intel8x0_pcm_open(substream, &chip->ichd[idx]); }
[ 0, 0 ]
Linux Kernel
sound/pci/intel8x0.c
static int snd_intel8x0_spdif_close(struct snd_pcm_substream *substream) { struct intel8x0 *chip = snd_pcm_substream_chip(substream); int idx = chip->device_type == DEVICE_NFORCE ? NVD_SPBAR : ICHD_SPBAR; chip->ichd[idx].substream = NULL; return 0; }
[ 0, 0 ]
Linux Kernel
sound/pci/intel8x0.c
static int snd_intel8x0_pcm1(struct intel8x0 *chip, int device, const struct ich_pcm_table *rec) { struct snd_pcm *pcm; int err; char name[32]; if (rec->suffix) sprintf(name, "Intel ICH - %s", rec->suffix); else strcpy(name, "Intel ICH"); err = snd_pcm_new(chip->card, ...
[ 1, 0 ]
Linux Kernel
sound/pci/intel8x0.c
static int snd_intel8x0_ich_chip_cold_reset(struct intel8x0 *chip) { unsigned int cnt; if (snd_pci_quirk_lookup(chip->pci, ich_chip_reset_mode)) return -EIO; cnt = igetdword(chip, ICHREG(GLOB_CNT)); cnt &= ~(ICH_ACLINK | ICH_PCM_246_MASK); /* do cold reset - the full ac97 powerdown may leave the contro...
[ 0, 0 ]
Linux Kernel
sound/pci/intel8x0.c
static int snd_intel8x0_ich_chip_reset(struct intel8x0 *chip) { unsigned long end_time; unsigned int cnt; cnt = igetdword(chip, ICHREG(GLOB_CNT)); cnt &= ~(ICH_ACLINK | ICH_PCM_246_MASK); /* finish cold or do warm reset */ cnt |= (cnt & ICH_AC97COLD) == 0 ? ICH_AC97COLD : ICH_AC97WARM; iputdword(chip, IC...
[ 1, 0 ]
Linux Kernel
sound/pci/intel8x0.c
static int snd_intel8x0_ali_chip_init(struct intel8x0 *chip, int probing) { u32 reg; int i = 0; reg = igetdword(chip, ICHREG(ALI_SCR)); if ((reg & 2) == 0) reg |= 2; else reg |= 1; /* Warm */ reg &= ~0x80000000; /* ACLink on */ iputdword(chip, ICHREG(ALI_SCR), reg); for (i = 0; i < HZ ...
[ 1, 0 ]
Linux Kernel
sound/pci/intel8x0.c
static int snd_intel8x0_chip_init(struct intel8x0 *chip, int probing) { unsigned int i, timeout; int err; if (chip->device_type != DEVICE_ALI) { err = snd_intel8x0_ich_chip_init(chip, probing); if (err < 0) return err; iagetword(chip, 0); } else { err = snd_intel8x0_ali_chip_init(chip, pr...
[ 0, 0 ]
Linux Kernel
sound/pci/intel8x0.c
static void snd_intel8x0_free(struct snd_card *card) { struct intel8x0 *chip = card->private_data; unsigned int i; if (chip->irq < 0) goto __hw_end; for (i = 0; i < chip->bdbars_count; i++) iputbyte(chip, ICH_REG_OFF_CR + chip->ichd[i].reg_offset, 0x00); /* reset channels */ for (i = 0; i < chip->...
[ 1, 0 ]
Linux Kernel
sound/pci/intel8x0.c
static void snd_intel8x0_proc_init(struct intel8x0 *chip) { snd_card_ro_proc_new(chip->card, "intel8x0", chip, snd_intel8x0_proc_read); }
[ 0, 0 ]
Linux Kernel
sound/pci/intel8x0m.c
static inline u32 igetdword(struct intel8x0m *chip, u32 offset) { return ioread32(chip->bmaddr + offset); }
[ 0, 0 ]
Linux Kernel
sound/pci/intel8x0m.c
static inline u16 iagetword(struct intel8x0m *chip, u32 offset) { return ioread16(chip->addr + offset); }
[ 0, 0 ]
Linux Kernel
sound/pci/intel8x0m.c
static void snd_intel8x0m_codec_write(struct snd_ac97 *ac97, unsigned short reg, unsigned short val) { struct intel8x0m *chip = ac97->private_data; if (snd_intel8x0m_codec_semaphore(chip, ac97->num) < 0) { if (!chip->in_ac97_init) dev_err(chip->card->dev, ...
[ 0, 0 ]
Linux Kernel
sound/pci/intel8x0m.c
static snd_pcm_uframes_t snd_intel8x0m_pcm_pointer(struct snd_pcm_substream *substream) { struct intel8x0m *chip = snd_pcm_substream_chip(substream); struct ichdev *ichdev = get_ichdev(substream); size_t ptr1, ptr; ptr1 = igetword(chip, ichdev->reg_offset + ichdev->roff_picb) << chip->pcm_pos_shift; ...
[ 1, 0 ]
Linux Kernel
sound/pci/intel8x0m.c
static int snd_intel8x0m_pcm_prepare(struct snd_pcm_substream *substream) { struct intel8x0m *chip = snd_pcm_substream_chip(substream); struct snd_pcm_runtime *runtime = substream->runtime; struct ichdev *ichdev = get_ichdev(substream); ichdev->physbuf = runtime->dma_addr; ichdev->size = snd_pcm_lib_buffer_...
[ 0, 0 ]
Linux Kernel
sound/pci/intel8x0m.c
static int snd_intel8x0m_capture_open(struct snd_pcm_substream *substream) { struct intel8x0m *chip = snd_pcm_substream_chip(substream); return snd_intel8x0m_pcm_open(substream, &chip->ichd[ICHD_MDMIN]); }
[ 0, 0 ]
Linux Kernel
sound/pci/intel8x0m.c
static int intel8x0m_suspend(struct device *dev) { struct snd_card *card = dev_get_drvdata(dev); struct intel8x0m *chip = card->private_data; snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); snd_ac97_suspend(chip->ac97); if (chip->irq >= 0) { free_irq(chip->irq, chip); chip->irq = -1; card->s...
[ 0, 0 ]
Linux Kernel
sound/pci/intel8x0m.c
static int intel8x0m_resume(struct device *dev) { struct pci_dev *pci = to_pci_dev(dev); struct snd_card *card = dev_get_drvdata(dev); struct intel8x0m *chip = card->private_data; if (request_irq(pci->irq, snd_intel8x0m_interrupt, IRQF_SHARED, KBUILD_MODNAME, chip)) { dev_err(dev, "unabl...
[ 0, 0 ]
Linux Kernel
sound/pci/intel8x0m.c
static void snd_intel8x0m_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer) { struct intel8x0m *chip = entry->private_data; unsigned int tmp; snd_iprintf(buffer, "Intel8x0m\n\n"); if (chip->device_type == DEVICE_ALI) return; tmp = igetdword(chip,...
[ 0, 0 ]
Linux Kernel
sound/pci/intel8x0m.c
static int __snd_intel8x0m_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) { struct snd_card *card; struct intel8x0m *chip; int err; struct shortname_table *name; err = snd_devm_card_new(&pci->dev, index, id, THIS_MODULE, sizeof(*chip), ...
[ 1, 0 ]
Linux Kernel
sound/pci/korg1212/korg1212.c
static void snd_korg1212_SendStop(struct snd_korg1212 *korg1212) { if (!korg1212->stop_pending_cnt) { korg1212->sharedBufferPtr->cardCommand = 0xffffffff; korg1212->stop_pending_cnt = HZ; mod_timer(&korg1212->timer, jiffies + 1); } }
[ 1, 0 ]
Linux Kernel
sound/pci/korg1212/korg1212.c
static void snd_korg1212_timer_func(struct timer_list *t) { struct snd_korg1212 *korg1212 = from_timer(korg1212, t, timer); unsigned long flags; spin_lock_irqsave(&korg1212->lock, flags); if (korg1212->sharedBufferPtr->cardCommand == 0) { korg1212->stop_pending_cnt = 0; korg1212->dsp_stop_is_processed...
[ 1, 0 ]
Linux Kernel
sound/pci/korg1212/korg1212.c
static int snd_korg1212_CloseCard(struct snd_korg1212 *korg1212) { K1212_DEBUG_PRINTK("K1212_DEBUG: CloseCard [%s] %d\n", stateName[korg1212->cardState], korg1212->opencnt); mutex_lock(&korg1212->open_mutex); if (--(korg1212->opencnt)) { mutex_unlock(&korg1212->open_mutex); return 0...
[ 1, 0 ]
Linux Kernel
sound/pci/korg1212/korg1212.c
static int snd_korg1212_SetupForPlay(struct snd_korg1212 *korg1212) { int rc; K1212_DEBUG_PRINTK("K1212_DEBUG: SetupForPlay [%s] %d\n", stateName[korg1212->cardState], korg1212->setcnt); if (korg1212->setcnt++) return 0; snd_korg1212_setCardState(korg1212, K1212_STATE_SETUP); rc = ...
[ 1, 0 ]
Linux Kernel
sound/pci/korg1212/korg1212.c
static void snd_korg1212_EnableCardInterrupts(struct snd_korg1212 *korg1212) { writel(PCI_INT_ENABLE_BIT | PCI_DOORBELL_INT_ENABLE_BIT | LOCAL_INT_ENABLE_BIT | LOCAL_DOORBELL_INT_ENABLE_BIT | LOCAL_DMA1_INT_ENABLE_BIT, korg1212->statusRegPtr); } #if 0 static int snd_korg1212_SetM...
[ 0, 0 ]
Linux Kernel
sound/pci/korg1212/korg1212.c
static int snd_korg1212_downloadDSPCode(struct snd_korg1212 *korg1212) { int rc; K1212_DEBUG_PRINTK("K1212_DEBUG: DSP download is starting... [%s]\n", stateName[korg1212->cardState]); // verify the state of the card before proceeding. if (korg1212->cardState >= K1212_STATE_DSP_IN_PROCESS...
[ 1, 0 ]
Linux Kernel
sound/pci/korg1212/korg1212.c
static int snd_korg1212_capture_open(struct snd_pcm_substream *substream) { unsigned long flags; struct snd_korg1212 *korg1212 = snd_pcm_substream_chip(substream); struct snd_pcm_runtime *runtime = substream->runtime; K1212_DEBUG_PRINTK("K1212_DEBUG: snd_korg1212_capture_open [%s]\n", st...
[ 0, 0 ]
Linux Kernel
sound/pci/korg1212/korg1212.c
static int snd_korg1212_playback_close(struct snd_pcm_substream *substream) { unsigned long flags; struct snd_korg1212 *korg1212 = snd_pcm_substream_chip(substream); K1212_DEBUG_PRINTK("K1212_DEBUG: snd_korg1212_playback_close [%s]\n", stateName[korg1212->cardState]); snd_korg1212_silenc...
[ 0, 0 ]
Linux Kernel
sound/pci/korg1212/korg1212.c
static int snd_korg1212_ioctl(struct snd_pcm_substream *substream, unsigned int cmd, void *arg) { K1212_DEBUG_PRINTK("K1212_DEBUG: snd_korg1212_ioctl: cmd=%d\n", cmd); if (cmd == SNDRV_PCM_IOCTL1_CHANNEL_INFO) { struct snd_pcm_channel_info *info = arg; info->offset = 0; i...
[ 1, 0 ]
Linux Kernel
sound/pci/korg1212/korg1212.c
static int snd_korg1212_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) { unsigned long flags; struct snd_korg1212 *korg1212 = snd_pcm_substream_chip(substream); int err; pid_t this_pid; pid_t other_pid; K1212_DEBUG_PRINTK("K1212_DEBUG: snd...
[ 1, 0 ]
Linux Kernel
sound/pci/korg1212/korg1212.c
static int snd_korg1212_playback_silence(struct snd_pcm_substream *substream, int channel, unsigned long pos, unsigned long count) { struct snd_pcm_runtime *runtime = substream->runtime; struct snd_korg1212 *korg1212 = snd_pcm_substre...
[ 0, 0 ]
Linux Kernel
sound/pci/korg1212/korg1212.c
static int snd_korg1212_control_phase_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; uinfo->count = (kcontrol->private_value >= 8) ? 2 : 1; return 0; }
[ 1, 0 ]
Linux Kernel
sound/pci/korg1212/korg1212.c
static int snd_korg1212_control_route_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *u) { struct snd_korg1212 *korg1212 = snd_kcontrol_chip(kcontrol); int i; spin_lock_irq(&korg1212->lock); i = kcontrol->private_value; u->value.enumerated.item[0] = k...
[ 1, 0 ]
Linux Kernel
sound/pci/korg1212/korg1212.c
static int snd_korg1212_control_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 = k1212MaxADCSens; uinfo->value.integer.max = k1212MinADCSens; return 0; }
[ 0, 0 ]
Linux Kernel
sound/pci/korg1212/korg1212.c
static void snd_korg1212_proc_init(struct snd_korg1212 *korg1212) { snd_card_ro_proc_new(korg1212->card, "korg1212", korg1212, snd_korg1212_proc_read); }
[ 0, 0 ]
Linux Kernel
sound/pci/lola/lola.c
static int rirb_get_response(struct lola *chip, unsigned int *val, unsigned int *extval) { unsigned long timeout; again: timeout = jiffies + msecs_to_jiffies(1000); for (;;) { if (chip->polling_mode) { spin_lock_irq(&chip->reg_lock); lola_update_rirb(chip); spi...
[ 0, 0 ]
Linux Kernel
sound/pci/lola/lola.c
static void lola_irq_enable(struct lola *chip) { unsigned int val; val = (1 << chip->pcm[PLAY].num_streams) - 1; lola_writel(chip, BAR1, DOINTCTL, val); val = (1 << chip->pcm[CAPT].num_streams) - 1; lola_writel(chip, BAR1, DIINTCTL, val); /* enable global irqs */ val = LOLA_DINT_GLOBAL | LOLA_DINT_CTRL ...
[ 1, 0 ]
Linux Kernel
sound/pci/lola/lola.c
static void lola_irq_disable(struct lola *chip) { lola_writel(chip, BAR1, DINTCTL, 0); lola_writel(chip, BAR1, DIINTCTL, 0); lola_writel(chip, BAR1, DOINTCTL, 0); }
[ 0, 0 ]
Linux Kernel
sound/pci/lola/lola.c
static void stop_corb_rirb(struct lola *chip) { lola_writeb(chip, BAR0, RIRBCTL, 0); lola_writeb(chip, BAR0, CORBCTL, 0); }
[ 0, 0 ]
Linux Kernel
sound/pci/lola/lola.c
static void lola_free(struct snd_card *card) { struct lola *chip = card->private_data; if (chip->initialized) lola_stop_hw(chip); lola_free_mixer(chip); }
[ 0, 0 ]
Linux Kernel
sound/pci/lola/lola.c
static int __lola_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) { static int dev; struct snd_card *card; struct lola *chip; int err; if (dev >= SNDRV_CARDS) return -ENODEV; if (!enable[dev]) { dev++; return -ENOENT; } err = snd_devm_card_new(&pci->...
[ 1, 0 ]
Linux Kernel
sound/pci/lola/lola_clock.c
static bool check_gran_clock_compatibility(struct lola *chip, unsigned int val, unsigned int freq) { if (!chip->granularity) return true; if (val < LOLA_GRANULARITY_MIN || val > LOLA_GRANULARITY_MAX || (val % LOLA_GRANULARITY_STEP) != 0) return false; if...
[ 1, 0 ]
Linux Kernel
sound/pci/lola/lola_clock.c
bool lola_update_ext_clock_freq(struct lola *chip, unsigned int val) { unsigned int tag; if (!val) return false; tag = (val >> LOLA_UNSOL_RESP_TAG_OFFSET) & LOLA_UNSOLICITED_TAG_MASK; if (tag != LOLA_UNSOLICITED_TAG) return false; /* only for current = external clocks */ if (chip->clock.sample_clo...
[ 1, 0 ]
Linux Kernel
sound/pci/lola/lola_mixer.c
static int lola_mixer_set_mapping_gain(struct lola *chip, unsigned int src, unsigned int dest, unsigned short gain, bool on) { unsigned int val; if (!(chip->mixer.src_mask & (1 << src)) || !(chip->mixer.dest_mask & (1 << dest))) ...
[ 1, 0 ]
Linux Kernel
sound/pci/lola/lola_mixer.c
static int set_analog_volume(struct lola *chip, int dir, unsigned int idx, unsigned int val, bool external_call) { struct lola_pin *pin; int err; if (idx >= chip->pin[dir].num_pins) return -EINVAL; pin = &chip->pin[dir].pins[idx]; if (!pin->is_analog || pin->amp_num_steps <= ...
[ 1, 0 ]
Linux Kernel
sound/pci/lola/lola_mixer.c
int lola_set_src_config(struct lola *chip, unsigned int src_mask, bool update) { int ret = 0; int success = 0; int n, err; if ((chip->input_src_caps_mask & src_mask) != src_mask) return -EINVAL; /* handle all even Inputs - SRC is a stereo setting !!! */ for (n = 0; n < chip->pin[CAPT].num_pins; n += 2)...
[ 1, 0 ]
Linux Kernel
sound/pci/lola/lola_mixer.c
static int lola_analog_vol_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { struct lola *chip = snd_kcontrol_chip(kcontrol); int dir = kcontrol->private_value; uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; uinfo->count = chip->pin[dir].num_pins; uinfo->value...
[ 0, 0 ]
Linux Kernel
sound/pci/lola/lola_mixer.c
static int lola_analog_vol_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct lola *chip = snd_kcontrol_chip(kcontrol); int dir = kcontrol->private_value; int i; for (i = 0; i < chip->pin[dir].num_pins; i++) ucontrol->value.integer.value[i] = ch...
[ 0, 0 ]
Linux Kernel
sound/pci/lola/lola_mixer.c
static int lola_analog_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct lola *chip = snd_kcontrol_chip(kcontrol); int dir = kcontrol->private_value; int i, err; for (i = 0; i < chip->pin[dir].num_pins; i++) { err = set_analog_volum...
[ 0, 0 ]
Linux Kernel
sound/pci/lola/lola_mixer.c
static int lola_analog_vol_tlv(struct snd_kcontrol *kcontrol, int op_flag, unsigned int size, unsigned int __user *tlv) { struct lola *chip = snd_kcontrol_chip(kcontrol); int dir = kcontrol->private_value; unsigned int val1, val2; struct lola_pin *pin; if (size < 4 * sizeof(un...
[ 1, 0 ]
Linux Kernel
sound/pci/lola/lola_mixer.c
static int create_input_src_mixer(struct lola *chip) { if (!chip->input_src_caps_mask) return 0; return snd_ctl_add(chip->card, snd_ctl_new1(&lola_input_src_mixer, chip)); }
[ 0, 0 ]
Linux Kernel
sound/pci/lola/lola_mixer.c
static int lola_src_gain_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { unsigned int count = (kcontrol->private_value >> 8) & 0xff; uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; uinfo->count = count; uinfo->value.integer.min = 0; uinfo->value.integer.max = 4...
[ 1, 0 ]
Linux Kernel
sound/pci/lola/lola_mixer.c
static int lola_src_gain_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct lola *chip = snd_kcontrol_chip(kcontrol); unsigned int ofs = kcontrol->private_value & 0xff; unsigned int count = (kcontrol->private_value >> 8) & 0xff; unsigned int mask, i; ...
[ 1, 0 ]
Linux Kernel
sound/pci/lola/lola_mixer.c
static int lola_src_gain_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct lola *chip = snd_kcontrol_chip(kcontrol); unsigned int ofs = kcontrol->private_value & 0xff; unsigned int count = (kcontrol->private_value >> 8) & 0xff; int i, err; for (i =...
[ 1, 0 ]
Linux Kernel
sound/pci/lola/lola_mixer.c
int lola_create_mixer(struct lola *chip) { int err; err = create_analog_mixer(chip, PLAY, "Analog Playback Volume"); if (err < 0) return err; err = create_analog_mixer(chip, CAPT, "Analog Capture Volume"); if (err < 0) return err; err = create_input_src_mixer(chip); if (err < 0) return err; ...
[ 0, 1 ]
Linux Kernel
sound/pci/lola/lola_pcm.c
static struct lola_stream * lola_get_stream(struct snd_pcm_substream *substream) { struct lola_pcm *pcm = lola_get_pcm(substream); unsigned int idx = substream->number; return &pcm->streams[idx]; }
[ 1, 0 ]
Linux Kernel
sound/pci/lola/lola_pcm.c
static unsigned int lola_get_tstamp(struct lola *chip, bool quick_no_sync) { unsigned int tstamp = lola_get_lrc(chip) >> 8; if (chip->granularity) { unsigned int wait_banks = quick_no_sync ? 0 : 8; tstamp += (wait_banks + 1) * chip->granularity - 1; tstamp -= tstamp % chip->granularity; } return ts...
[ 1, 0 ]
Linux Kernel
sound/pci/lola/lola_pcm.c
static void lola_stream_clear_pending_irq(struct lola *chip, struct lola_stream *str) { unsigned int val = lola_dsd_read(chip, str->dsd, STS); val &= LOLA_DSD_STS_DESE | LOLA_DSD_STS_BCIS; if (val) lola_dsd_write(chip, str->dsd, STS, val); }
[ 1, 0 ]
Linux Kernel
sound/pci/lola/lola_pcm.c
static int lola_stream_wait_for_fifo(struct lola *chip, struct lola_stream *str, bool ready) { unsigned int val = ready ? LOLA_DSD_STS_FIFORDY : 0; unsigned long end_time = jiffies + msecs_to_jiffies(200); while (time_before(jiffies, end_time)) { unsigned int reg = lola_d...
[ 1, 0 ]
Linux Kernel
sound/pci/lola/lola_pcm.c
static int lola_sync_wait_for_fifo(struct lola *chip, struct snd_pcm_substream *substream, bool ready) { unsigned int val = ready ? LOLA_DSD_STS_FIFORDY : 0; unsigned long end_time = jiffies + msecs_to_jiffies(200); struct snd_pcm_substream *s;...
[ 1, 0 ]
Linux Kernel
sound/pci/lola/lola_pcm.c
static void lola_stream_reset(struct lola *chip, struct lola_stream *str) { if (str->prepared) { if (str->paused) lola_sync_pause(chip, str->substream); str->prepared = 0; lola_dsd_write(chip, str->dsd, CTL, LOLA_DSD_CTL_IOCE | LOLA_DSD_CTL_DEIE); lola_stream_wait_for_fifo(chip, str, false); ...
[ 0, 0 ]
Linux Kernel
sound/pci/lola/lola_pcm.c
static int lola_pcm_open(struct snd_pcm_substream *substream) { struct lola *chip = snd_pcm_substream_chip(substream); struct lola_pcm *pcm = lola_get_pcm(substream); struct lola_stream *str = lola_get_stream(substream); struct snd_pcm_runtime *runtime = substream->runtime; mutex_lock(&chip->open_mutex); i...
[ 1, 0 ]
Linux Kernel
sound/pci/lola/lola_pcm.c
static int lola_pcm_close(struct snd_pcm_substream *substream) { struct lola *chip = snd_pcm_substream_chip(substream); struct lola_stream *str = lola_get_stream(substream); mutex_lock(&chip->open_mutex); if (str->substream == substream) { str->substream = NULL; str->opened = 0; } if (--chip->ref_c...
[ 1, 0 ]
Linux Kernel
sound/pci/lola/lola_pcm.c
static int setup_bdle(struct snd_pcm_substream *substream, struct lola_stream *str, __le32 **bdlp, int ofs, int size) { __le32 *bdl = *bdlp; while (size > 0) { dma_addr_t addr; int chunk; if (str->frags >= LOLA_MAX_BDL_ENTRIES) return -EINVAL; add...
[ 0, 0 ]
Linux Kernel
sound/pci/lola/lola_pcm.c
static int lola_setup_periods(struct lola *chip, struct lola_pcm *pcm, struct snd_pcm_substream *substream, struct lola_stream *str) { __le32 *bdl; int i, ofs, periods, period_bytes; period_bytes = str->period_bytes; periods = str->bufsize / period_by...
[ 1, 0 ]
Linux Kernel
sound/pci/lola/lola_pcm.c
static unsigned int lola_get_format_verb(struct snd_pcm_substream *substream) { unsigned int verb; switch (substream->runtime->format) { case SNDRV_PCM_FORMAT_S16_LE: verb = 0x00000000; break; case SNDRV_PCM_FORMAT_S24_LE: verb = 0x00000200; break; case SNDRV_PCM_FORMAT_S32_LE: verb = 0x...
[ 1, 0 ]
Linux Kernel
sound/pci/lola/lola_pcm.c
static int lola_setup_controller(struct lola *chip, struct lola_pcm *pcm, struct lola_stream *str) { dma_addr_t bdl; if (str->prepared) return -EINVAL; bdl = pcm->bdl->addr + LOLA_BDL_ENTRY_SIZE * str->index; lola_dsd_write(chip, str->dsd, BDPL, (u32)bdl); lola_dsd_write...
[ 1, 0 ]
Linux Kernel
sound/pci/lola/lola_pcm.c
static snd_pcm_uframes_t lola_pcm_pointer(struct snd_pcm_substream *substream) { struct lola *chip = snd_pcm_substream_chip(substream); struct lola_stream *str = lola_get_stream(substream); unsigned int pos = lola_dsd_read(chip, str->dsd, LPIB); if (pos >= str->bufsize) pos = 0; return bytes_to_frames(s...
[ 1, 0 ]
Linux Kernel
sound/pci/lola/lola_pcm.c
void lola_pcm_update(struct lola *chip, struct lola_pcm *pcm, unsigned int bits) { int i; u8 num_streams = min_t(u8, pcm->num_streams, ARRAY_SIZE(pcm->streams)); for (i = 0; bits && i < num_streams; i++) { if (bits & (1 << i)) { struct lola_stream *str = &pcm->streams[i]; if...
[ 1, 0 ]
Linux Kernel
sound/pci/lola/lola_pcm.c
int lola_create_pcm(struct lola *chip) { struct snd_pcm *pcm; int i, err; for (i = 0; i < 2; i++) { chip->pcm[i].bdl = snd_devm_alloc_pages(&chip->pci->dev, SNDRV_DMA_TYPE_DEV, PAGE_SIZE); if (!chip->pcm[i].bdl) return -ENOMEM; } err = snd_pcm_new(chip->card, "Digigram Lola", 0, ...
[ 1, 0 ]
Linux Kernel
sound/pci/lola/lola_pcm.c
static int lola_init_stream(struct lola *chip, struct lola_stream *str, int idx, int nid, int dir) { unsigned int val; int err; str->nid = nid; str->index = idx; str->dsd = idx; if (dir == PLAY) str->dsd += MAX_STREAM_IN_COUNT; err = lola_read_param(chip, nid, LOLA_PAR_AUD...
[ 1, 0 ]
Linux Kernel
sound/pci/lola/lola_proc.c
static void lola_proc_codec_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer) { struct lola *chip = entry->private_data; unsigned int val; int i, nid; lola_read_param(chip, 0, LOLA_PAR_VENDOR_ID, &val); snd_iprintf(buffer, "Vendor: 0x%08x\n", val); lola_re...
[ 1, 0 ]
Linux Kernel
sound/pci/lola/lola_proc.c
static void lola_proc_codec_rw_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer) { struct lola *chip = entry->private_data; snd_iprintf(buffer, "0x%x 0x%x\n", chip->debug_res, chip->debug_res_ex); }
[ 1, 0 ]
Linux Kernel
sound/pci/lx6464es/lx6464es.c
static int lx_pcm_close(struct snd_pcm_substream *substream) { dev_dbg(substream->pcm->card->dev, "->lx_pcm_close\n"); return 0; }
[ 1, 0 ]
Linux Kernel
sound/pci/lx6464es/lx6464es.c
static int lx_pcm_prepare(struct snd_pcm_substream *substream) { struct lx6464es *chip = snd_pcm_substream_chip(substream); int err = 0; const int is_capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE); dev_dbg(chip->card->dev, "->lx_pcm_prepare\n"); mutex_lock(&chip->setup_mutex); if (chip->hardw...
[ 1, 0 ]
Linux Kernel
sound/pci/lx6464es/lx6464es.c
static int lx_pcm_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *hw_params, int is_capture) { struct lx6464es *chip = snd_pcm_substream_chip(substream); dev_dbg(chip->card->dev, "->lx_pcm_hw_params\n"); mutex_lock(&chip->setup_mu...
[ 0, 0 ]
Linux Kernel
sound/pci/lx6464es/lx6464es.c
static int lx_set_granularity(struct lx6464es *chip, u32 gran) { int err = 0; u32 snapped_gran = MICROBLAZE_IBL_MIN; dev_dbg(chip->card->dev, "->lx_set_granularity\n"); while ((snapped_gran < gran) && (snapped_gran < MICROBLAZE_IBL_MAX)) { snapped_gran *= 2; } if (snapped_gran == chip->pcm_granularit...
[ 1, 0 ]
Linux Kernel
sound/pci/lx6464es/lx6464es.c
static int lx_control_playback_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct lx6464es *chip = snd_kcontrol_chip(kcontrol); ucontrol->value.integer.value[0] = chip->playback_mute; return 0; }
[ 0, 0 ]
Linux Kernel
sound/pci/lx6464es/lx6464es.c
static void lx_proc_levels_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer) { u32 levels[64]; int err; int i, j; struct lx6464es *chip = entry->private_data; snd_iprintf(buffer, "capture levels:\n"); err = lx_level_peaks(chip, 1, 64, levels); if (err < ...
[ 1, 0 ]
Linux Kernel
sound/pci/lx6464es/lx6464es.c
static int snd_lx6464es_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) { static int dev; struct snd_card *card; struct lx6464es *chip; int err; dev_dbg(&pci->dev, "->snd_lx6464es_probe\n"); if (dev >= SNDRV_CARDS) return -ENODEV; if (!enable[dev]) { ...
[ 1, 0 ]
Linux Kernel
sound/pci/lx6464es/lx_core.c
static void __iomem *lx_plx_register(struct lx6464es *chip, int port) { void __iomem *base_address = chip->port_plx_remapped; return base_address + plx_port_offsets[port]; }
[ 0, 0 ]
Linux Kernel
sound/pci/lx6464es/lx_core.c
void lx_plx_reg_write(struct lx6464es *chip, int port, u32 data) { void __iomem *address = lx_plx_register(chip, port); iowrite32(data, address); } #ifdef CONFIG_SND_DEBUG
[ 0, 0 ]
Linux Kernel
sound/pci/lx6464es/lx_core.c
int lx_dsp_get_version(struct lx6464es *chip, u32 *rdsp_version) { u16 ret; mutex_lock(&chip->msg_lock); lx_message_init(&chip->rmh, CMD_01_GET_SYS_CFG); ret = lx_message_send_atomic(chip, &chip->rmh); *rdsp_version = chip->rmh.stat[1]; mutex_unlock(&chip->msg_lock); return ret; }
[ 0, 0 ]
Linux Kernel
sound/pci/lx6464es/lx_core.c
int lx_dsp_get_clock_frequency(struct lx6464es *chip, u32 *rfreq) { u16 ret = 0; u32 freq_raw = 0; u32 freq = 0; u32 frequency = 0; mutex_lock(&chip->msg_lock); lx_message_init(&chip->rmh, CMD_01_GET_SYS_CFG); ret = lx_message_send_atomic(chip, &chip->rmh); if (ret == 0) { freq_raw = chip->rmh.st...
[ 0, 0 ]
Linux Kernel
sound/pci/lx6464es/lx_core.c
int lx_dsp_get_mac(struct lx6464es *chip) { u32 macmsb, maclsb; macmsb = lx_dsp_reg_read(chip, eReg_ADMACESMSB) & 0x00FFFFFF; maclsb = lx_dsp_reg_read(chip, eReg_ADMACESLSB) & 0x00FFFFFF; /* todo: endianess handling */ chip->mac_address[5] = ((u8 *)(&maclsb))[0]; chip->mac_address[4] = ((u8 *)(&maclsb))[1...
[ 1, 1 ]
Linux Kernel
sound/pci/lx6464es/lx_core.c
int lx_pipe_allocate(struct lx6464es *chip, u32 pipe, int is_capture, int channels) { int err; u32 pipe_cmd = PIPE_INFO_TO_CMD(is_capture, pipe); mutex_lock(&chip->msg_lock); lx_message_init(&chip->rmh, CMD_06_ALLOCATE_PIPE); chip->rmh.cmd[0] |= pipe_cmd; chip->rmh.cmd[0] |= channels;...
[ 0, 0 ]
Linux Kernel
sound/pci/lx6464es/lx_core.c
int lx_pipe_start(struct lx6464es *chip, u32 pipe, int is_capture) { int err; err = lx_pipe_wait_for_idle(chip, pipe, is_capture); if (err < 0) return err; err = lx_pipe_toggle_state(chip, pipe, is_capture); return err; }
[ 0, 0 ]
Linux Kernel
sound/pci/lx6464es/lx_core.c
int lx_pipe_state(struct lx6464es *chip, u32 pipe, int is_capture, u16 *rstate) { int err; u32 pipe_cmd = PIPE_INFO_TO_CMD(is_capture, pipe); mutex_lock(&chip->msg_lock); lx_message_init(&chip->rmh, CMD_0A_GET_PIPE_SPL_COUNT); chip->rmh.cmd[0] |= pipe_cmd; err = lx_message_send_atomic(...
[ 1, 0 ]
Linux Kernel
sound/pci/lx6464es/lx_core.c
int lx_stream_set_format(struct lx6464es *chip, struct snd_pcm_runtime *runtime, u32 pipe, int is_capture) { int err; u32 pipe_cmd = PIPE_INFO_TO_CMD(is_capture, pipe); u32 channels = runtime->channels; mutex_lock(&chip->msg_lock); lx_message_init(&chip->rmh, CMD_0C_DEF_STREAM); c...
[ 0, 0 ]
Linux Kernel
sound/pci/lx6464es/lx_core.c
int lx_stream_state(struct lx6464es *chip, u32 pipe, int is_capture, int *rstate) { int err; u32 pipe_cmd = PIPE_INFO_TO_CMD(is_capture, pipe); mutex_lock(&chip->msg_lock); lx_message_init(&chip->rmh, CMD_0E_GET_STREAM_SPL_COUNT); chip->rmh.cmd[0] |= pipe_cmd; err = lx_message_send_a...
[ 0, 0 ]
Linux Kernel
sound/pci/lx6464es/lx_core.c
int lx_level_unmute(struct lx6464es *chip, int is_capture, int unmute) { int err; u64 mute_mask = unmute ? 0 : 0xFFFFFFFFFFFFFFFFLLU; mutex_lock(&chip->msg_lock); lx_message_init(&chip->rmh, CMD_0D_SET_MUTE); chip->rmh.cmd[0] |= PIPE_INFO_TO_CMD(is_capture, 0); chip->rmh.cmd[1] = (u32)(mute_mask >> (u64...
[ 1, 1 ]