Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | sound/aoa/codecs/onyx.c |
static int onyx_snd_mute_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct onyx *onyx = snd_kcontrol_chip(kcontrol);
u8 c;
mutex_lock(&onyx->mutex);
onyx_read_register(onyx, ONYX_REG_DAC_CONTROL, &c);
mutex_unlock(&onyx->mutex);
ucontrol->value.... | [
0,
0
] |
Linux Kernel | sound/aoa/codecs/onyx.c |
static int onyx_spdif_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct onyx *onyx = snd_kcontrol_chip(kcontrol);
u8 v;
mutex_lock(&onyx->mutex);
onyx_read_register(onyx, ONYX_REG_DIG_INFO1, &v);
v = (v & ~0x3e) | (ucontrol->value.iec958.status[0] & 0... | [
0,
0
] |
Linux Kernel | sound/aoa/codecs/onyx.c |
static int onyx_usable(struct codec_info_item *cii, struct transfer_info *ti,
struct transfer_info *out) {
u8 v;
struct onyx *onyx = cii->codec_data;
int spdif_enabled, analog_enabled;
mutex_lock(&onyx->mutex);
onyx_read_register(onyx, ONYX_REG_DIG_INFO4, &v);
spdif_enabled = !!(v &... | [
1,
0
] |
Linux Kernel | sound/aoa/codecs/onyx.c | static int onyx_prepare(struct codec_info_item *cii, struct bus_info *bi,
struct snd_pcm_substream *substream) {
u8 v;
struct onyx *onyx = cii->codec_data;
int err = -EBUSY;
mutex_lock(&onyx->mutex);
#ifdef SNDRV_PCM_FMTBIT_COMPRESSED_16BE
if (substream->runtime->format == SNDRV_PCM_... | [
1,
1
] |
Linux Kernel | sound/aoa/codecs/tas.c |
static inline int tas_write_reg(struct tas *tas, u8 reg, u8 len, u8 *data) {
if (len == 1)
return i2c_smbus_write_byte_data(tas->i2c, reg, *data);
else
return i2c_smbus_write_i2c_block_data(tas->i2c, reg, len, data);
} | [
0,
0
] |
Linux Kernel | sound/aoa/codecs/tas.c |
static void tas_set_treble(struct tas *tas) {
u8 tmp;
tmp = tas3004_treble(tas->treble);
tas_write_reg(tas, TAS_REG_TREBLE, 1, &tmp);
} | [
0,
0
] |
Linux Kernel | sound/aoa/codecs/tas.c |
static int tas_snd_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 = 0;
uinfo->value.integer.max = 177;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/aoa/codecs/tas.c |
static int tas_snd_vol_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct tas *tas = snd_kcontrol_chip(kcontrol);
if (ucontrol->value.integer.value[0] < 0 ||
ucontrol->value.integer.value[0] > 177)
return -EINVAL;
if (ucontrol->value.integer.val... | [
1,
0
] |
Linux Kernel | sound/aoa/codecs/tas.c |
static int tas_snd_mute_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct tas *tas = snd_kcontrol_chip(kcontrol);
mutex_lock(&tas->mtx);
ucontrol->value.integer.value[0] = !tas->mute_l;
ucontrol->value.integer.value[1] = !tas->mute_r;
mutex_unlock(&... | [
0,
0
] |
Linux Kernel | sound/aoa/codecs/tas.c |
static int tas_snd_mute_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct tas *tas = snd_kcontrol_chip(kcontrol);
mutex_lock(&tas->mtx);
if (tas->mute_l == !ucontrol->value.integer.value[0] &&
tas->mute_r == !ucontrol->value.integer.value[1]) {
... | [
1,
0
] |
Linux Kernel | sound/aoa/codecs/tas.c |
static int tas_snd_mixer_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct tas *tas = snd_kcontrol_chip(kcontrol);
int idx = kcontrol->private_value;
mutex_lock(&tas->mtx);
ucontrol->value.integer.value[0] = tas->mixer_l[idx];
ucontrol->value.integ... | [
0,
0
] |
Linux Kernel | sound/aoa/codecs/tas.c |
static int tas_snd_mixer_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct tas *tas = snd_kcontrol_chip(kcontrol);
int idx = kcontrol->private_value;
mutex_lock(&tas->mtx);
if (tas->mixer_l[idx] == ucontrol->value.integer.value[0] &&
tas->mixer... | [
1,
0
] |
Linux Kernel | sound/aoa/codecs/tas.c |
static int tas_snd_drc_range_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct tas *tas = snd_kcontrol_chip(kcontrol);
mutex_lock(&tas->mtx);
ucontrol->value.integer.value[0] = tas->drc_range;
mutex_unlock(&tas->mtx);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/aoa/codecs/tas.c |
static int tas_snd_drc_range_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct tas *tas = snd_kcontrol_chip(kcontrol);
if (ucontrol->value.integer.value[0] < 0 ||
ucontrol->value.integer.value[0] > TAS3004_DRC_MAX)
return -EINVAL;
mutex_... | [
0,
0
] |
Linux Kernel | sound/aoa/codecs/tas.c |
static int tas_snd_treble_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo) {
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 1;
uinfo->value.integer.min = TAS3004_TREBLE_MIN;
uinfo->value.integer.max = TAS3004_TREBLE_MAX;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/aoa/codecs/tas.c |
static int tas_snd_treble_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct tas *tas = snd_kcontrol_chip(kcontrol);
mutex_lock(&tas->mtx);
ucontrol->value.integer.value[0] = tas->treble;
mutex_unlock(&tas->mtx);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/aoa/codecs/tas.c | static int tas_resume(struct tas *tas) {
mutex_lock(&tas->mtx);
tas_reset_init(tas);
tas_set_volume(tas);
tas_set_mixer(tas);
tas->hw_enabled = 1;
mutex_unlock(&tas->mtx);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/aoa/codecs/tas.c | static void tas_i2c_remove(struct i2c_client *client) {
struct tas *tas = i2c_get_clientdata(client);
u8 tmp = TAS_ACR_ANALOG_PDOWN;
aoa_codec_unregister(&tas->codec);
of_node_put(tas->codec.node);
tas_write_reg(tas, TAS_REG_ACR, 1, &tmp);
mutex_destroy(&tas->mtx);
kfree(tas);
} | [
0,
0
] |
Linux Kernel | sound/aoa/codecs/toonie.c |
static int __init toonie_init(void) {
toonie = kzalloc(sizeof(struct toonie), GFP_KERNEL);
if (!toonie)
return -ENOMEM;
strscpy(toonie->codec.name, "toonie", sizeof(toonie->codec.name));
toonie->codec.owner = THIS_MODULE;
toonie->codec.init = toonie_init_codec;
toonie->codec.exit = toonie_exit_codec;... | [
1,
0
] |
Linux Kernel | sound/aoa/core/alsa.c |
int aoa_snd_device_new(enum snd_device_type type, void *device_data,
const struct snd_device_ops *ops) {
struct snd_card *card = aoa_get_card();
int err;
if (!card)
return -ENOMEM;
err = snd_device_new(card, type, device_data, ops);
if (err) {
printk(KERN_ERR "snd-aoa: failed... | [
0,
0
] |
Linux Kernel | sound/aoa/core/core.c | static int attach_codec_to_fabric(struct aoa_codec *c) {
int err;
if (!try_module_get(c->owner))
return -EBUSY;
err = -ENOENT;
if (fabric->found_codec)
err = fabric->found_codec(c);
if (err) {
module_put(c->owner);
printk(KERN_ERR "snd-aoa: fabric didn't like codec %s\n", c->name);
retur... | [
0,
0
] |
Linux Kernel | sound/aoa/core/core.c |
void aoa_codec_unregister(struct aoa_codec *codec) {
list_del(&codec->list);
if (codec->fabric && codec->exit)
codec->exit(codec);
if (fabric && fabric->remove_codec)
fabric->remove_codec(codec);
codec->fabric = NULL;
module_put(codec->owner);
} | [
1,
0
] |
Linux Kernel | sound/aoa/core/core.c |
static int __init aoa_init(void) { return 0; } | [
0,
0
] |
Linux Kernel | sound/aoa/core/gpio-feature.c | static struct device_node *get_gpio(char *name, char *altname, int *gpioptr,
int *gpioactiveptr) {
struct device_node *np, *gpio;
const u32 *reg;
const char *audio_gpio;
*gpioptr = -1;
np = of_find_node_by_name(NULL, name);
if (!np) {
/* some machines have only gpio... | [
1,
1
] |
Linux Kernel | sound/aoa/core/gpio-feature.c |
static void ftr_handle_notify(struct work_struct *work) {
struct gpio_notification *notif =
container_of(work, struct gpio_notification, work.work);
mutex_lock(¬if->mutex);
if (notif->notify)
notif->notify(notif->data);
mutex_unlock(¬if->mutex);
} | [
0,
0
] |
Linux Kernel | sound/aoa/core/gpio-feature.c | static void ftr_gpio_init(struct gpio_runtime *rt) {
get_gpio("headphone-mute", NULL, &headphone_mute_gpio,
&headphone_mute_gpio_activestate);
get_gpio("amp-mute", NULL, &_mute_gpio, &_mute_gpio_activestate);
get_gpio("lineout-mute", NULL, &lineout_mute_gpio,
&lineout_mute_gpio_actives... | [
0,
0
] |
Linux Kernel | sound/aoa/core/gpio-pmf.c |
static void pmf_gpio_set_hw_reset(struct gpio_runtime *rt, int on) {
struct pmf_args args = {.count = 1, .u[0].v = !!on};
int rc;
if (unlikely(!rt))
return;
rc = pmf_call_function(rt->node, "hw-reset", &args);
if (rc)
printk(KERN_WARNING "pmf_gpio_set_hw_reset"
" failed, rc: ... | [
0,
0
] |
Linux Kernel | sound/aoa/core/gpio-pmf.c |
static void pmf_gpio_all_amps_off(struct gpio_runtime *rt) {
int saved;
if (unlikely(!rt))
return;
saved = rt->implementation_private;
pmf_gpio_set_headphone(rt, 0);
pmf_gpio_set_amp(rt, 0);
pmf_gpio_set_lineout(rt, 0);
rt->implementation_private = saved;
} | [
0,
0
] |
Linux Kernel | sound/aoa/core/gpio-pmf.c | static void pmf_gpio_exit(struct gpio_runtime *rt) {
pmf_gpio_all_amps_off(rt);
rt->implementation_private = 0;
if (rt->headphone_notify.gpio_private)
pmf_unregister_irq_client(rt->headphone_notify.gpio_private);
if (rt->line_in_notify.gpio_private)
pmf_unregister_irq_client(rt->line_in_notify.gpio_pri... | [
0,
0
] |
Linux Kernel | sound/aoa/fabrics/layout.c | static void use_layout(struct layout *l) {
int i;
for (i = 0; i < MAX_CODECS_PER_BUS; i++) {
if (l->codecs[i].name) {
request_module("snd-aoa-codec-%s", l->codecs[i].name);
}
}
} | [
1,
0
] |
Linux Kernel | sound/aoa/fabrics/layout.c |
static int detect_choice_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct layout_dev *ldev = snd_kcontrol_chip(kcontrol);
switch (kcontrol->private_value) {
case 0:
ucontrol->value.integer.value[0] = ldev->switch_on_headphone;
break;
case 1:... | [
0,
0
] |
Linux Kernel | sound/aoa/fabrics/layout.c | static int check_codec(struct aoa_codec *codec, struct layout_dev *ldev,
struct codec_connect_info *cci) {
const u32 *ref;
char propname[32];
struct codec_connection *cc;
if (of_node_name_eq(codec->node, "codec")) {
snprintf(propname, sizeof(propname), "platform-%s-codec-ref", codec-... | [
1,
0
] |
Linux Kernel | sound/aoa/fabrics/layout.c |
static int layout_found_codec(struct aoa_codec *codec) {
struct layout_dev *ldev;
int i;
list_for_each_entry(ldev, &layouts_list, list) {
for (i = 0; i < MAX_CODECS_PER_BUS; i++) {
if (!ldev->layout->codecs[i].name)
continue;
if (strcmp(ldev->layout->codecs[i].name, codec->name) == 0) {
... | [
1,
0
] |
Linux Kernel | sound/aoa/fabrics/layout.c |
static void layout_notify(void *data) {
struct layout_dev_ptr *dptr = data;
struct layout_dev *ldev;
int v, update;
struct snd_kcontrol *detected, *c;
struct snd_card *card = aoa_get_card();
ldev = dptr->ptr;
if (data == &ldev->selfptr_headphone) {
v = ldev->gpio.methods->get_detect(&ldev->gpio, AOA... | [
0,
0
] |
Linux Kernel | sound/aoa/fabrics/layout.c |
static int aoa_fabric_layout_remove(struct soundbus_dev *sdev) {
struct layout_dev *ldev = dev_get_drvdata(&sdev->ofdev.dev);
int i;
for (i = 0; i < MAX_CODECS_PER_BUS; i++) {
if (ldev->codecs[i]) {
aoa_fabric_unlink_codec(ldev->codecs[i]);
}
ldev->codecs[i] = NULL;
}
list_del(&ldev->list)... | [
0,
0
] |
Linux Kernel | sound/aoa/soundbus/core.c |
static void soundbus_device_shutdown(struct device *dev) {
struct soundbus_dev *soundbus_dev = to_soundbus_device(dev);
struct soundbus_driver *drv = to_soundbus_driver(dev->driver);
if (dev->driver && drv->shutdown)
drv->shutdown(soundbus_dev);
} | [
1,
0
] |
Linux Kernel | sound/aoa/soundbus/core.c | int soundbus_register_driver(struct soundbus_driver *drv) {
drv->driver.name = drv->name;
drv->driver.bus = &soundbus_bus_type;
/* register with core */
return driver_register(&drv->driver);
} | [
0,
0
] |
Linux Kernel | sound/aoa/soundbus/core.c |
void soundbus_unregister_driver(struct soundbus_driver *drv) {
driver_unregister(&drv->driver);
} | [
0,
0
] |
Linux Kernel | sound/aoa/soundbus/i2sbus/control.c |
int i2sbus_control_clock(struct i2sbus_control *c, struct i2sbus_dev *i2sdev,
int enable) {
struct pmf_args args = {.count = 0};
struct macio_chip *macio = c->macio;
switch (enable) {
case 0:
if (i2sdev->clock_disable)
return pmf_call_one(i2sdev->clock_disable, &args);
b... | [
1,
0
] |
Linux Kernel | sound/aoa/soundbus/i2sbus/core.c | static irqreturn_t i2sbus_bus_intr(int irq, void *devid) {
struct i2sbus_dev *dev = devid;
u32 intreg;
spin_lock(&dev->low_lock);
intreg = in_le32(&dev->intfregs->intr_ctl);
out_le32(&dev->intfregs->intr_ctl, intreg);
spin_unlock(&dev->low_lock);
return IRQ_HANDLED;
} | [
0,
0
] |
Linux Kernel | sound/aoa/soundbus/i2sbus/core.c | static int i2sbus_resume(struct macio_dev *dev) {
struct i2sbus_control *control = dev_get_drvdata(&dev->ofdev.dev);
struct codec_info_item *cii;
struct i2sbus_dev *i2sdev;
int err, ret = 0;
list_for_each_entry(i2sdev, &control->list, item) {
i2sbus_pcm_prepare_both(i2sdev);
/* Notify codecs so the... | [
0,
0
] |
Linux Kernel | sound/aoa/soundbus/i2sbus/core.c |
static int i2sbus_shutdown(struct macio_dev *dev) { return 0; } | [
0,
0
] |
Linux Kernel | sound/aoa/soundbus/i2sbus/core.c |
static void __exit soundbus_i2sbus_exit(void) {
macio_unregister_driver(&i2sbus_drv);
} | [
0,
0
] |
Linux Kernel | sound/aoa/soundbus/i2sbus/pcm.c | static void i2sbus_wait_for_stop(struct i2sbus_dev *i2sdev,
struct pcm_info *pi) {
unsigned long flags;
DECLARE_COMPLETION_ONSTACK(done);
long timeout;
spin_lock_irqsave(&i2sdev->low_lock, flags);
if (pi->dbdma_ring.stopping) {
pi->stop_completion = &done;
spin_unlock... | [
0,
0
] |
Linux Kernel | sound/aoa/soundbus/i2sbus/pcm.c | void i2sbus_wait_for_stop_both(struct i2sbus_dev *i2sdev) {
struct pcm_info *pi;
get_pcm_info(i2sdev, 0, &pi, NULL);
i2sbus_wait_for_stop(i2sdev, pi);
get_pcm_info(i2sdev, 1, &pi, NULL);
i2sbus_wait_for_stop(i2sdev, pi);
} | [
0,
0
] |
Linux Kernel | sound/aoa/soundbus/i2sbus/pcm.c |
static int i2sbus_playback_hw_free(struct snd_pcm_substream *substream) {
return i2sbus_hw_free(substream, 0);
} | [
0,
0
] |
Linux Kernel | sound/aoa/soundbus/i2sbus/pcm.c |
static int i2sbus_playback_close(struct snd_pcm_substream *substream) {
struct i2sbus_dev *i2sdev = snd_pcm_substream_chip(substream);
int err;
if (!i2sdev)
return -EINVAL;
if (i2sdev->out.substream != substream)
return -EINVAL;
err = i2sbus_pcm_close(i2sdev, 0);
if (!err)
i2sdev->out.substrea... | [
0,
0
] |
Linux Kernel | sound/aoa/soundbus/i2sbus/pcm.c |
static int i2sbus_record_open(struct snd_pcm_substream *substream) {
struct i2sbus_dev *i2sdev = snd_pcm_substream_chip(substream);
if (!i2sdev)
return -EINVAL;
i2sdev->in.substream = substream;
return i2sbus_pcm_open(i2sdev, 1);
} | [
0,
0
] |
Linux Kernel | sound/aoa/soundbus/i2sbus/pcm.c |
static void i2sbus_private_free(struct snd_pcm *pcm) {
struct i2sbus_dev *i2sdev = snd_pcm_chip(pcm);
struct codec_info_item *p, *tmp;
i2sdev->sound.pcm = NULL;
i2sdev->out.created = 0;
i2sdev->in.created = 0;
list_for_each_entry_safe(p, tmp, &i2sdev->sound.codec_list, list) {
printk(KERN_ERR "i2sbus:... | [
0,
0
] |
Linux Kernel | sound/arm/aaci.c |
static inline void aaci_chan_wait_ready(struct aaci_runtime *aacirun,
unsigned long mask) {
u32 val;
int timeout = 5000;
do {
udelay(1);
val = readl(aacirun->base + AACI_SR);
} while (val & mask && timeout--);
} | [
1,
0
] |
Linux Kernel | sound/arm/aaci.c |
static irqreturn_t aaci_irq(int irq, void *devid) {
struct aaci *aaci = devid;
u32 mask;
int i;
mask = readl(aaci->base + AACI_ALLINTS);
if (mask) {
u32 m = mask;
for (i = 0; i < 4; i++, m >>= 7) {
if (m & 0x7f) {
aaci_fifo_irq(aaci, i, m);
}
}
}
return mask ? IRQ_HANDLE... | [
1,
0
] |
Linux Kernel | sound/arm/aaci.c | static int aaci_rule_channels(struct snd_pcm_hw_params *p,
struct snd_pcm_hw_rule *rule) {
static const unsigned int channel_list[] = {2, 4, 6};
struct aaci *aaci = rule->private;
unsigned int mask = 1 << 0, slots;
slots = aaci->ac97_bus->pcms[0].r[0].slots;
if (slots & (1 << AC... | [
1,
0
] |
Linux Kernel | sound/arm/aaci.c |
static snd_pcm_uframes_t aaci_pcm_pointer(struct snd_pcm_substream *substream) {
struct snd_pcm_runtime *runtime = substream->runtime;
struct aaci_runtime *aacirun = runtime->private_data;
ssize_t bytes = aacirun->ptr - aacirun->start;
return bytes_to_frames(runtime, bytes);
} | [
0,
0
] |
Linux Kernel | sound/arm/aaci.c |
static void aaci_pcm_playback_start(struct aaci_runtime *aacirun) {
u32 ie;
aaci_chan_wait_ready(aacirun, SR_TXB);
aacirun->cr |= CR_EN;
ie = readl(aacirun->base + AACI_IE);
ie |= IE_URIE | IE_TXIE;
writel(ie, aacirun->base + AACI_IE);
writel(aacirun->cr, aacirun->base + AACI_TXCR);
} | [
1,
0
] |
Linux Kernel | sound/arm/aaci.c |
static int aaci_pcm_playback_trigger(struct snd_pcm_substream *substream,
int cmd) {
struct aaci_runtime *aacirun = substream->runtime->private_data;
unsigned long flags;
int ret = 0;
spin_lock_irqsave(&aacirun->lock, flags);
switch (cmd) {
case SNDRV_PCM_TRIGGER_STAR... | [
1,
0
] |
Linux Kernel | sound/arm/aaci.c | static int aaci_do_suspend(struct snd_card *card) {
struct aaci *aaci = card->private_data;
snd_power_change_state(card, SNDRV_CTL_POWER_D3cold);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/arm/aaci.c | static int aaci_probe_ac97(struct aaci *aaci) {
struct snd_ac97_template ac97_template;
struct snd_ac97_bus *ac97_bus;
struct snd_ac97 *ac97;
int ret;
writel(0, aaci->base + AACI_RESET);
udelay(2);
writel(RESET_NRST, aaci->base + AACI_RESET);
/*
* Give the AC'97 codec more than enough time
* to ... | [
1,
0
] |
Linux Kernel | sound/arm/aaci.c |
static void aaci_free_card(struct snd_card *card) {
struct aaci *aaci = card->private_data;
iounmap(aaci->base);
} | [
0,
0
] |
Linux Kernel | sound/arm/aaci.c | static unsigned int aaci_size_fifo(struct aaci *aaci) {
struct aaci_runtime *aacirun = &aaci->playback;
int i;
writel(CR_FEN | CR_SZ16 | CR_EN, aacirun->base + AACI_TXCR);
for (i = 0; !(readl(aacirun->base + AACI_SR) & SR_TXFF) && i < 4096; i++)
writel(0, aacirun->fifo);
writel(0, aacirun->base + AACI_... | [
1,
0
] |
Linux Kernel | sound/arm/aaci.c |
static void aaci_remove(struct amba_device *dev) {
struct snd_card *card = amba_get_drvdata(dev);
if (card) {
struct aaci *aaci = card->private_data;
writel(0, aaci->base + AACI_MAINCR);
snd_card_free(card);
amba_release_regions(dev);
}
} | [
0,
0
] |
Linux Kernel | sound/arm/pxa2xx-ac97-lib.c | static inline void pxa_ac97_warm_pxa25x(void) {
gsr_bits = 0;
writel(readl(ac97_reg_base + GCR) | (GCR_WARM_RST), ac97_reg_base + GCR);
} | [
0,
0
] |
Linux Kernel | sound/arm/pxa2xx-ac97-lib.c | static inline void pxa_ac97_cold_pxa3xx(void) {
writel(0, ac97_reg_base + GCR);
writel(GCR_CLKBPB, ac97_reg_base + GCR);
udelay(100);
writel(0, ac97_reg_base + GCR);
writel(readl(ac97_reg_base + GCR) & (GCR_COLD_RST),
ac97_reg_base + GCR); /* clear everything but nCRST */
writel(readl(ac97_reg_ba... | [
0,
0
] |
Linux Kernel | sound/arm/pxa2xx-ac97.c |
static unsigned short pxa2xx_ac97_legacy_read(struct snd_ac97 *ac97,
unsigned short reg) {
int ret;
ret = pxa2xx_ac97_read(ac97->num, reg);
if (ret < 0)
return 0;
else
return (unsigned short)(ret & 0xffff);
} | [
0,
0
] |
Linux Kernel | sound/arm/pxa2xx-ac97.c |
static int pxa2xx_ac97_pcm_prepare(struct snd_pcm_substream *substream) {
struct snd_pcm_runtime *runtime = substream->runtime;
int reg = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
? AC97_PCM_FRONT_DAC_RATE
: AC97_PCM_LR_ADC_RATE;
int ret;
ret = pxa2xx_pcm_prepare(substre... | [
0,
0
] |
Linux Kernel | sound/arm/pxa2xx-ac97.c |
static int pxa2xx_ac97_do_resume(struct snd_card *card) {
pxa2xx_audio_ops_t *platform_ops = card->dev->platform_data;
int rc;
rc = pxa2xx_ac97_hw_resume();
if (rc)
return rc;
if (platform_ops && platform_ops->resume)
platform_ops->resume(platform_ops->priv);
snd_ac97_resume(pxa2xx_ac97_ac97);
... | [
1,
0
] |
Linux Kernel | sound/arm/pxa2xx-ac97.c |
static int pxa2xx_ac97_resume(struct device *dev) {
struct snd_card *card = dev_get_drvdata(dev);
int ret = 0;
if (card)
ret = pxa2xx_ac97_do_resume(card);
return ret;
} | [
0,
0
] |
Linux Kernel | sound/arm/pxa2xx-ac97.c |
static int pxa2xx_ac97_probe(struct platform_device *dev) {
struct snd_card *card;
struct snd_ac97_bus *ac97_bus;
struct snd_ac97_template ac97_template;
int ret;
pxa2xx_audio_ops_t *pdata = dev->dev.platform_data;
if (dev->id >= 0) {
dev_err(&dev->dev, "PXA2xx has only one AC97 port.\n");
ret = -... | [
1,
0
] |
Linux Kernel | sound/arm/pxa2xx-ac97.c |
static int pxa2xx_ac97_remove(struct platform_device *dev) {
struct snd_card *card = platform_get_drvdata(dev);
if (card) {
snd_card_free(card);
pxa2xx_ac97_hw_remove(dev);
}
return 0;
} | [
0,
0
] |
Linux Kernel | sound/arm/pxa2xx-pcm-lib.c |
int pxa2xx_pcm_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params) {
struct dma_chan *chan = snd_dmaengine_pcm_get_chan(substream);
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct snd_dmaengine_dai_dma_data *dma_params;
struct dma_slave_co... | [
0,
0
] |
Linux Kernel | sound/arm/pxa2xx-pcm-lib.c |
int pxa2xx_pcm_trigger(struct snd_pcm_substream *substream, int cmd) {
return snd_dmaengine_pcm_trigger(substream, cmd);
} | [
0,
0
] |
Linux Kernel | sound/arm/pxa2xx-pcm-lib.c |
snd_pcm_uframes_t pxa2xx_pcm_pointer(struct snd_pcm_substream *substream) {
return snd_dmaengine_pcm_pointer(substream);
} | [
0,
0
] |
Linux Kernel | sound/arm/pxa2xx-pcm-lib.c | int pxa2xx_pcm_open(struct snd_pcm_substream *substream) {
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_dmaengine_dai_dma_data *dma_params;
int ret;
runtime->hw = pxa2xx_pcm_hardware;
dma_params = snd_soc_dai_get_dma_data(asoc_... | [
0,
0
] |
Linux Kernel | sound/arm/pxa2xx-pcm-lib.c |
int pxa2xx_soc_pcm_new(struct snd_soc_component *component,
struct snd_soc_pcm_runtime *rtd) {
struct snd_card *card = rtd->card->snd_card;
struct snd_pcm *pcm = rtd->pcm;
int ret;
ret = dma_coerce_mask_and_coherent(card->dev, DMA_BIT_MASK(32));
if (ret)
return ret;
return pxa2... | [
1,
0
] |
Linux Kernel | sound/arm/pxa2xx-pcm-lib.c |
int pxa2xx_soc_pcm_open(struct snd_soc_component *component,
struct snd_pcm_substream *substream) {
return pxa2xx_pcm_open(substream);
} | [
0,
0
] |
Linux Kernel | sound/arm/pxa2xx-pcm-lib.c |
int pxa2xx_soc_pcm_prepare(struct snd_soc_component *component,
struct snd_pcm_substream *substream) {
return pxa2xx_pcm_prepare(substream);
} | [
0,
0
] |
Linux Kernel | sound/atmel/ac97c.c |
static int atmel_ac97c_playback_open(struct snd_pcm_substream *substream) {
struct atmel_ac97c *chip = snd_pcm_substream_chip(substream);
struct snd_pcm_runtime *runtime = substream->runtime;
mutex_lock(&opened_mutex);
chip->opened++;
runtime->hw = atmel_ac97c_hw;
if (chip->cur_rate) {
runtime->hw.rat... | [
0,
0
] |
Linux Kernel | sound/atmel/ac97c.c |
static int atmel_ac97c_playback_close(struct snd_pcm_substream *substream) {
struct atmel_ac97c *chip = snd_pcm_substream_chip(substream);
mutex_lock(&opened_mutex);
chip->opened--;
if (!chip->opened) {
chip->cur_rate = 0;
chip->cur_format = 0;
}
mutex_unlock(&opened_mutex);
chip->playback_subs... | [
0,
0
] |
Linux Kernel | sound/atmel/ac97c.c |
static int atmel_ac97c_playback_trigger(struct snd_pcm_substream *substream,
int cmd) {
struct atmel_ac97c *chip = snd_pcm_substream_chip(substream);
unsigned long camr, ptcr = 0;
camr = ac97c_readl(chip, CAMR);
switch (cmd) {
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
... | [
1,
0
] |
Linux Kernel | sound/atmel/ac97c.c |
static void atmel_ac97c_write(struct snd_ac97 *ac97, unsigned short reg,
unsigned short val) {
struct atmel_ac97c *chip = get_chip(ac97);
unsigned long word;
int timeout = 40;
word = (reg & 0x7f) << 16 | val;
do {
if (ac97c_readl(chip, COSR) & AC97C_CSR_TXRDY) {
ac97... | [
1,
0
] |
Linux Kernel | sound/atmel/ac97c.c | static int atmel_ac97c_suspend(struct device *pdev) {
struct snd_card *card = dev_get_drvdata(pdev);
struct atmel_ac97c *chip = card->private_data;
clk_disable_unprepare(chip->pclk);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/core/compress_offload.c |
static int snd_compr_free(struct inode *inode, struct file *f) {
struct snd_compr_file *data = f->private_data;
struct snd_compr_runtime *runtime = data->stream.runtime;
cancel_delayed_work_sync(&data->stream.error_work);
switch (runtime->state) {
case SNDRV_PCM_STATE_RUNNING:
case SNDRV_PCM_STATE_DRAINI... | [
1,
0
] |
Linux Kernel | sound/core/compress_offload.c |
static int snd_compr_update_tstamp(struct snd_compr_stream *stream,
struct snd_compr_tstamp *tstamp) {
if (!stream->ops->pointer)
return -ENOTSUPP;
stream->ops->pointer(stream, tstamp);
pr_debug("dsp consumed till %d total %d bytes\n", tstamp->byte_offset,
tstamp... | [
1,
0
] |
Linux Kernel | sound/core/compress_offload.c | static size_t snd_compr_calc_avail(struct snd_compr_stream *stream,
struct snd_compr_avail *avail) {
memset(avail, 0, sizeof(*avail));
snd_compr_update_tstamp(stream, &avail->tstamp);
if (stream->runtime->total_bytes_available == 0 &&
stream->runtime->state == SNDRV_PCM_S... | [
1,
0
] |
Linux Kernel | sound/core/compress_offload.c |
static inline size_t snd_compr_get_avail(struct snd_compr_stream *stream) {
struct snd_compr_avail avail;
return snd_compr_calc_avail(stream, &avail);
} | [
0,
0
] |
Linux Kernel | sound/core/compress_offload.c | static int snd_compr_write_data(struct snd_compr_stream *stream,
const char __user *buf, size_t count) {
void *dstn;
size_t copy;
struct snd_compr_runtime *runtime = stream->runtime;
u64 app_pointer =
div64_u64(runtime->total_bytes_available, runtime->buffer_size);
app_p... | [
0,
0
] |
Linux Kernel | sound/core/compress_offload.c |
int snd_compr_malloc_pages(struct snd_compr_stream *stream, size_t size) {
struct snd_dma_buffer *dmab;
int ret;
if (snd_BUG_ON(!(stream) || !(stream)->runtime))
return -EINVAL;
dmab = kzalloc(sizeof(*dmab), GFP_KERNEL);
if (!dmab)
return -ENOMEM;
dmab->dev = stream->dma_buffer.dev;
ret = snd_dm... | [
0,
0
] |
Linux Kernel | sound/core/compress_offload.c | static int snd_compress_check_input(struct snd_compr_params *params) {
if (params->buffer.fragment_size == 0 ||
params->buffer.fragments > U32_MAX / params->buffer.fragment_size ||
params->buffer.fragments == 0)
return -EINVAL;
/* now codec parameters */
if (params->codec.id == 0 || params->code... | [
1,
0
] |
Linux Kernel | sound/core/compress_offload.c |
static int snd_compr_get_params(struct snd_compr_stream *stream,
unsigned long arg) {
struct snd_codec *params;
int retval;
if (!stream->ops->get_params)
return -EBADFD;
params = kzalloc(sizeof(*params), GFP_KERNEL);
if (!params)
return -ENOMEM;
retval = stream->op... | [
1,
0
] |
Linux Kernel | sound/core/compress_offload.c | static int snd_compr_set_metadata(struct snd_compr_stream *stream,
unsigned long arg) {
struct snd_compr_metadata metadata;
int retval;
if (!stream->ops->set_metadata)
return -ENXIO;
if (copy_from_user(&metadata, (void __user *)arg, sizeof(metadata)))
return -EFAULT;
... | [
1,
0
] |
Linux Kernel | sound/core/compress_offload.c |
static int snd_compr_pause(struct snd_compr_stream *stream) {
int retval;
switch (stream->runtime->state) {
case SNDRV_PCM_STATE_RUNNING:
retval = stream->ops->trigger(stream, SNDRV_PCM_TRIGGER_PAUSE_PUSH);
if (!retval)
stream->runtime->state = SNDRV_PCM_STATE_PAUSED;
break;
case SNDRV_PCM_S... | [
1,
0
] |
Linux Kernel | sound/core/compress_offload.c |
static int snd_compr_drain(struct snd_compr_stream *stream) {
int retval;
switch (stream->runtime->state) {
case SNDRV_PCM_STATE_OPEN:
case SNDRV_PCM_STATE_SETUP:
case SNDRV_PCM_STATE_PREPARED:
case SNDRV_PCM_STATE_PAUSED:
return -EPERM;
case SNDRV_PCM_STATE_XRUN:
return -EPIPE;
default:
b... | [
0,
0
] |
Linux Kernel | sound/core/compress_offload.c |
static int snd_compress_proc_init(struct snd_compr *compr) {
struct snd_info_entry *entry;
char name[16];
sprintf(name, "compr%i", compr->device);
entry = snd_info_create_card_entry(compr->card, name, compr->card->proc_root);
if (!entry)
return -ENOMEM;
entry->mode = S_IFDIR | 0555;
compr->proc_root... | [
1,
0
] |
Linux Kernel | sound/core/compress_offload.c |
static inline void snd_compress_proc_done(struct snd_compr *compr) {} | [
0,
0
] |
Linux Kernel | sound/core/control.c |
static void snd_ctl_empty_read_queue(struct snd_ctl_file *ctl) {
unsigned long flags;
struct snd_kctl_event *cread;
spin_lock_irqsave(&ctl->read_lock, flags);
while (!list_empty(&ctl->events)) {
cread = snd_kctl_event(ctl->events.next);
list_del(&cread->list);
kfree(cread);
}
spin_unlock_irqre... | [
0,
0
] |
Linux Kernel | sound/core/control.c | static bool elem_id_matches(const struct snd_kcontrol *kctl,
const struct snd_ctl_elem_id *id) {
return kctl->id.iface == id->iface && kctl->id.device == id->device &&
kctl->id.subdevice == id->subdevice &&
!strncmp(kctl->id.name, id->name, sizeof(kctl->id.name)) &&
... | [
1,
0
] |
Linux Kernel | sound/core/control.c | static unsigned long get_ctl_id_hash(const struct snd_ctl_elem_id *id) {
int i;
unsigned long h;
h = id->iface;
h = MULTIPLIER * h + id->device;
h = MULTIPLIER * h + id->subdevice;
for (i = 0; i < SNDRV_CTL_ELEM_ID_NAME_MAXLEN && id->name[i]; i++)
h = MULTIPLIER * h + id->name[i];
h = MULTIPLIER * h ... | [
1,
0
] |
Linux Kernel | sound/core/control.c | static void add_hash_entries(struct snd_card *card,
struct snd_kcontrol *kcontrol) {
struct snd_ctl_elem_id id = kcontrol->id;
int i;
xa_store_range(&card->ctl_numids, kcontrol->id.numid,
kcontrol->id.numid + kcontrol->count - 1, kcontrol,
GFP_KERNEL... | [
0,
0
] |
Linux Kernel | sound/core/control.c | static void remove_hash_entries(struct snd_card *card,
struct snd_kcontrol *kcontrol) {
struct snd_ctl_elem_id id = kcontrol->id;
struct snd_kcontrol *matched;
unsigned long h;
int i;
for (i = 0; i < kcontrol->count; i++) {
xa_erase(&card->ctl_numids, id.numid);
h = ge... | [
0,
0
] |
Linux Kernel | sound/core/control.c |
static int snd_ctl_add_replace(struct snd_card *card,
struct snd_kcontrol *kcontrol,
enum snd_ctl_add_mode mode) {
int err = -EINVAL;
if (!kcontrol)
return err;
if (snd_BUG_ON(!card || !kcontrol->info))
goto error;
down_write(&card->contro... | [
0,
0
] |
Linux Kernel | sound/core/control.c | int snd_ctl_replace(struct snd_card *card, struct snd_kcontrol *kcontrol,
bool add_on_replace) {
return snd_ctl_add_replace(card, kcontrol,
add_on_replace ? CTL_ADD_ON_REPLACE : CTL_REPLACE);
} | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.