Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | sound/pci/rme32.c |
static int snd_rme32_info_inputtype_control(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo) {
struct rme32 *rme32 = snd_kcontrol_chip(kcontrol);
static const char *const texts[4] = {"Optical", "Coaxial", "Internal", "XLR"};
int num_items;
switch (rme... | [
0,
0
] |
Linux Kernel | sound/pci/rme32.c | static int
snd_rme32_get_inputtype_control(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct rme32 *rme32 = snd_kcontrol_chip(kcontrol);
unsigned int items = 3;
spin_lock_irq(&rme32->lock);
ucontrol->value.enumerated.item[0] = snd_rme32_getinputtype(rm... | [
1,
0
] |
Linux Kernel | sound/pci/rme32.c |
static int
snd_rme32_control_spdif_stream_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo) {
uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958;
uinfo->count = 1;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/pci/rme32.c | static void snd_rme32_card_free(struct snd_card *card) {
snd_rme32_free(card->private_data);
} | [
0,
0
] |
Linux Kernel | sound/pci/rme32.c |
static int snd_rme32_probe(struct pci_dev *pci,
const struct pci_device_id *pci_id) {
return snd_card_free_on_error(&pci->dev, __snd_rme32_probe(pci, pci_id));
} | [
0,
0
] |
Linux Kernel | sound/pci/rme96.c |
static int snd_rme96_capture_copy(struct snd_pcm_substream *substream,
int channel, unsigned long pos,
void __user *dst, unsigned long count) {
struct rme96 *rme96 = snd_pcm_substream_chip(substream);
return copy_to_user_fromio(dst, rme96->iobase... | [
0,
0
] |
Linux Kernel | sound/pci/rme96.c |
static void snd_rme96_apply_dac_volume(struct rme96 *rme96) {
if (RME96_DAC_IS_1852(rme96)) {
snd_rme96_write_SPI(rme96, (rme96->vol[0] << 2) | 0x0);
snd_rme96_write_SPI(rme96, (rme96->vol[1] << 2) | 0x2);
} else if (RME96_DAC_IS_1855(rme96)) {
snd_rme96_write_SPI(rme96, (rme96->vol[0] & 0x3FF) | 0x000... | [
0,
0
] |
Linux Kernel | sound/pci/rme96.c |
static void snd_rme96_reset_dac(struct rme96 *rme96) {
writel(rme96->wcreg | RME96_WCR_PD,
rme96->iobase + RME96_IO_CONTROL_REGISTER);
writel(rme96->wcreg, rme96->iobase + RME96_IO_CONTROL_REGISTER);
} | [
1,
0
] |
Linux Kernel | sound/pci/rme96.c |
static int snd_rme96_getattenuation(struct rme96 *rme96) {
return ((rme96->wcreg >> RME96_WCR_BITPOS_GAIN_0) & 1) +
(((rme96->wcreg >> RME96_WCR_BITPOS_GAIN_1) & 1) << 1);
} | [
0,
0
] |
Linux Kernel | sound/pci/rme96.c |
static int snd_rme96_capture_setformat(struct rme96 *rme96,
snd_pcm_format_t format) {
switch (format) {
case SNDRV_PCM_FORMAT_S16_LE:
rme96->wcreg &= ~RME96_WCR_MODE24_2;
break;
case SNDRV_PCM_FORMAT_S32_LE:
rme96->wcreg |= RME96_WCR_MODE24_2;
break;
defa... | [
1,
0
] |
Linux Kernel | sound/pci/rme96.c |
static void snd_rme96_set_period_properties(struct rme96 *rme96,
size_t period_bytes) {
switch (period_bytes) {
case RME96_LARGE_BLOCK_SIZE:
rme96->wcreg &= ~RME96_WCR_ISEL;
break;
case RME96_SMALL_BLOCK_SIZE:
rme96->wcreg |= RME96_WCR_ISEL;
break;
de... | [
1,
0
] |
Linux Kernel | sound/pci/rme96.c |
static void rme96_set_buffer_size_constraint(struct rme96 *rme96,
struct snd_pcm_runtime *runtime) {
unsigned int size;
snd_pcm_hw_constraint_single(runtime, SNDRV_PCM_HW_PARAM_BUFFER_BYTES,
RME96_BUFFER_SIZE);
size = rme96->playback_pe... | [
0,
0
] |
Linux Kernel | sound/pci/rme96.c |
static int snd_rme96_capture_spdif_open(struct snd_pcm_substream *substream) {
int isadat, rate;
struct rme96 *rme96 = snd_pcm_substream_chip(substream);
struct snd_pcm_runtime *runtime = substream->runtime;
snd_pcm_set_sync(substream);
runtime->hw = snd_rme96_capture_spdif_info;
if (snd_rme96_getinputtyp... | [
0,
0
] |
Linux Kernel | sound/pci/rme96.c | static int snd_rme96_playback_adat_open(struct snd_pcm_substream *substream) {
int rate, dummy;
struct rme96 *rme96 = snd_pcm_substream_chip(substream);
struct snd_pcm_runtime *runtime = substream->runtime;
snd_pcm_set_sync(substream);
spin_lock_irq(&rme96->lock);
if (rme96->playback_substream) {
spin_... | [
1,
0
] |
Linux Kernel | sound/pci/rme96.c |
static int snd_rme96_playback_trigger(struct snd_pcm_substream *substream,
int cmd) {
struct rme96 *rme96 = snd_pcm_substream_chip(substream);
struct snd_pcm_substream *s;
bool sync;
snd_pcm_group_for_each_entry(s, substream) {
if (snd_pcm_substream_chip(s) == rme96)
... | [
1,
0
] |
Linux Kernel | sound/pci/rme96.c |
static int snd_rme96_capture_trigger(struct snd_pcm_substream *substream,
int cmd) {
struct rme96 *rme96 = snd_pcm_substream_chip(substream);
struct snd_pcm_substream *s;
bool sync;
snd_pcm_group_for_each_entry(s, substream) {
if (snd_pcm_substream_chip(s) == rme96)
... | [
1,
0
] |
Linux Kernel | sound/pci/rme96.c |
static void snd_rme96_free(struct rme96 *rme96) {
if (rme96->irq >= 0) {
snd_rme96_trigger(rme96, RME96_STOP_BOTH);
rme96->areg &= ~RME96_AR_DAC_EN;
writel(rme96->areg, rme96->iobase + RME96_IO_ADDITIONAL_REG);
}
#ifdef CONFIG_PM_SLEEP
vfree(rme96->playback_suspend_buffer);
vfree(rme96->capture_sus... | [
1,
0
] |
Linux Kernel | sound/pci/rme96.c |
static void snd_rme96_free_spdif_pcm(struct snd_pcm *pcm) {
struct rme96 *rme96 = pcm->private_data;
rme96->spdif_pcm = NULL;
} | [
0,
0
] |
Linux Kernel | sound/pci/rme96.c |
static void snd_rme96_free_adat_pcm(struct snd_pcm *pcm) {
struct rme96 *rme96 = pcm->private_data;
rme96->adat_pcm = NULL;
} | [
0,
0
] |
Linux Kernel | sound/pci/rme96.c |
static int snd_rme96_get_loopback_control(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct rme96 *rme96 = snd_kcontrol_chip(kcontrol);
spin_lock_irq(&rme96->lock);
ucontrol->value.integer.value[0] = rme96->wcreg & RME96_WCR_SEL ? 0 : 1;
spi... | [
1,
0
] |
Linux Kernel | sound/pci/rme96.c | static int
snd_rme96_get_inputtype_control(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct rme96 *rme96 = snd_kcontrol_chip(kcontrol);
unsigned int items = 3;
spin_lock_irq(&rme96->lock);
ucontrol->value.enumerated.item[0] = snd_rme96_getinputtype(rm... | [
1,
0
] |
Linux Kernel | sound/pci/rme96.c |
static u32 snd_rme96_convert_from_aes(struct snd_aes_iec958 *aes) {
u32 val = 0;
val |= (aes->status[0] & IEC958_AES0_PROFESSIONAL) ? RME96_WCR_PRO : 0;
val |= (aes->status[0] & IEC958_AES0_NONAUDIO) ? RME96_WCR_DOLBY : 0;
if (val & RME96_WCR_PRO)
val |= (aes->status[0] & IEC958_AES0_PRO_EMPHASIS_5015) ? R... | [
0,
0
] |
Linux Kernel | sound/pci/rme96.c |
static void snd_rme96_convert_to_aes(struct snd_aes_iec958 *aes, u32 val) {
aes->status[0] = ((val & RME96_WCR_PRO) ? IEC958_AES0_PROFESSIONAL : 0) |
((val & RME96_WCR_DOLBY) ? IEC958_AES0_NONAUDIO : 0);
if (val & RME96_WCR_PRO)
aes->status[0] |= (val & RME96_WCR_EMP) ? IEC958_AES0_PRO_EMPHA... | [
0,
0
] |
Linux Kernel | sound/pci/rme96.c |
static int
snd_rme96_control_spdif_stream_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo) {
uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958;
uinfo->count = 1;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/pci/rme96.c |
static int
snd_rme96_control_spdif_stream_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct rme96 *rme96 = snd_kcontrol_chip(kcontrol);
int change;
u32 val;
val = snd_rme96_convert_from_aes(&ucontrol->value.iec958);
spin_lock_irq(&rme96->lock... | [
1,
0
] |
Linux Kernel | sound/pci/rme96.c |
static int snd_rme96_dac_volume_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo) {
struct rme96 *rme96 = 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/pci/rme96.c | static int snd_rme96_create_switches(struct snd_card *card,
struct rme96 *rme96) {
int idx, err;
struct snd_kcontrol *kctl;
for (idx = 0; idx < 7; idx++) {
kctl = snd_ctl_new1(&snd_rme96_controls[idx], rme96);
err = snd_ctl_add(card, kctl);
if (err < 0)
retu... | [
1,
0
] |
Linux Kernel | sound/pci/rme96.c | static int rme96_resume(struct device *dev) {
struct snd_card *card = dev_get_drvdata(dev);
struct rme96 *rme96 = card->private_data;
writel(0, rme96->iobase + RME96_IO_SET_PLAY_POS + rme96->playback_pointer);
writel(0, rme96->iobase + RME96_IO_SET_REC_POS + rme96->capture_pointer);
/* restore playback and ... | [
1,
0
] |
Linux Kernel | sound/pci/rme9652/hdsp.c | static int hdsp_check_for_firmware(struct hdsp *hdsp, int load_on_demand) {
if (hdsp->io_type == H9652 || hdsp->io_type == H9632)
return 0;
if ((hdsp_read(hdsp, HDSP_statusRegister) & HDSP_DllError) != 0) {
hdsp->state &= ~HDSP_FirmwareLoaded;
if (!load_on_demand)
return -EIO;
dev_err(hdsp->ca... | [
1,
0
] |
Linux Kernel | sound/pci/rme9652/hdsp.c | static int hdsp_write_gain(struct hdsp *hdsp, unsigned int addr,
unsigned short data) {
unsigned int ad;
if (addr >= HDSP_MATRIX_MIXER_SIZE)
return -1;
if (hdsp->io_type == H9652 || hdsp->io_type == H9632) {
if (hdsp->io_type == H9632 && addr >= 512)
return 0;
if (... | [
1,
0
] |
Linux Kernel | sound/pci/rme9652/hdsp.c | static int hdsp_spdif_sample_rate(struct hdsp *hdsp) {
unsigned int status = hdsp_read(hdsp, HDSP_statusRegister);
unsigned int rate_bits = (status & HDSP_spdifFrequencyMask);
if (hdsp->io_type == H9632)
rate_bits = (status & HDSP_spdifFrequencyMask_9632);
if (status & HDSP_SPDIFErrorFlag)
return 0;
... | [
1,
0
] |
Linux Kernel | sound/pci/rme9652/hdsp.c | static void hdsp_reset_hw_pointer(struct hdsp *hdsp) {
hdsp_write(hdsp, HDSP_resetPointer, 0);
if (hdsp->io_type == H9632 && hdsp->firmware_rev >= 152)
hdsp_write(hdsp, HDSP_freqReg, hdsp->dds_value);
} | [
1,
0
] |
Linux Kernel | sound/pci/rme9652/hdsp.c | static void hdsp_set_dds_value(struct hdsp *hdsp, int rate) {
u64 n;
if (rate >= 112000)
rate /= 4;
else if (rate >= 56000)
rate /= 2;
n = DDS_NUMERATOR;
n = div_u64(n, rate);
snd_BUG_ON(n >> 32);
/* HDSP_freqReg and HDSP_resetPointer are the same, so keep the DDS
value to write it after a... | [
0,
0
] |
Linux Kernel | sound/pci/rme9652/hdsp.c | static void snd_hdsp_midi_write_byte(struct hdsp *hdsp, int id, int val) {
if (id)
hdsp_write(hdsp, HDSP_midiDataOut1, val);
else
hdsp_write(hdsp, HDSP_midiDataOut0, val);
} | [
0,
0
] |
Linux Kernel | sound/pci/rme9652/hdsp.c |
static int snd_hdsp_midi_output_possible(struct hdsp *hdsp, int id) {
int fifo_bytes_used;
if (id)
fifo_bytes_used = hdsp_read(hdsp, HDSP_midiStatusOut1) & 0xff;
else
fifo_bytes_used = hdsp_read(hdsp, HDSP_midiStatusOut0) & 0xff;
if (fifo_bytes_used < 128)
return 128 - fifo_bytes_used;
else
... | [
1,
0
] |
Linux Kernel | sound/pci/rme9652/hdsp.c |
static int snd_hdsp_midi_output_open(struct snd_rawmidi_substream *substream) {
struct hdsp_midi *hmidi;
hmidi = (struct hdsp_midi *)substream->rmidi->private_data;
spin_lock_irq(&hmidi->lock);
hmidi->output = substream;
spin_unlock_irq(&hmidi->lock);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/pci/rme9652/hdsp.c |
static int snd_hdsp_create_midi(struct snd_card *card, struct hdsp *hdsp,
int id) {
char buf[40];
hdsp->midi[id].id = id;
hdsp->midi[id].rmidi = NULL;
hdsp->midi[id].input = NULL;
hdsp->midi[id].output = NULL;
hdsp->midi[id].hdsp = hdsp;
hdsp->midi[id].istimer = 0;
hdsp... | [
1,
0
] |
Linux Kernel | sound/pci/rme9652/hdsp.c |
static void snd_hdsp_convert_to_aes(struct snd_aes_iec958 *aes, u32 val) {
aes->status[0] =
((val & HDSP_SPDIFProfessional) ? IEC958_AES0_PROFESSIONAL : 0) |
((val & HDSP_SPDIFNonAudio) ? IEC958_AES0_NONAUDIO : 0);
if (val & HDSP_SPDIFProfessional)
aes->status[0] |=
(val & HDSP_SPDIFEmphasi... | [
0,
0
] |
Linux Kernel | sound/pci/rme9652/hdsp.c |
static int
snd_hdsp_control_spdif_stream_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
snd_hdsp_convert_to_aes(&ucontrol->value.iec958, hdsp->creg_spdif_stream);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/pci/rme9652/hdsp.c |
static int
snd_hdsp_control_spdif_stream_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
int change;
u32 val;
val = snd_hdsp_convert_from_aes(&ucontrol->value.iec958);
spin_lock_irq(&hdsp->lock);
c... | [
0,
0
] |
Linux Kernel | sound/pci/rme9652/hdsp.c |
static int snd_hdsp_control_spdif_mask_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo) {
uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958;
uinfo->count = 1;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/pci/rme9652/hdsp.c |
static int
snd_hdsp_control_spdif_mask_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
ucontrol->value.iec958.status[0] = kcontrol->private_value;
return 0;
}
#define HDSP_SPDIF_IN(xname, xindex) \
{.iface = SNDR... | [
0,
0
] |
Linux Kernel | sound/pci/rme9652/hdsp.c |
static int snd_hdsp_info_spdif_in(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo) {
static const char *const texts[4] = {"Optical", "Coaxial", "Internal", "AES"};
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
return snd_ctl_enum_info(uinfo, 1, (hdsp->io_type ... | [
0,
0
] |
Linux Kernel | sound/pci/rme9652/hdsp.c |
static int snd_hdsp_get_spdif_sample_rate(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
switch (hdsp_spdif_sample_rate(hdsp)) {
case 32000:
ucontrol->value.enumerated.item[0] = 0;
break;
... | [
0,
0
] |
Linux Kernel | sound/pci/rme9652/hdsp.c |
static int snd_hdsp_info_autosync_sample_rate(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo) {
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
static const char *const texts[] = {"32000", "44100", "48000", "64000",
... | [
0,
0
] |
Linux Kernel | sound/pci/rme9652/hdsp.c |
static int hdsp_system_clock_mode(struct hdsp *hdsp) {
if (hdsp->control_register & HDSP_ClockModeMaster)
return 0;
else if (hdsp_external_sample_rate(hdsp) != hdsp->system_sample_rate)
return 0;
return 1;
} | [
0,
0
] |
Linux Kernel | sound/pci/rme9652/hdsp.c |
static int snd_hdsp_info_clock_source(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo) {
static const char *const texts[] = {
"AutoSync", "Internal 32.0 kHz", "Internal 44.1 kHz",
"Internal 48.0 kHz", "Internal 64.0 kHz", "Internal 88.2 kHz",
... | [
0,
0
] |
Linux Kernel | sound/pci/rme9652/hdsp.c |
static int snd_hdsp_get_pref_sync_ref(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
ucontrol->value.enumerated.item[0] = hdsp_pref_sync_ref(hdsp);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/pci/rme9652/hdsp.c | static int hdsp_autosync_ref(struct hdsp *hdsp) {
unsigned int status2 = hdsp_read(hdsp, HDSP_status2Register);
switch (status2 & HDSP_SelSyncRefMask) {
case HDSP_SelSyncRef_WORD:
return HDSP_AUTOSYNC_FROM_WORD;
case HDSP_SelSyncRef_ADAT_SYNC:
return HDSP_AUTOSYNC_FROM_ADAT_SYNC;
case HDSP_SelSyncRe... | [
1,
0
] |
Linux Kernel | sound/pci/rme9652/hdsp.c |
static int snd_hdsp_info_autosync_ref(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo) {
static const char *const texts[] = {"Word", "ADAT Sync", "IEC958", "None",
"ADAT1", "ADAT2", "ADAT3"};
return snd_ctl_enum_info(u... | [
0,
0
] |
Linux Kernel | sound/pci/rme9652/hdsp.c |
static int hdsp_set_use_midi_work(struct hdsp *hdsp, int use_work) {
if (use_work)
hdsp->use_midi_work = 1;
else
hdsp->use_midi_work = 0;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/pci/rme9652/hdsp.c |
static int hdsp_spdif_sync_check(struct hdsp *hdsp) {
int status = hdsp_read(hdsp, HDSP_statusRegister);
if (status & HDSP_SPDIFErrorFlag)
return 0;
else {
if (status & HDSP_SPDIFSync)
return 2;
else
return 1;
}
return 0;
} | [
0,
0
] |
Linux Kernel | sound/pci/rme9652/hdsp.c |
static int snd_hdsp_get_adat_sync_check(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
int offset;
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
offset = ucontrol->id.index - 1;
if (snd_BUG_ON(offset < 0))
return -EINVAL;
switch (hdsp->i... | [
0,
0
] |
Linux Kernel | sound/pci/rme9652/hdsp.c |
static int hdsp_set_dds_offset(struct hdsp *hdsp, int offset_hz) {
int rate = hdsp->system_sample_rate + offset_hz;
hdsp_set_dds_value(hdsp, rate);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/pci/rme9652/hdsp.c |
static int snd_hdsp_put_dds_offset(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
int change;
int val;
if (!snd_hdsp_use_is_exclusive(hdsp))
return -EBUSY;
val = ucontrol->value.integer.value[0];
... | [
0,
0
] |
Linux Kernel | sound/pci/rme9652/hdsp.c |
static int snd_hdsp_put_rpm_input34(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
int change;
int val;
if (!snd_hdsp_use_is_exclusive(hdsp))
return -EBUSY;
val = ucontrol->value.enumerated.item[... | [
0,
0
] |
Linux Kernel | sound/pci/rme9652/hdsp.c |
static int hdsp_set_rpm_disconnect(struct hdsp *hdsp, int on) {
if (on)
hdsp->control_register |= HDSP_RPM_Disconnect;
else
hdsp->control_register &= ~HDSP_RPM_Disconnect;
hdsp_write(hdsp, HDSP_controlRegister, hdsp->control_register);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/pci/rme9652/hdsp.c |
static int snd_hdsp_info_rpm_disconnect(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo) {
static const char *const texts[] = {"On", "Off"};
return snd_ctl_enum_info(uinfo, 1, 2, texts);
} | [
0,
0
] |
Linux Kernel | sound/pci/rme9652/hdsp.c |
static int snd_hdsp_loopback_get(struct snd_kcontrol *const kcontrol,
struct snd_ctl_elem_value *const ucontrol) {
struct hdsp *const hdsp = snd_kcontrol_chip(kcontrol);
const u8 channel = snd_ctl_get_ioff(kcontrol, &ucontrol->id);
if (channel >= hdsp->max_channels)
return -... | [
0,
0
] |
Linux Kernel | sound/pci/rme9652/hdsp.c |
static signed char *hdsp_channel_buffer_location(struct hdsp *hdsp, int stream,
int channel)
{
int mapped_channel;
if (snd_BUG_ON(channel < 0 || channel >= hdsp->max_channels))
return NULL;
mapped_channel = hdsp->channel_map[channel];
if (mapped_channel <... | [
1,
0
] |
Linux Kernel | sound/pci/rme9652/hdsp.c |
static int snd_hdsp_capture_copy(struct snd_pcm_substream *substream,
int channel, unsigned long pos,
void __user *dst, unsigned long count) {
struct hdsp *hdsp = snd_pcm_substream_chip(substream);
signed char *channel_buf;
if (snd_BUG_ON(pos + c... | [
0,
0
] |
Linux Kernel | sound/pci/rme9652/hdsp.c |
static int snd_hdsp_channel_info(struct snd_pcm_substream *substream,
struct snd_pcm_channel_info *info) {
struct hdsp *hdsp = snd_pcm_substream_chip(substream);
unsigned int channel = info->channel;
if (snd_BUG_ON(channel >= hdsp->max_channels))
return -EINVAL;
channel = ... | [
1,
0
] |
Linux Kernel | sound/pci/rme9652/hdsp.c | static int snd_hdsp_trigger(struct snd_pcm_substream *substream, int cmd) {
struct hdsp *hdsp = snd_pcm_substream_chip(substream);
struct snd_pcm_substream *other;
int running;
if (hdsp_check_for_iobox(hdsp))
return -EIO;
if (hdsp_check_for_firmware(hdsp, 0))
return -EIO;
spin_lock(&hdsp->lock);
... | [
1,
0
] |
Linux Kernel | sound/pci/rme9652/hdsp.c |
static int snd_hdsp_prepare(struct snd_pcm_substream *substream) {
struct hdsp *hdsp = snd_pcm_substream_chip(substream);
int result = 0;
if (hdsp_check_for_iobox(hdsp))
return -EIO;
if (hdsp_check_for_firmware(hdsp, 1))
return -EIO;
spin_lock_irq(&hdsp->lock);
if (!hdsp->running)
hdsp_reset... | [
0,
0
] |
Linux Kernel | sound/pci/rme9652/hdsp.c |
static int snd_hdsp_hw_rule_in_channels(struct snd_pcm_hw_params *params,
struct snd_pcm_hw_rule *rule) {
struct hdsp *hdsp = rule->private;
struct snd_interval *c =
hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS);
if (hdsp->io_type == H9632) {
unsigned in... | [
0,
0
] |
Linux Kernel | sound/pci/rme9652/hdsp.c |
static int snd_hdsp_hw_rule_out_channels_rate(struct snd_pcm_hw_params *params,
struct snd_pcm_hw_rule *rule) {
struct hdsp *hdsp = rule->private;
struct snd_interval *c =
hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS);
struct snd_interval *r = hw_param... | [
1,
0
] |
Linux Kernel | sound/pci/rme9652/hdsp.c |
static int snd_hdsp_hw_rule_rate_out_channels(struct snd_pcm_hw_params *params,
struct snd_pcm_hw_rule *rule) {
struct hdsp *hdsp = rule->private;
struct snd_interval *c =
hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS);
struct snd_interval *r = hw_param... | [
1,
0
] |
Linux Kernel | sound/pci/rme9652/hdsp.c |
static int snd_hdsp_capture_release(struct snd_pcm_substream *substream) {
struct hdsp *hdsp = snd_pcm_substream_chip(substream);
spin_lock_irq(&hdsp->lock);
hdsp->capture_pid = -1;
hdsp->capture_substream = NULL;
spin_unlock_irq(&hdsp->lock);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/pci/rme9652/hdsp.c |
static int snd_hdsp_create_hwdep(struct snd_card *card, struct hdsp *hdsp) {
struct snd_hwdep *hw;
int err;
err = snd_hwdep_new(card, "HDSP hwdep", 0, &hw);
if (err < 0)
return err;
hdsp->hwdep = hw;
hw->private_data = hdsp;
strcpy(hw->name, "HDSP hwdep interface");
hw->ops.ioctl = snd_hdsp_hwde... | [
1,
0
] |
Linux Kernel | sound/pci/rme9652/hdsp.c |
static int snd_hdsp_create_pcm(struct snd_card *card, struct hdsp *hdsp) {
struct snd_pcm *pcm;
int err;
err = snd_pcm_new(card, hdsp->card_name, 0, 1, 1, &pcm);
if (err < 0)
return err;
hdsp->pcm = pcm;
pcm->private_data = hdsp;
strcpy(pcm->name, hdsp->card_name);
snd_pcm_set_ops(pcm, SNDRV_PCM... | [
1,
0
] |
Linux Kernel | sound/pci/rme9652/hdsp.c |
static int snd_hdsp_probe(struct pci_dev *pci,
const struct pci_device_id *pci_id) {
static int dev;
struct hdsp *hdsp;
struct snd_card *card;
int err;
if (dev >= SNDRV_CARDS)
return -ENODEV;
if (!enable[dev]) {
dev++;
return -ENOENT;
}
err = snd_devm_card_new(&p... | [
1,
0
] |
Linux Kernel | sound/pci/rme9652/hdspm.c |
static inline int HDSPM_bit2freq(int n) {
static const int bit2freq_tab[] = {0, 32000, 44100, 48000, 64000,
88200, 96000, 128000, 176400, 192000};
if (n < 1 || n > 9)
return 0;
return bit2freq_tab[n];
} | [
1,
0
] |
Linux Kernel | sound/pci/rme9652/hdspm.c |
static inline int hdspm_read_pb_gain(struct hdspm *hdspm, unsigned int chan,
unsigned int pb) {
if (chan >= HDSPM_MIXER_CHANNELS || pb >= HDSPM_MIXER_CHANNELS)
return 0;
return hdspm->mixer->ch[chan].pb[pb];
} | [
1,
0
] |
Linux Kernel | sound/pci/rme9652/hdspm.c |
static int hdspm_write_pb_gain(struct hdspm *hdspm, unsigned int chan,
unsigned int pb, unsigned short data) {
if (chan >= HDSPM_MIXER_CHANNELS || pb >= HDSPM_MIXER_CHANNELS)
return -1;
hdspm_write(hdspm,
HDSPM_MADI_mixerBase + ((64 + pb + 128 * chan) * sizeof(u32)... | [
1,
0
] |
Linux Kernel | sound/pci/rme9652/hdspm.c |
static inline void snd_hdspm_enable_out(struct hdspm *hdspm, int i, int v) {
hdspm_write(hdspm, HDSPM_outputEnableBase + (4 * i), v);
} | [
0,
0
] |
Linux Kernel | sound/pci/rme9652/hdspm.c | static int hdspm_rate_multiplier(struct hdspm *hdspm, int rate) {
if (rate <= 48000) {
if (hdspm->control_register & HDSPM_QuadSpeed)
return rate * 4;
else if (hdspm->control_register & HDSPM_DoubleSpeed)
return rate * 2;
}
return rate;
} | [
0,
0
] |
Linux Kernel | sound/pci/rme9652/hdspm.c | static inline void hdspm_compute_period_size(struct hdspm *hdspm) {
hdspm->period_bytes = 4 * hdspm_get_latency(hdspm);
} | [
0,
0
] |
Linux Kernel | sound/pci/rme9652/hdspm.c | static snd_pcm_uframes_t hdspm_hw_pointer(struct hdspm *hdspm) {
int position;
position = hdspm_read(hdspm, HDSPM_statusRegister);
switch (hdspm->io_type) {
case RayDAT:
case AIO:
position &= HDSPM_BufferPositionMask;
position /= 4;
break;
default:
position = (position & HDSPM_BufferID) ? ... | [
0,
0
] |
Linux Kernel | sound/pci/rme9652/hdspm.c |
static inline void hdspm_stop_audio(struct hdspm *s) {
s->control_register &= ~(HDSPM_Start | HDSPM_AudioInterruptEnable);
hdspm_write(s, HDSPM_controlRegister, s->control_register);
} | [
0,
0
] |
Linux Kernel | sound/pci/rme9652/hdspm.c |
static u64 hdspm_calc_dds_value(struct hdspm *hdspm, u64 period) {
u64 freq_const;
if (period == 0)
return 0;
switch (hdspm->io_type) {
case MADI:
case AES32:
freq_const = 110069313433624ULL;
break;
case RayDAT:
case AIO:
freq_const = 104857600000000ULL;
break;
case MADIface:
... | [
0,
0
] |
Linux Kernel | sound/pci/rme9652/hdspm.c | static void hdspm_set_dds_value(struct hdspm *hdspm, int rate) {
u64 n;
if (snd_BUG_ON(rate <= 0))
return;
if (rate >= 112000)
rate /= 4;
else if (rate >= 56000)
rate /= 2;
switch (hdspm->io_type) {
case MADIface:
n = 131072000000000ULL;
break;
case MADI:
case AES32:
n = 11006... | [
0,
0
] |
Linux Kernel | sound/pci/rme9652/hdspm.c | static void all_in_all_mixer(struct hdspm *hdspm, int sgain) {
int i, j;
unsigned int gain;
if (sgain > UNITY_GAIN)
gain = UNITY_GAIN;
else if (sgain < 0)
gain = 0;
else
gain = sgain;
for (i = 0; i < HDSPM_MIXER_CHANNELS; i++)
for (j = 0; j < HDSPM_MIXER_CHANNELS; j++) {
hdspm_write_... | [
0,
0
] |
Linux Kernel | sound/pci/rme9652/hdspm.c | static inline void snd_hdspm_midi_write_byte(struct hdspm *hdspm, int id,
int val) {
return hdspm_write(hdspm, hdspm->midi[id].dataOut, val);
} | [
0,
0
] |
Linux Kernel | sound/pci/rme9652/hdspm.c | static int snd_hdspm_midi_input_read(struct hdspm_midi *hmidi) {
unsigned char buf[128];
unsigned long flags;
int n_pending;
int i;
spin_lock_irqsave(&hmidi->lock, flags);
n_pending = snd_hdspm_midi_input_available(hmidi->hdspm, hmidi->id);
if (n_pending > 0) {
if (hmidi->input) {
if (n_pending... | [
1,
0
] |
Linux Kernel | sound/pci/rme9652/hdspm.c | static void snd_hdspm_midi_output_timer(struct timer_list *t) {
struct hdspm_midi *hmidi = from_timer(hmidi, t, timer);
unsigned long flags;
snd_hdspm_midi_output_write(hmidi);
spin_lock_irqsave(&hmidi->lock, flags);
if (hmidi->istimer)
mod_timer(&hmidi->timer, 1 + jiffies);
spin_unlock_irqrestore(&h... | [
0,
0
] |
Linux Kernel | sound/pci/rme9652/hdspm.c |
static void
snd_hdspm_midi_output_trigger(struct snd_rawmidi_substream *substream, int up) {
struct hdspm_midi *hmidi;
unsigned long flags;
hmidi = substream->rmidi->private_data;
spin_lock_irqsave(&hmidi->lock, flags);
if (up) {
if (!hmidi->istimer) {
timer_setup(&hmidi->timer, snd_hdspm_midi_out... | [
1,
0
] |
Linux Kernel | sound/pci/rme9652/hdspm.c |
static void hdspm_midi_work(struct work_struct *work) {
struct hdspm *hdspm = container_of(work, struct hdspm, midi_work);
int i = 0;
while (i < hdspm->midiPorts) {
if (hdspm->midi[i].pending)
snd_hdspm_midi_input_read(&hdspm->midi[i]);
i++;
}
} | [
0,
0
] |
Linux Kernel | sound/pci/rme9652/hdspm.c |
static int
snd_hdspm_put_system_sample_rate(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct hdspm *hdspm = snd_kcontrol_chip(kcontrol);
int rate = ucontrol->value.integer.value[0];
if (rate < 27000 || rate > 207000)
return -EINVAL;
hdspm_set_dd... | [
1,
0
] |
Linux Kernel | sound/pci/rme9652/hdspm.c | static int hdspm_get_tco_sample_rate(struct hdspm *hdspm) {
int status;
if (hdspm->tco) {
switch (hdspm->io_type) {
case RayDAT:
case AIO:
status = hdspm_read(hdspm, HDSPM_RD_STATUS_1);
return (status >> 20) & 0xF;
case AES32:
status = hdspm_read(hdspm, HDSPM_statusRegister);
... | [
0,
0
] |
Linux Kernel | sound/pci/rme9652/hdspm.c | static int hdspm_get_s1_sample_rate(struct hdspm *hdspm, unsigned int idx) {
int status = hdspm_read(hdspm, HDSPM_RD_STATUS_2);
return (status >> (idx * 4)) & 0xF;
}
#define ENUMERATED_CTL_INFO(info, texts) \
snd_ctl_enum_info(info, 1, ARRAY_SIZE(texts), texts) | [
0,
0
] |
Linux Kernel | sound/pci/rme9652/hdspm.c | static void hdspm_set_system_clock_mode(struct hdspm *hdspm, int mode) {
hdspm_set_toggle_setting(
hdspm,
(hdspm_is_raydat_or_aio(hdspm)) ? HDSPM_c0Master : HDSPM_ClockModeMaster,
(0 == mode));
} | [
0,
0
] |
Linux Kernel | sound/pci/rme9652/hdspm.c |
static int snd_hdspm_info_system_clock_mode(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo) {
static const char *const texts[] = {"Master", "AutoSync"};
ENUMERATED_CTL_INFO(uinfo, texts);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/pci/rme9652/hdspm.c |
static int hdspm_clock_source(struct hdspm *hdspm) {
switch (hdspm->system_sample_rate) {
case 32000:
return 0;
case 44100:
return 1;
case 48000:
return 2;
case 64000:
return 3;
case 88200:
return 4;
case 96000:
return 5;
case 128000:
return 6;
case 176400:
return 7;
... | [
1,
0
] |
Linux Kernel | sound/pci/rme9652/hdspm.c |
static int hdspm_set_clock_source(struct hdspm *hdspm, int mode) {
int rate;
switch (mode) {
case 0:
rate = 32000;
break;
case 1:
rate = 44100;
break;
case 2:
rate = 48000;
break;
case 3:
rate = 64000;
break;
case 4:
rate = 88200;
break;
case 5:
rate = 96000;... | [
0,
0
] |
Linux Kernel | sound/pci/rme9652/hdspm.c | static int
snd_hdspm_get_tco_video_input_format(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
u32 status;
int ret = 0;
struct hdspm *hdspm = snd_kcontrol_chip(kcontrol);
status = hdspm_read(hdspm, HDSPM_RD_TCO + 4);
switch (status & (HDSPM_TCO1_Vid... | [
0,
0
] |
Linux Kernel | sound/pci/rme9652/hdspm.c |
static int snd_hdspm_info_tco_ltc_frames(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo) {
static const char *const texts[] = {"No lock", "24 fps", "25 fps",
"29.97 fps", "30 fps"};
ENUMERATED_CTL_INFO(uinfo, texts);
r... | [
0,
0
] |
Linux Kernel | sound/pci/rme9652/hdspm.c | static int hdspm_tco_ltc_frames(struct hdspm *hdspm) {
u32 status;
int ret = 0;
status = hdspm_read(hdspm, HDSPM_RD_TCO + 4);
if (status & HDSPM_TCO1_LTC_Input_valid) {
switch (status & (HDSPM_TCO1_LTC_Format_LSB | HDSPM_TCO1_LTC_Format_MSB)) {
case 0:
ret = fps_24;
break;
case HDSPM_T... | [
0,
0
] |
Linux Kernel | sound/pci/rme9652/hdspm.c |
static int hdspm_toggle_setting(struct hdspm *hdspm, u32 regmask) {
u32 reg;
if (hdspm_is_raydat_or_aio(hdspm))
reg = hdspm->settings_register;
else
reg = hdspm->control_register;
return (reg & regmask) ? 1 : 0;
} | [
0,
0
] |
Linux Kernel | sound/pci/rme9652/hdspm.c |
static int snd_hdspm_get_toggle_setting(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct hdspm *hdspm = snd_kcontrol_chip(kcontrol);
u32 regmask = kcontrol->private_value;
spin_lock_irq(&hdspm->lock);
ucontrol->value.integer.value[0] = hdspm_... | [
0,
0
] |
Linux Kernel | sound/pci/rme9652/hdspm.c |
static int hdspm_input_select(struct hdspm *hdspm) {
return (hdspm->control_register & HDSPM_InputSelect0) ? 1 : 0;
} | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.