Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
⌀
Function
large_stringlengths
11
3.45k
Label
list
Linux Kernel
sound/soc/sof/sof-client.c
enum sof_ipc_type sof_client_get_ipc_type(struct sof_client_dev *cdev) { struct snd_sof_dev *sdev = sof_client_dev_to_sof_dev(cdev); return sdev->pdata->ipc_type; }
[ 0, 0 ]
Linux Kernel
sound/soc/sof/sof-client.c
int sof_client_register_ipc_rx_handler(struct sof_client_dev *cdev, u32 ipc_msg_type, sof_client_event_callback callback) { struct snd_sof_dev *sdev = sof_client_dev_to_sof_dev(cdev); struct sof_ipc_event_entry *event; if (!callback) ...
[ 1, 0 ]
Linux Kernel
sound/soc/sof/sof-client.c
void sof_client_unregister_ipc_rx_handler(struct sof_client_dev *cdev, u32 ipc_msg_type) { struct snd_sof_dev *sdev = sof_client_dev_to_sof_dev(cdev); struct sof_ipc_event_entry *event; mutex_lock(&sdev->client_event_handler_mutex); list_for_each_entry(event, &sdev->...
[ 1, 0 ]
Linux Kernel
sound/soc/sof/sof-client.c
int sof_client_register_fw_state_handler( struct sof_client_dev *cdev, sof_client_fw_state_callback callback) { struct snd_sof_dev *sdev = sof_client_dev_to_sof_dev(cdev); struct sof_state_event_entry *event; if (!callback) return -EINVAL; event = kmalloc(sizeof(*event), GFP_KERNEL); if (!event) ...
[ 0, 0 ]
Linux Kernel
sound/soc/sof/sof-of-dev.c
static void sof_of_probe_complete(struct device *dev) { pm_runtime_set_autosuspend_delay(dev, SND_SOF_SUSPEND_DELAY_MS); pm_runtime_use_autosuspend(dev); pm_runtime_mark_last_busy(dev); pm_runtime_set_active(dev); pm_runtime_enable(dev); }
[ 0, 0 ]
Linux Kernel
sound/soc/sof/sof-of-dev.c
int sof_of_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; const struct sof_dev_desc *desc; struct snd_sof_pdata *sof_pdata; dev_info(&pdev->dev, "DT DSP detected"); sof_pdata = devm_kzalloc(dev, sizeof(*sof_pdata), GFP_KERNEL); if (!sof_pdata) return -ENOMEM; desc = device_g...
[ 1, 0 ]
Linux Kernel
sound/soc/sof/sof-pci-dev.c
void sof_pci_remove(struct pci_dev *pci) { snd_sof_device_remove(&pci->dev); /* follow recommendation in pci-driver.c to increment usage counter */ if (snd_sof_device_probe_completed(&pci->dev) && !(sof_pci_debug & SOF_PCI_DISABLE_PM_RUNTIME)) pm_runtime_get_noresume(&pci->dev); /* release pci regi...
[ 0, 0 ]
Linux Kernel
sound/soc/sof/sof-pci-dev.c
void sof_pci_shutdown(struct pci_dev *pci) { snd_sof_device_shutdown(&pci->dev); }
[ 0, 0 ]
Linux Kernel
sound/soc/sof/sof-priv.h
static inline void snd_sof_ipc_msgs_rx(struct snd_sof_dev *sdev) { sdev->ipc->ops->rx_msg(sdev); }
[ 0, 0 ]
Linux Kernel
sound/soc/sof/sof-priv.h
static inline void snd_sof_ipc_process_reply(struct snd_sof_dev *sdev, u32 msg_id) { snd_sof_ipc_get_reply(sdev); snd_sof_ipc_reply(sdev, msg_id); }
[ 0, 0 ]
Linux Kernel
sound/soc/sof/sof-priv.h
static inline void sof_stack(struct snd_sof_dev *sdev, const char *level, void *oops, u32 *stack, u32 stack_words) { sof_dsp_arch_ops(sdev)->dsp_stack(sdev, level, oops, stack, stack_words); }
[ 0, 0 ]
Linux Kernel
sound/soc/sof/sof-priv.h
static inline int sof_register_clients(struct snd_sof_dev *sdev) { return 0; }
[ 0, 0 ]
Linux Kernel
sound/soc/sof/sof-priv.h
static inline void sof_unregister_clients(struct snd_sof_dev *sdev) {}
[ 0, 0 ]
Linux Kernel
sound/soc/sof/sof-priv.h
static inline void sof_client_ipc_rx_dispatcher(struct snd_sof_dev *sdev, void *msg_buf) {}
[ 0, 0 ]
Linux Kernel
sound/soc/sof/stream-ipc.c
int sof_set_stream_data_offset(struct snd_sof_dev *sdev, struct snd_pcm_substream *substream, size_t posn_offset) { struct sof_stream *stream = substream->runtime->private_data; if (posn_offset > sdev->stream_box.size || posn_offset % sizeof(struc...
[ 1, 0 ]
Linux Kernel
sound/soc/sof/stream-ipc.c
int sof_stream_pcm_open(struct snd_sof_dev *sdev, struct snd_pcm_substream *substream) { struct sof_stream *stream = kmalloc(sizeof(*stream), GFP_KERNEL); if (!stream) return -ENOMEM; substream->runtime->private_data = stream; /* align to DMA minimum transfer size */ snd_pcm_hw_...
[ 0, 0 ]
Linux Kernel
sound/soc/sof/topology.c
int get_token_u16(void *elem, void *object, u32 offset) { struct snd_soc_tplg_vendor_value_elem *velem = elem; u16 *val = (u16 *)((u8 *)object + offset); *val = (u16)le32_to_cpu(velem->value); return 0; }
[ 0, 0 ]
Linux Kernel
sound/soc/sof/topology.c
static int sof_parse_uuid_tokens(struct snd_soc_component *scomp, void *object, size_t offset, const struct sof_topology_token *tokens, int num_tokens, struct snd_soc_tplg_vendor_array *ar...
[ 0, 0 ]
Linux Kernel
sound/soc/sof/topology.c
static int sof_parse_tokens(struct snd_soc_component *scomp, void *object, const struct sof_topology_token *tokens, int num_tokens, struct snd_soc_tplg_vendor_array *array, int array_size) { return sof_parse_token_sets(scomp, object, tokens, num_tokens, array, ...
[ 0, 0 ]
Linux Kernel
sound/soc/sof/topology.c
static int sof_control_unload(struct snd_soc_component *scomp, struct snd_soc_dobj *dobj) { struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp); const struct sof_ipc_tplg_ops *ipc_tplg_ops = sdev->ipc->ops->tplg; struct snd_sof_control *scontrol = dobj->private; int ret...
[ 1, 0 ]
Linux Kernel
sound/soc/sof/topology.c
static int sof_parse_pin_binding(struct snd_sof_widget *swidget, struct snd_soc_tplg_private *priv, bool pin_type) { const struct sof_topology_token *pin_binding_token; char *pin_binding[SOF_WIDGET_MAX_NUM_PINS]; int token_count; u32 num_pins; ...
[ 1, 0 ]
Linux Kernel
sound/soc/sof/topology.c
static int sof_route_unload(struct snd_soc_component *scomp, struct snd_soc_dobj *dobj) { struct snd_sof_route *sroute; sroute = dobj->private; if (!sroute) return 0; kfree(sroute->private); list_del(&sroute->list); kfree(sroute); return 0; }
[ 0, 0 ]
Linux Kernel
sound/soc/sof/topology.c
static int sof_dai_unload(struct snd_soc_component *scomp, struct snd_soc_dobj *dobj) { struct snd_sof_pcm *spcm = dobj->private; if (spcm->pcm.playback) snd_dma_free_pages(&spcm->stream[SNDRV_PCM_STREAM_PLAYBACK].page_table); if (spcm->pcm.capture) snd_dma_free_pages(&spcm->st...
[ 0, 0 ]
Linux Kernel
sound/soc/sof/topology.c
static int sof_link_unload(struct snd_soc_component *scomp, struct snd_soc_dobj *dobj) { struct snd_sof_dai_link *slink = dobj->private; if (!slink) return 0; kfree(slink->tuples); list_del(&slink->list); kfree(slink->hw_configs); kfree(slink); dobj->private = NULL; re...
[ 0, 0 ]
Linux Kernel
sound/soc/sof/topology.c
static int sof_set_pipe_widget(struct snd_sof_dev *sdev, struct snd_sof_widget *pipe_widget, struct snd_sof_widget *swidget) { struct snd_sof_control *scontrol; if (pipe_widget->dynamic_pipeline_widget) { list_for_each_entry( scontrol, &sde...
[ 0, 0 ]
Linux Kernel
sound/soc/sof/trace.c
int sof_fw_trace_resume(struct snd_sof_dev *sdev) { if (!sdev->fw_trace_is_supported) return 0; return sdev->ipc->ops->fw_tracing->resume(sdev); }
[ 1, 0 ]
Linux Kernel
sound/soc/sof/xtensa/core.c
static void xtensa_stack(struct snd_sof_dev *sdev, const char *level, void *oops, u32 *stack, u32 stack_words) { struct sof_ipc_dsp_oops_xtensa *xoops = oops; u32 stack_ptr = xoops->plat_hdr.stackptr; unsigned char buf[4 * 8 + 3 + 1]; int i; dev_printk(level, sdev->dev, "stack dump ...
[ 1, 0 ]
Linux Kernel
sound/soc/spear/spdif_in.c
static void spdif_in_format(struct spdif_in_dev *host, u32 format) { u32 ctrl = readl(host->io_base + SPDIF_IN_CTRL); switch (format) { case SNDRV_PCM_FORMAT_S16_LE: ctrl |= SPDIF_XTRACT_16BIT; break; case SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE: ctrl &= ~SPDIF_XTRACT_16BIT; break; } writel(...
[ 1, 0 ]
Linux Kernel
sound/soc/spear/spdif_in.c
static irqreturn_t spdif_in_irq(int irq, void *arg) { struct spdif_in_dev *host = (struct spdif_in_dev *)arg; u32 irq_status = readl(host->io_base + SPDIF_IN_IRQ); if (!irq_status) return IRQ_NONE; if (irq_status & SPDIF_IRQ_FIFOWRITE) dev_err(host->dev, "spdif in: fifo write error"); if (irq_stat...
[ 0, 0 ]
Linux Kernel
sound/soc/spear/spdif_out.c
static int spdif_out_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) { struct spdif_out_dev *host = snd_soc_dai_get_drvdata(dai); u32 rate, core_freq; if (substream->stream != SNDRV_PCM_STREAM_...
[ 0, 0 ]
Linux Kernel
sound/soc/spear/spdif_out.c
static int spdif_out_trigger(struct snd_pcm_substream *substream, int cmd, struct snd_soc_dai *dai) { struct spdif_out_dev *host = snd_soc_dai_get_drvdata(dai); u32 ctrl; int ret = 0; if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK) return -EINVAL; switch (cmd) { case ...
[ 0, 0 ]
Linux Kernel
sound/soc/spear/spdif_out.c
static int spdif_soc_dai_probe(struct snd_soc_dai *dai) { struct spdif_out_dev *host = snd_soc_dai_get_drvdata(dai); host->dma_params_tx.filter_data = &host->dma_params; dai->playback_dma_data = &host->dma_params_tx; return snd_soc_add_dai_controls(dai, spdif_out_controls, A...
[ 0, 0 ]
Linux Kernel
sound/soc/spear/spdif_out.c
static int spdif_out_probe(struct platform_device *pdev) { struct spdif_out_dev *host; struct spear_spdif_platform_data *pdata; struct resource *res; int ret; host = devm_kzalloc(&pdev->dev, sizeof(*host), GFP_KERNEL); if (!host) return -ENOMEM; host->io_base = devm_platform_get_and_ioremap_resourc...
[ 1, 0 ]
Linux Kernel
sound/soc/spear/spear_pcm.c
int devm_spear_pcm_platform_register(struct device *dev, struct snd_dmaengine_pcm_config *config, bool (*filter)(struct dma_chan *chan, void *slave)) { *config = spear_dmaengine_pcm_config; ...
[ 0, 0 ]
Linux Kernel
sound/soc/sprd/sprd-mcdt.c
static void sprd_mcdt_adc_dma_enable(struct sprd_mcdt_dev *mcdt, u8 channel, bool enable) { if (enable) sprd_mcdt_update(mcdt, MCDT_DMA_EN, BIT(channel), BIT(channel)); else sprd_mcdt_update(mcdt, MCDT_DMA_EN, 0, BIT(channel)); }
[ 0, 0 ]
Linux Kernel
sound/soc/sprd/sprd-mcdt.c
static void sprd_mcdt_dac_write_fifo(struct sprd_mcdt_dev *mcdt, u8 channel, u32 val) { u32 reg = MCDT_CH0_TXD + channel * 4; writel_relaxed(val, mcdt->base + reg); }
[ 0, 0 ]
Linux Kernel
sound/soc/sprd/sprd-mcdt.c
static u32 sprd_mcdt_dma_ack_shift(u8 channel) { switch (channel) { default: case 0: case 8: return 0; case 1: case 9: return 4; case 2: return 8; case 3: return 12; case 4: return 16; case 5: return 20; case 6: return 24; case 7: return 28; } }
[ 0, 0 ]
Linux Kernel
sound/soc/sprd/sprd-mcdt.c
static void sprd_mcdt_adc_dma_ack_select(struct sprd_mcdt_dev *mcdt, u8 channel, enum sprd_mcdt_dma_chan dma_chan) { u32 reg, shift = sprd_mcdt_dma_ack_shift(channel), ack = dma_chan; switch (channel) { case 0 ... 7: reg = MCDT_DMA_CFG4; break; case 8 ... 9: ...
[ 0, 0 ]
Linux Kernel
sound/soc/sprd/sprd-mcdt.c
static u32 sprd_mcdt_dac_fifo_avail(struct sprd_mcdt_dev *mcdt, u8 channel) { u32 reg = MCDT_DAC0_FIFO_ADDR_ST + channel * 8; u32 r_addr = (readl_relaxed(mcdt->base + reg) >> MCDT_CH_FIFO_ADDR_SHIFT) & MCDT_CH_FIFO_ADDR_MASK; u32 w_addr = readl_relaxed(mcdt->base + reg) & MCDT_CH_FIFO_ADDR_MASK; ...
[ 0, 0 ]
Linux Kernel
sound/soc/sprd/sprd-mcdt.c
int sprd_mcdt_chan_dma_enable(struct sprd_mcdt_chan *chan, enum sprd_mcdt_dma_chan dma_chan, u32 water_mark) { struct sprd_mcdt_dev *mcdt = chan->mcdt; unsigned long flags; int ret = 0; spin_lock_irqsave(&mcdt->lock, flags); if (chan->dma_enable ||...
[ 1, 0 ]
Linux Kernel
sound/soc/sprd/sprd-mcdt.c
static void sprd_mcdt_init_chans(struct sprd_mcdt_dev *mcdt, struct resource *res) { int i; for (i = 0; i < MCDT_CHANNEL_NUM; i++) { struct sprd_mcdt_chan *chan = &mcdt->chan[i]; if (i < MCDT_ADC_CHANNEL_NUM) { chan->id = i; chan->type = SPRD_MCDT_ADC_CHAN; ...
[ 1, 0 ]
Linux Kernel
sound/soc/sprd/sprd-mcdt.c
static int sprd_mcdt_probe(struct platform_device *pdev) { struct sprd_mcdt_dev *mcdt; struct resource *res; int ret, irq; mcdt = devm_kzalloc(&pdev->dev, sizeof(*mcdt), GFP_KERNEL); if (!mcdt) return -ENOMEM; mcdt->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res); if (IS_ERR(mcdt->base...
[ 1, 0 ]
Linux Kernel
sound/soc/sprd/sprd-mcdt.h
struct sprd_mcdt_chan * sprd_mcdt_request_chan(u8 channel, enum sprd_mcdt_channel_type type) { return NULL; }
[ 0, 0 ]
Linux Kernel
sound/soc/sprd/sprd-mcdt.h
void sprd_mcdt_free_chan(struct sprd_mcdt_chan *chan) {}
[ 0, 0 ]
Linux Kernel
sound/soc/sprd/sprd-mcdt.h
int sprd_mcdt_chan_write(struct sprd_mcdt_chan *chan, char *tx_buf, u32 size) { return -EINVAL; }
[ 0, 0 ]
Linux Kernel
sound/soc/sprd/sprd-mcdt.h
int sprd_mcdt_chan_read(struct sprd_mcdt_chan *chan, char *rx_buf, u32 size) { return 0; }
[ 0, 0 ]
Linux Kernel
sound/soc/sprd/sprd-pcm-compress.c
static void sprd_platform_compr_drain_notify(void *arg) { struct snd_compr_stream *cstream = arg; struct snd_compr_runtime *runtime = cstream->runtime; struct sprd_compr_stream *stream = runtime->private_data; memset(stream->info_area, 0, sizeof(struct sprd_compr_playinfo)); snd_compr_drain_notify(cstream)...
[ 1, 0 ]
Linux Kernel
sound/soc/sprd/sprd-pcm-compress.c
static int sprd_platform_compr_pointer(struct snd_soc_component *component, struct snd_compr_stream *cstream, struct snd_compr_tstamp *tstamp) { struct snd_compr_runtime *runtime = cstream->runtime; struct sprd_compr_stream *stream = run...
[ 0, 0 ]
Linux Kernel
sound/soc/sprd/sprd-pcm-dma.c
static void sprd_pcm_release_dma_channel(struct snd_pcm_substream *substream) { struct snd_pcm_runtime *runtime = substream->runtime; struct sprd_pcm_dma_private *dma_private = runtime->private_data; int i; for (i = 0; i < SPRD_PCM_CHANNEL_MAX; i++) { struct sprd_pcm_dma_data *data = &dma_private->data[i]...
[ 0, 0 ]
Linux Kernel
sound/soc/sprd/sprd-pcm-dma.c
static int sprd_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 sn...
[ 1, 0 ]
Linux Kernel
sound/soc/sprd/sprd-pcm-dma.c
static int sprd_soc_platform_probe(struct platform_device *pdev) { struct device_node *np = pdev->dev.of_node; int ret; ret = of_reserved_mem_device_init_by_idx(&pdev->dev, np, 0); if (ret) dev_warn(&pdev->dev, "no reserved DMA memory for audio platform device\n"); ret = devm_snd_soc_register_com...
[ 0, 0 ]
Linux Kernel
sound/soc/sti/sti_uniperif.c
int sti_uniperiph_fix_tdm_format(struct snd_pcm_hw_params *params, struct snd_pcm_hw_rule *rule) { struct uniperif *uni = rule->private; struct snd_mask *maskp = hw_param_mask(params, rule->var); u64 format; switch (uni->tdm_slot.slot_width) { case 16: format = SNDRV_PCM_...
[ 1, 0 ]
Linux Kernel
sound/soc/sti/sti_uniperif.c
int sti_uniperiph_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) { struct sti_uniperiph_data *priv = snd_soc_dai_get_drvdata(dai); priv->dai_data.uni->daifmt = fmt; return 0; }
[ 0, 0 ]
Linux Kernel
sound/soc/sti/uniperif.h
static inline int sti_uniperiph_get_user_frame_size(struct snd_pcm_runtime *runtime) { return (runtime->channels * snd_pcm_format_width(runtime->format) / 8); }
[ 0, 0 ]
Linux Kernel
sound/soc/sti/uniperif_player.c
static int uni_player_ctl_iec958_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/soc/sti/uniperif_player.c
static int uni_player_ctl_iec958_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct snd_soc_dai *dai = snd_kcontrol_chip(kcontrol); struct sti_uniperiph_data *priv = snd_soc_dai_get_drvdata(dai); struct uniperif *player = priv->dai_data.uni; st...
[ 0, 0 ]
Linux Kernel
sound/soc/sti/uniperif_player.c
static int uni_player_ctl_iec958_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct snd_soc_dai *dai = snd_kcontrol_chip(kcontrol); struct sti_uniperiph_data *priv = snd_soc_dai_get_drvdata(dai); struct uniperif *player = priv->dai_data.uni; st...
[ 1, 0 ]
Linux Kernel
sound/soc/sti/uniperif_player.c
static int uni_player_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct sti_uniperiph_data *priv = snd_soc_dai_get_drvdata(dai); struct uniperif *player = priv->dai_data.uni; unsigned long flags; int ret; spin_lock_irqsave(&player->irq_lock, flags); ...
[ 0, 0 ]
Linux Kernel
sound/soc/sti/uniperif_player.c
static int uni_player_set_sysclk(struct snd_soc_dai *dai, int clk_id, unsigned int freq, int dir) { struct sti_uniperiph_data *priv = snd_soc_dai_get_drvdata(dai); struct uniperif *player = priv->dai_data.uni; int ret; if (UNIPERIF_TYPE_IS_TDM(player) || (dir == SND_SOC_CLOCK_...
[ 0, 0 ]
Linux Kernel
sound/soc/sti/uniperif_player.c
static int uni_player_trigger(struct snd_pcm_substream *substream, int cmd, struct snd_soc_dai *dai) { struct sti_uniperiph_data *priv = snd_soc_dai_get_drvdata(dai); struct uniperif *player = priv->dai_data.uni; switch (cmd) { case SNDRV_PCM_TRIGGER_START: return uni_player_...
[ 0, 0 ]
Linux Kernel
sound/soc/sti/uniperif_reader.c
static int uni_reader_prepare_tdm(struct snd_pcm_runtime *runtime, struct uniperif *reader) { int frame_size; /* default unip TDM_WORD_POS_X_Y */ unsigned int word_pos[4] = {0x04060002, 0x0C0E080A, 0x14161012, 0x1C1E181A}; frame_size = sti_uniperiph_get_user_frame_size(runtime...
[ 1, 0 ]
Linux Kernel
sound/soc/sti/uniperif_reader.c
static int uni_reader_start(struct uniperif *reader) { if (reader->state != UNIPERIF_STATE_STOPPED) { dev_err(reader->dev, "%s: invalid reader state\n", __func__); return -EINVAL; } /* Enable reader interrupts (and clear possible stalled ones) */ SET_UNIPERIF_ITS_BCLR_FIFO_ERROR(reader); SET_UNIPERI...
[ 0, 0 ]
Linux Kernel
sound/soc/sti/uniperif_reader.c
int uni_reader_init(struct platform_device *pdev, struct uniperif *reader) { int ret = 0; reader->dev = &pdev->dev; reader->state = UNIPERIF_STATE_STOPPED; reader->dai_ops = &uni_reader_dai_ops; if (UNIPERIF_TYPE_IS_TDM(reader)) reader->hw = &uni_tdm_hw; else reader->hw = &uni_reader_pcm_hw; r...
[ 0, 0 ]
Linux Kernel
sound/soc/stm/stm32_adfsdm.c
static void stm32_memcpy_32to16(void *dest, const void *src, size_t n) { unsigned int i = 0; u16 *d = (u16 *)dest, *s = (u16 *)src; s++; for (i = n >> 1; i > 0; i--) { *d++ = *s++; s++; } }
[ 1, 0 ]
Linux Kernel
sound/soc/stm/stm32_adfsdm.c
static int stm32_afsdm_pcm_cb(const void *data, size_t size, void *private) { struct stm32_adfsdm_priv *priv = private; struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(priv->substream); u8 *pcm_buff = priv->pcm_buff; u8 *src_buff = (u8 *)data; unsigned int old_pos = priv->pos; size_t buff_size = sn...
[ 1, 0 ]
Linux Kernel
sound/soc/stm/stm32_adfsdm.c
static int stm32_adfsdm_trigger(struct snd_soc_component *component, struct snd_pcm_substream *substream, int cmd) { struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); struct stm32_adfsdm_priv *priv = snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(rtd, 0)); switch...
[ 1, 0 ]
Linux Kernel
sound/soc/stm/stm32_adfsdm.c
static int stm32_adfsdm_pcm_new(struct snd_soc_component *component, struct snd_soc_pcm_runtime *rtd) { struct snd_pcm *pcm = rtd->pcm; struct stm32_adfsdm_priv *priv = snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(rtd, 0)); unsigned int size = DFSDM_MAX_PERIODS * DFSDM_MAX_PERIOD...
[ 1, 0 ]
Linux Kernel
sound/soc/stm/stm32_adfsdm.c
static int stm32_adfsdm_probe(struct platform_device *pdev) { struct stm32_adfsdm_priv *priv; struct snd_soc_component *component; int ret; priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); if (!priv) return -ENOMEM; priv->dev = &pdev->dev; priv->dai_drv = stm32_adfsdm_dai; mutex_init(&p...
[ 1, 0 ]
Linux Kernel
sound/soc/stm/stm32_i2s.c
static int stm32_i2s_calc_clk_div(struct stm32_i2s_data *i2s, unsigned long input_rate, unsigned long output_rate) { unsigned int ratio, div, divider = 1; bool odd; ratio = DIV_ROUND_CLOSEST(input_rate, output_rate); odd = ratio & 0x1; /* ...
[ 1, 0 ]
Linux Kernel
sound/soc/stm/stm32_i2s.c
static int stm32_i2s_set_parent_clock(struct stm32_i2s_data *i2s, unsigned int rate) { struct platform_device *pdev = i2s->pdev; struct clk *parent_clk; int ret; if (!(rate % STM32_I2S_RATE_11K)) parent_clk = i2s->x11kclk; else parent_clk = i2s->x8kclk; ret =...
[ 0, 0 ]
Linux Kernel
sound/soc/stm/stm32_i2s.c
static unsigned long stm32_i2smclk_recalc_rate(struct clk_hw *hw, unsigned long parent_rate) { struct stm32_i2smclk_data *mclk = to_mclk_data(hw); return mclk->freq; }
[ 0, 0 ]
Linux Kernel
sound/soc/stm/stm32_i2s.c
static bool stm32_i2s_readable_reg(struct device *dev, unsigned int reg) { switch (reg) { case STM32_I2S_CR1_REG: case STM32_I2S_CFG1_REG: case STM32_I2S_CFG2_REG: case STM32_I2S_IER_REG: case STM32_I2S_SR_REG: case STM32_I2S_RXDR_REG: case STM32_I2S_CGFR_REG: case STM32_I2S_HWCFGR_REG: case STM32_...
[ 0, 0 ]
Linux Kernel
sound/soc/stm/stm32_i2s.c
static int stm32_i2s_configure(struct snd_soc_dai *cpu_dai, struct snd_pcm_hw_params *params, struct snd_pcm_substream *substream) { struct stm32_i2s_data *i2s = snd_soc_dai_get_drvdata(cpu_dai); int format = params_width(params); u32 cfgr, cfgr_mask, ...
[ 0, 0 ]
Linux Kernel
sound/soc/stm/stm32_i2s.c
static int stm32_i2s_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *cpu_dai) { struct stm32_i2s_data *i2s = snd_soc_dai_get_drvdata(cpu_dai); unsigned long flags; int ret; spin_lock_irqsave(&i2s->irq_lock, flags); i2s->substream = substream; spin_unlock_irqre...
[ 1, 0 ]
Linux Kernel
sound/soc/stm/stm32_i2s.c
static int stm32_i2s_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, struct snd_soc_dai *cpu_dai) { struct stm32_i2s_data *i2s = snd_soc_dai_get_drvdata(cpu_dai); int ret; ret = stm32_i2s_configure(cpu_dai, params, su...
[ 0, 0 ]
Linux Kernel
sound/soc/stm/stm32_sai.c
static int stm32_sai_suspend(struct device *dev) { struct stm32_sai_data *sai = dev_get_drvdata(dev); int ret; ret = stm32_sai_pclk_enable(dev); if (ret) return ret; sai->gcr = readl_relaxed(sai->base); stm32_sai_pclk_disable(dev); return pinctrl_pm_select_sleep_state(dev); }
[ 0, 0 ]
Linux Kernel
sound/soc/stm/stm32_sai_sub.c
static bool stm32_sai_sub_volatile_reg(struct device *dev, unsigned int reg) { switch (reg) { case STM_SAI_DR_REGX: case STM_SAI_SR_REGX: return true; default: return false; } }
[ 0, 0 ]
Linux Kernel
sound/soc/stm/stm32_sai_sub.c
static bool stm32_sai_sub_writeable_reg(struct device *dev, unsigned int reg) { switch (reg) { case STM_SAI_CR1_REGX: case STM_SAI_CR2_REGX: case STM_SAI_FRCR_REGX: case STM_SAI_SLOTR_REGX: case STM_SAI_IMR_REGX: case STM_SAI_CLRFR_REGX: case STM_SAI_DR_REGX: case STM_SAI_PDMCR_REGX: case STM_SAI_P...
[ 0, 0 ]
Linux Kernel
sound/soc/stm/stm32_sai_sub.c
static int snd_pcm_iec958_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/soc/stm/stm32_sai_sub.c
static int snd_pcm_iec958_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *uctl) { struct stm32_sai_sub_data *sai = snd_kcontrol_chip(kcontrol); mutex_lock(&sai->ctrl_lock); memcpy(uctl->value.iec958.status, sai->iec958.status, 4); mutex_unlock(&sai->ctrl_lock); r...
[ 1, 0 ]
Linux Kernel
sound/soc/stm/stm32_sai_sub.c
static int snd_pcm_iec958_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *uctl) { struct stm32_sai_sub_data *sai = snd_kcontrol_chip(kcontrol); mutex_lock(&sai->ctrl_lock); memcpy(sai->iec958.status, uctl->value.iec958.status, 4); mutex_unlock(&sai->ctrl_lock); r...
[ 1, 0 ]
Linux Kernel
sound/soc/stm/stm32_sai_sub.c
static int stm32_sai_set_clk_div(struct stm32_sai_sub_data *sai, unsigned int div) { int version = sai->pdata->conf.version; int ret, cr1, mask; if (div > SAI_XCR1_MCKDIV_MAX(version)) { dev_err(&sai->pdev->dev, "Divider %d out of range\n", div); return -EINVAL; } m...
[ 0, 0 ]
Linux Kernel
sound/soc/stm/stm32_sai_sub.c
static int stm32_sai_set_parent_clock(struct stm32_sai_sub_data *sai, unsigned int rate) { struct platform_device *pdev = sai->pdev; struct clk *parent_clk = sai->pdata->clk_x8k; int ret; if (!(rate % SAI_RATE_11K)) parent_clk = sai->pdata->clk_x11k; ret = clk_set_...
[ 1, 0 ]
Linux Kernel
sound/soc/stm/stm32_sai_sub.c
static void stm32_sai_mclk_disable(struct clk_hw *hw) { struct stm32_sai_mclk_data *mclk = to_mclk_data(hw); struct stm32_sai_sub_data *sai = mclk->sai_data; dev_dbg(&sai->pdev->dev, "Disable master clock\n"); stm32_sai_sub_reg_up(sai, STM_SAI_CR1_REGX, SAI_XCR1_MCKEN, 0); }
[ 0, 0 ]
Linux Kernel
sound/soc/stm/stm32_sai_sub.c
static int stm32_sai_add_mclk_provider(struct stm32_sai_sub_data *sai) { struct clk_hw *hw; struct stm32_sai_mclk_data *mclk; struct device *dev = &sai->pdev->dev; const char *pname = __clk_get_name(sai->sai_ck); char *mclk_name, *p, *s = (char *)pname; int ret, i = 0; mclk = devm_kzalloc(dev, sizeof(*mc...
[ 1, 0 ]
Linux Kernel
sound/soc/stm/stm32_sai_sub.c
static int stm32_sai_set_sysclk(struct snd_soc_dai *cpu_dai, int clk_id, unsigned int freq, int dir) { struct stm32_sai_sub_data *sai = snd_soc_dai_get_drvdata(cpu_dai); int ret; if (dir == SND_SOC_CLOCK_OUT && sai->sai_mclk) { ret = stm32_sai_sub_reg_up(sai, STM_SAI_CR1_REGX,...
[ 0, 0 ]
Linux Kernel
sound/soc/stm/stm32_sai_sub.c
static void stm32_sai_init_iec958_status(struct stm32_sai_sub_data *sai) { unsigned char *cs = sai->iec958.status; cs[0] = IEC958_AES0_CON_NOT_COPYRIGHT | IEC958_AES0_CON_EMPHASIS_NONE; cs[1] = IEC958_AES1_CON_GENERAL; cs[2] = IEC958_AES2_CON_SOURCE_UNSPEC | IEC958_AES2_CON_CHANNEL_UNSPEC; cs[3] = IEC958_AE...
[ 1, 0 ]
Linux Kernel
sound/soc/stm/stm32_sai_sub.c
static int stm32_sai_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, struct snd_soc_dai *cpu_dai) { struct stm32_sai_sub_data *sai = snd_soc_dai_get_drvdata(cpu_dai); int ret; sai->data_size = params_width(params); ...
[ 0, 0 ]
Linux Kernel
sound/soc/stm/stm32_sai_sub.c
static int stm32_sai_sub_suspend(struct device *dev) { struct stm32_sai_sub_data *sai = dev_get_drvdata(dev); int ret; ret = clk_enable(sai->pdata->pclk); if (ret < 0) return ret; regcache_cache_only(sai->regmap, true); regcache_mark_dirty(sai->regmap); clk_disable(sai->pdata->pclk); return 0; }
[ 0, 0 ]
Linux Kernel
sound/soc/stm/stm32_spdifrx.c
static int stm32_spdifrx_start_sync(struct stm32_spdifrx_data *spdifrx) { int cr, cr_mask, imr, ret; unsigned long flags; imr = SPDIFRX_IMR_IFEIE | SPDIFRX_IMR_SYNCDIE | SPDIFRX_IMR_PERRIE; ret = regmap_update_bits(spdifrx->regmap, STM32_SPDIFRX_IMR, imr, imr); if (ret) return ret; spin_lock_irqsave(&...
[ 0, 0 ]
Linux Kernel
sound/soc/stm/stm32_spdifrx.c
static int stm32_spdifrx_get_ctrl_data(struct stm32_spdifrx_data *spdifrx) { int ret = 0; memset(spdifrx->cs, 0, SPDIFRX_CS_BYTES_NB); memset(spdifrx->ub, 0, SPDIFRX_UB_BYTES_NB); ret = stm32_spdifrx_dma_ctrl_start(spdifrx); if (ret < 0) return ret; ret = clk_prepare_enable(spdifrx->kclk); if (ret...
[ 1, 0 ]
Linux Kernel
sound/soc/stm/stm32_spdifrx.c
static bool stm32_spdifrx_readable_reg(struct device *dev, unsigned int reg) { switch (reg) { case STM32_SPDIFRX_CR: case STM32_SPDIFRX_IMR: case STM32_SPDIFRX_SR: case STM32_SPDIFRX_IFCR: case STM32_SPDIFRX_DR: case STM32_SPDIFRX_CSR: case STM32_SPDIFRX_DIR: case STM32_SPDIFRX_VERR: case STM32_SPD...
[ 0, 0 ]
Linux Kernel
sound/soc/stm/stm32_spdifrx.c
static void stm32_spdifrx_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *cpu_dai) { struct stm32_spdifrx_data *spdifrx = snd_soc_dai_get_drvdata(cpu_dai); unsigned long flags; spin_lock_irqsave(&spdifrx->irq_lock, flags); spdifrx->substream = NULL; spin_...
[ 0, 0 ]
Linux Kernel
sound/soc/stm/stm32_spdifrx.c
static int stm32_spdifrx_remove(struct platform_device *pdev) { struct stm32_spdifrx_data *spdifrx = platform_get_drvdata(pdev); if (spdifrx->ctrl_chan) dma_release_channel(spdifrx->ctrl_chan); if (spdifrx->dmab) snd_dma_free_pages(spdifrx->dmab); snd_dmaengine_pcm_unregister(&pdev->dev); snd_soc_...
[ 0, 0 ]
Linux Kernel
sound/soc/sunxi/sun4i-codec.c
static void sun4i_codec_start_playback(struct sun4i_codec *scodec) { regmap_set_bits(scodec->regmap, SUN4I_CODEC_DAC_FIFOC, BIT(SUN4I_CODEC_DAC_FIFOC_FIFO_FLUSH)); /* Enable DAC DRQ */ regmap_set_bits(scodec->regmap, SUN4I_CODEC_DAC_FIFOC, BIT(SUN4I_CODEC_DAC_FIFOC_DAC_DRQ_EN...
[ 0, 0 ]
Linux Kernel
sound/soc/sunxi/sun4i-codec.c
static int sun4i_codec_trigger(struct snd_pcm_substream *substream, int cmd, struct snd_soc_dai *dai) { struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); struct sun4i_codec *scodec = snd_soc_card_get_drvdata(rtd->card); switch (cmd) { case SNDRV_PCM_TRIGGER_STA...
[ 0, 0 ]
Linux Kernel
sound/soc/sunxi/sun4i-codec.c
static int sun4i_codec_prepare_capture(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); struct sun4i_codec *scodec = snd_soc_card_get_drvdata(rtd->card); regmap_field_set_bits(scodec->reg_adc...
[ 1, 1 ]
Linux Kernel
sound/soc/sunxi/sun4i-codec.c
static int sun4i_codec_prepare_playback(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); struct sun4i_codec *scodec = snd_soc_card_get_drvdata(rtd->card); u32 val; regmap_set_bits(scodec->...
[ 1, 0 ]
Linux Kernel
sound/soc/sunxi/sun4i-codec.c
static int sun4i_codec_prepare(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) return sun4i_codec_prepare_playback(substream, dai); return sun4i_codec_prepare_capture(substream, dai); }
[ 0, 0 ]
Linux Kernel
sound/soc/sunxi/sun4i-codec.c
static int sun4i_codec_get_hw_rate(struct snd_pcm_hw_params *params) { unsigned int rate = params_rate(params); switch (rate) { case 192000: case 176400: return 6; case 96000: case 88200: return 7; case 48000: case 44100: return 0; case 32000: case 33075: return 1; case 24000...
[ 1, 0 ]