Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
⌀
Function
large_stringlengths
11
3.45k
Label
list
Linux Kernel
sound/soc/intel/skylake/skl-topology.c
static int skl_tplg_get_uuid(struct device *dev, guid_t *guid, struct snd_soc_tplg_vendor_uuid_elem *uuid_tkn) { if (uuid_tkn->token == SKL_TKN_UUID) { import_guid(guid, uuid_tkn->uuid); return 0; } dev_err(dev, "Not an UUID token %d\n", uuid_tkn->token); return -EINVAL; ...
[ 0, 0 ]
Linux Kernel
sound/soc/intel/skylake/skl-topology.c
static void skl_tplg_fill_pin_dynamic_val(struct skl_module_pin *mpin, u32 pin_count, u32 value) { int i; for (i = 0; i < pin_count; i++) mpin[i].is_dynamic = value; }
[ 0, 0 ]
Linux Kernel
sound/soc/intel/skylake/skl-topology.c
static int skl_tplg_manifest_pin_res_tkn( struct device *dev, struct snd_soc_tplg_vendor_value_elem *tkn_elem, struct skl_module_res *res, int pin_idx, int dir) { struct skl_module_pin_resources *m_pin; switch (dir) { case SKL_DIR_IN: m_pin = &res->input[pin_idx]; break; case SKL_DIR_OUT: ...
[ 0, 0 ]
Linux Kernel
sound/soc/intel/skylake/skl-topology.c
static int skl_tplg_get_desc_blocks(struct device *dev, struct snd_soc_tplg_vendor_array *array) { struct snd_soc_tplg_vendor_value_elem *tkn_elem; tkn_elem = array->value; switch (tkn_elem->token) { case SKL_TKN_U8_NUM_BLOCKS: case SKL_TKN_U8_BLOCK_TYPE: case SKL_TKN_U...
[ 0, 0 ]
Linux Kernel
sound/soc/intel/skylake/skl-topology.c
static int skl_tplg_add_pipe_v4(struct device *dev, struct skl_module_cfg *mconfig, struct skl_dev *skl, struct skl_dfw_v4_pipe *dfw_pipe) { struct skl_pipeline *ppl; struct skl_pipe *pipe; struct skl_pipe_params *para...
[ 1, 0 ]
Linux Kernel
sound/soc/intel/skylake/skl-topology.c
static void skl_tplg_fill_fmt_v4(struct skl_module_pin_fmt *dst_fmt, struct skl_dfw_v4_module_fmt *src_fmt, int pins) { int i; for (i = 0; i < pins; i++) { dst_fmt[i].fmt.channels = src_fmt[i].channels; dst_fmt[i].fmt.s_freq = src_fmt[i].fr...
[ 0, 0 ]
Linux Kernel
sound/soc/intel/skylake/skl-topology.c
static int skl_tplg_fill_str_mfest_tkn(struct device *dev, struct snd_soc_tplg_vendor_string_elem *str_elem, struct skl_dev *skl) { int tkn_count = 0; static int ref_count; switch (str_elem->token) { case SKL_TKN_STR_LIB_NAME: if (ref_count > skl->li...
[ 1, 0 ]
Linux Kernel
sound/soc/intel/skylake/skl-topology.c
static int skl_tplg_get_manifest_tkn(struct device *dev, char *pvt_data, struct skl_dev *skl, int block_size) { int tkn_count = 0, ret; int off = 0, tuple_size = 0; u8 uuid_index = 0; struct snd_soc_tplg_vendor_array *array; struct snd_soc_tplg_vendor_value_elem *tkn_elem;...
[ 1, 0 ]
Linux Kernel
sound/soc/intel/skylake/skl-topology.c
static void skl_tplg_set_pipe_type(struct skl_dev *skl, struct skl_pipe *pipe) { struct skl_pipe_module *w_module; struct snd_soc_dapm_widget *w; struct skl_module_cfg *mconfig; bool host_found = false, link_found = false; list_for_each_entry(w_module, &pipe->w_list, node) { w = w_module->w; mconfig...
[ 0, 0 ]
Linux Kernel
sound/soc/intel/skylake/skl-topology.h
static inline struct skl_dev *get_skl_ctx(struct device *dev) { struct hdac_bus *bus = dev_get_drvdata(dev); return bus_to_skl(bus); }
[ 0, 0 ]
Linux Kernel
sound/soc/intel/skylake/skl.c
static void skl_stream_update(struct hdac_bus *bus, struct hdac_stream *hstr) { snd_pcm_period_elapsed(hstr->substream); }
[ 0, 0 ]
Linux Kernel
sound/soc/intel/skylake/skl.c
static irqreturn_t skl_interrupt(int irq, void *dev_id) { struct hdac_bus *bus = dev_id; u32 status; if (!pm_runtime_active(bus->dev)) return IRQ_NONE; spin_lock(&bus->reg_lock); status = snd_hdac_chip_readl(bus, INTSTS); if (status == 0 || status == 0xffffffff) { spin_unlock(&bus->reg_lock); ...
[ 0, 0 ]
Linux Kernel
sound/soc/intel/skylake/skl.c
static int _skl_suspend(struct hdac_bus *bus) { struct skl_dev *skl = bus_to_skl(bus); struct pci_dev *pci = to_pci_dev(bus->dev); int ret; snd_hdac_ext_bus_link_power_down_all(bus); ret = skl_suspend_dsp(skl); if (ret < 0) return ret; snd_hdac_bus_stop_chip(bus); update_pci_dword(pci, AZX_PCIREG...
[ 0, 0 ]
Linux Kernel
sound/soc/intel/skylake/skl.c
static int _skl_resume(struct hdac_bus *bus) { struct skl_dev *skl = bus_to_skl(bus); skl_init_pci(skl); skl_dum_set(bus); skl_init_chip(bus, true); return skl_resume_dsp(skl); } #endif #ifdef CONFIG_PM_SLEEP
[ 0, 0 ]
Linux Kernel
sound/soc/intel/skylake/skl.c
static int skl_suspend(struct device *dev) { struct pci_dev *pci = to_pci_dev(dev); struct hdac_bus *bus = pci_get_drvdata(pci); struct skl_dev *skl = bus_to_skl(bus); int ret; if (skl->supend_active) { /* turn off the links and stop the CORB/RIRB DMA if it is On */ snd_hdac_ext_bus_link_power_down_a...
[ 0, 0 ]
Linux Kernel
sound/soc/intel/skylake/skl.c
static int skl_runtime_suspend(struct device *dev) { struct pci_dev *pci = to_pci_dev(dev); struct hdac_bus *bus = pci_get_drvdata(pci); dev_dbg(bus->dev, "in %s\n", __func__); return _skl_suspend(bus); }
[ 0, 0 ]
Linux Kernel
sound/soc/intel/skylake/skl.c
static int skl_runtime_resume(struct device *dev) { struct pci_dev *pci = to_pci_dev(dev); struct hdac_bus *bus = pci_get_drvdata(pci); dev_dbg(bus->dev, "in %s\n", __func__); return _skl_resume(bus); } #endif
[ 0, 0 ]
Linux Kernel
sound/soc/intel/skylake/skl.c
struct skl_clk_parent_src *skl_get_parent_clk(u8 clk_id) { unsigned int i; for (i = 0; i < ARRAY_SIZE(skl_clk_src); i++) { if (skl_clk_src[i].clk_id == clk_id) return &skl_clk_src[i]; } return NULL; }
[ 0, 0 ]
Linux Kernel
sound/soc/intel/skylake/skl.c
static void init_skl_xtal_rate(int pci_id) { switch (pci_id) { case 0x9d70: case 0x9d71: skl_clk_src[0].rate = 24000000; return; default: skl_clk_src[0].rate = 19200000; return; } }
[ 0, 0 ]
Linux Kernel
sound/soc/intel/skylake/skl.c
static void load_codec_module(struct hda_codec *codec) { #ifdef MODULE char modalias[MODULE_NAME_LEN]; const char *mod = NULL; snd_hdac_codec_modalias(&codec->core, modalias, sizeof(modalias)); mod = modalias; dev_dbg(&codec->core.dev, "loading %s codec module\n", mod); request_module(mod); #endif }
[ 1, 0 ]
Linux Kernel
sound/soc/intel/skylake/skl.c
static int probe_codec(struct hdac_bus *bus, int addr) { unsigned int cmd = (addr << 28) | (AC_NODE_ROOT << 20) | (AC_VERB_PARAMETERS << 8) | AC_PAR_VENDOR_ID; unsigned int res = -1; #if IS_ENABLED(CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC) struct skl_dev *skl = bus_to_skl(bus); struct hda...
[ 1, 0 ]
Linux Kernel
sound/soc/intel/skylake/skl.c
static void skl_codec_create(struct hdac_bus *bus) { int c, max_slots; max_slots = HDA_MAX_CODECS; for (c = 0; c < max_slots; c++) { if ((bus->codec_mask & (1 << c))) { if (probe_codec(bus, c) < 0) { /* * Some BIOSen give you wrong codec addresses * that don't exist ...
[ 0, 0 ]
Linux Kernel
sound/soc/intel/skylake/skl.c
static void skl_probe_work(struct work_struct *work) { struct skl_dev *skl = container_of(work, struct skl_dev, probe_work); struct hdac_bus *bus = skl_to_bus(skl); struct hdac_ext_link *hlink; int err; if (IS_ENABLED(CONFIG_SND_SOC_HDAC_HDMI)) { err = skl_i915_init(bus); if (err < 0) return; ...
[ 0, 0 ]
Linux Kernel
sound/soc/intel/skylake/skl.h
static inline void skl_debugfs_exit(struct skl_dev *skl) {}
[ 0, 0 ]
Linux Kernel
sound/soc/jz4740/jz4740-i2s.c
static int jz4740_i2s_trigger(struct snd_pcm_substream *substream, int cmd, struct snd_soc_dai *dai) { struct jz4740_i2s *i2s = snd_soc_dai_get_drvdata(dai); uint32_t mask; if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) mask = JZ_AIC_CTRL_ENABLE_PLAYBACK | JZ_AIC_CTRL_ENAB...
[ 0, 0 ]
Linux Kernel
sound/soc/jz4740/jz4740-i2s.c
static int jz4740_i2s_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) { struct jz4740_i2s *i2s = snd_soc_dai_get_drvdata(dai); const unsigned int conf_mask = JZ_AIC_CONF_BIT_CLK_MASTER | JZ_AIC_CONF_SYNC_CLK_MASTER; unsigned int conf = 0, format = 0; switch (fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) ...
[ 1, 0 ]
Linux Kernel
sound/soc/jz4740/jz4740-i2s.c
static int jz4740_i2s_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) { struct jz4740_i2s *i2s = snd_soc_dai_get_drvdata(dai); struct regmap_field *div_field; unsigned int sample_size; uint...
[ 0, 0 ]
Linux Kernel
sound/soc/jz4740/jz4740-i2s.c
static int jz4740_i2s_suspend(struct snd_soc_component *component) { struct jz4740_i2s *i2s = snd_soc_component_get_drvdata(component); if (snd_soc_component_active(component)) { regmap_clear_bits(i2s->regmap, JZ_REG_AIC_CONF, JZ_AIC_CONF_ENABLE); clk_disable_unprepare(i2s->clk_i2s); } clk_disable_un...
[ 0, 0 ]
Linux Kernel
sound/soc/jz4740/jz4740-i2s.c
static void jz4740_i2s_remove(struct snd_soc_component *component) { struct jz4740_i2s *i2s = snd_soc_component_get_drvdata(component); clk_disable_unprepare(i2s->clk_aic); }
[ 0, 0 ]
Linux Kernel
sound/soc/jz4740/jz4740-i2s.c
static int jz4740_i2s_init_regmap_fields(struct device *dev, struct jz4740_i2s *i2s) { i2s->field_rx_fifo_thresh = devm_regmap_field_alloc( dev, i2s->regmap, i2s->soc_info->field_rx_fifo_thresh); if (IS_ERR(i2s->field_rx_fifo_thresh)) return PTR_ERR(i2s->field_rx_...
[ 0, 0 ]
Linux Kernel
sound/soc/kirkwood/armada-370-db.c
static int a370db_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) { struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); unsigned int freq; switch (params_rate(params)) { de...
[ 0, 0 ]
Linux Kernel
sound/soc/kirkwood/armada-370-db.c
static int a370db_probe(struct platform_device *pdev) { struct snd_soc_card *card = &a370db; card->dev = &pdev->dev; a370db_dai[0].cpus->of_node = of_parse_phandle(pdev->dev.of_node, "marvell,audio-controller", 0); a370db_dai[0].platforms->of_node = a370db_dai[0].cpus->of_node; a370db_dai[0].codecs-...
[ 0, 0 ]
Linux Kernel
sound/soc/kirkwood/kirkwood-dma.c
static struct kirkwood_dma_data *kirkwood_priv(struct snd_pcm_substream *subs) { struct snd_soc_pcm_runtime *soc_runtime = subs->private_data; return snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(soc_runtime, 0)); }
[ 0, 0 ]
Linux Kernel
sound/soc/kirkwood/kirkwood-dma.c
static void kirkwood_dma_conf_mbus_windows(void __iomem *base, int win, unsigned long dma, const struct mbus_dram_target_info *dram) { int i; writel(0, base + KIRKWOOD_AUDIO_WIN_CTRL_REG(win)); writel(0, base + KIRKWOOD_AUDIO_WIN_BASE_REG(win)); /* try to find matching cs for cu...
[ 0, 0 ]
Linux Kernel
sound/soc/kirkwood/kirkwood-dma.c
static int kirkwood_dma_open(struct snd_soc_component *component, struct snd_pcm_substream *substream) { int err; struct snd_pcm_runtime *runtime = substream->runtime; struct kirkwood_dma_data *priv = kirkwood_priv(substream); snd_soc_set_runtime_hwparams(substream, &kirkwood_dma_s...
[ 0, 0 ]
Linux Kernel
sound/soc/kirkwood/kirkwood-dma.c
static int kirkwood_dma_hw_params(struct snd_soc_component *component, struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) { struct kirkwood_dma_data *priv = kirkwood_priv(substream); const struct mbus_dram_target_info *dram = m...
[ 1, 0 ]
Linux Kernel
sound/soc/kirkwood/kirkwood-dma.c
static int kirkwood_dma_new(struct snd_soc_component *component, struct snd_soc_pcm_runtime *rtd) { size_t size = kirkwood_dma_snd_hw.buffer_bytes_max; struct snd_card *card = rtd->card->snd_card; int ret; ret = dma_coerce_mask_and_coherent(card->dev, DMA_BIT_MASK(32)); if (ret) ...
[ 1, 0 ]
Linux Kernel
sound/soc/kirkwood/kirkwood-i2s.c
static int armada_38x_i2s_init_quirk(struct platform_device *pdev, struct kirkwood_dma_data *priv, struct snd_soc_dai_driver *dai_drv) { struct device_node *np = pdev->dev.of_node; u32 reg_val; int i; priv->pll_config = devm_platform_ior...
[ 0, 0 ]
Linux Kernel
sound/soc/kirkwood/kirkwood-i2s.c
static inline void armada_38x_set_pll(void __iomem *base, unsigned long rate) { u32 reg_val; u16 freq_offset = 0x22b0; u8 audio_postdiv, fb_clk_div = 0x1d; reg_val = readl(base + A38X_PLL_CONF_REG1); reg_val &= ~A38X_PLL_FREQ_OFFSET_VALID; reg_val &= ~A38X_PLL_SW_RESET; writel(reg_val, base + A38X_PLL_CO...
[ 1, 0 ]
Linux Kernel
sound/soc/kirkwood/kirkwood-i2s.c
static int kirkwood_i2s_dev_remove(struct platform_device *pdev) { struct kirkwood_dma_data *priv = dev_get_drvdata(&pdev->dev); snd_soc_unregister_component(&pdev->dev); if (!IS_ERR(priv->extclk)) clk_disable_unprepare(priv->extclk); clk_disable_unprepare(priv->clk); return 0; }
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/common/mtk-afe-fe-dai.c
int mtk_afe_suspend(struct snd_soc_component *component) { struct mtk_base_afe *afe = snd_soc_component_get_drvdata(component); struct device *dev = afe->dev; struct regmap *regmap = afe->regmap; int i; if (pm_runtime_status_suspended(dev) || afe->suspended) return 0; if (!afe->reg_back_up) afe->...
[ 1, 0 ]
Linux Kernel
sound/soc/mediatek/common/mtk-afe-fe-dai.c
int mtk_memif_set_disable(struct mtk_base_afe *afe, int id) { struct mtk_base_afe_memif *memif = &afe->memif[id]; if (memif->data->enable_shift < 0) { dev_warn(afe->dev, "%s(), error, id %d, enable_shift < 0\n", __func__, id); return 0; } return mtk_regmap_update_bits(afe->regmap, memif->data->enable_...
[ 1, 0 ]
Linux Kernel
sound/soc/mediatek/common/mtk-afe-fe-dai.c
int mtk_memif_set_format(struct mtk_base_afe *afe, int id, snd_pcm_format_t format) { struct mtk_base_afe_memif *memif = &afe->memif[id]; int hd_audio = 0; int hd_align = 0; switch (format) { case SNDRV_PCM_FORMAT_S16_LE: case SNDRV_PCM_FORMAT_U16_LE: hd_audio = 0; break; ...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/common/mtk-afe-platform-driver.c
int mtk_afe_add_sub_dai_control(struct snd_soc_component *component) { struct mtk_base_afe *afe = snd_soc_component_get_drvdata(component); struct mtk_base_afe_dai *dai; list_for_each_entry(dai, &afe->sub_dais, list) { if (dai->controls) snd_soc_add_component_controls(component, dai->controls, ...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/common/mtk-afe-platform-driver.c
snd_pcm_uframes_t mtk_afe_pcm_pointer(struct snd_soc_component *component, struct snd_pcm_substream *substream) { struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); struct mtk_base_afe *afe = snd_soc_component_get_drvdata(component); struct mtk_base_afe_memi...
[ 1, 0 ]
Linux Kernel
sound/soc/mediatek/common/mtk-btcvsd.c
static void mtk_btcvsd_snd_irq_disable(struct mtk_btcvsd_snd *bt) { regmap_update_bits(bt->infra, bt->infra_misc_offset, bt->conn_bt_cvsd_mask, bt->conn_bt_cvsd_mask); }
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/common/mtk-btcvsd.c
static int mtk_btcvsd_snd_tx_init(struct mtk_btcvsd_snd *bt) { memset(bt->tx, 0, sizeof(*bt->tx)); memset(bt->tx_packet_buf, 0, sizeof(bt->tx_packet_buf)); bt->tx->packet_size = BTCVSD_TX_PACKET_SIZE; bt->tx->buf_size = BTCVSD_TX_BUF_SIZE; bt->tx->timeout = 0; bt->tx->rw_cnt = 0; bt->tx->stream = SNDRV_...
[ 1, 0 ]
Linux Kernel
sound/soc/mediatek/common/mtk-btcvsd.c
static int mtk_btcvsd_read_from_bt(struct mtk_btcvsd_snd *bt, enum bt_sco_packet_len packet_type, unsigned int packet_length, unsigned int packet_num, unsigned int blk_size, ...
[ 1, 0 ]
Linux Kernel
sound/soc/mediatek/common/mtk-btcvsd.c
static int mtk_pcm_btcvsd_hw_free(struct snd_soc_component *component, struct snd_pcm_substream *substream) { struct mtk_btcvsd_snd *bt = snd_soc_component_get_drvdata(component); if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) btcvsd_tx_clean_buffer(bt); return 0; }
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/common/mtk-btcvsd.c
static snd_pcm_uframes_t mtk_pcm_btcvsd_pointer(struct snd_soc_component *component, struct snd_pcm_substream *substream) { struct mtk_btcvsd_snd *bt = snd_soc_component_get_drvdata(component); struct mtk_btcvsd_snd_stream *bt_stream; snd_pcm_uframes_t frame = 0; int byte = 0; int hw_pa...
[ 1, 0 ]
Linux Kernel
sound/soc/mediatek/common/mtk-btcvsd.c
static int btcvsd_band_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); struct mtk_btcvsd_snd *bt = snd_soc_component_get_drvdata(cmpnt); ucontrol->value.integer.value[0] = bt->band; ret...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/common/mtk-btcvsd.c
static int btcvsd_band_set(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); struct mtk_btcvsd_snd *bt = snd_soc_component_get_drvdata(cmpnt); struct soc_enum *e = (struct soc_enum *)kcontrol->p...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/common/mtk-btcvsd.c
static int btcvsd_loopback_set(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); struct mtk_btcvsd_snd *bt = snd_soc_component_get_drvdata(cmpnt); if (ucontrol->value.integer.value[0]) { ...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/common/mtk-btcvsd.c
static int btcvsd_rx_timestamp_get(struct snd_kcontrol *kcontrol, unsigned int __user *data, unsigned int size) { struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); struct mtk_btcvsd_snd *bt = snd_soc_component_get_drvdata(c...
[ 1, 0 ]
Linux Kernel
sound/soc/mediatek/common/mtk-dsp-sof-common.c
int mtk_sof_card_probe(struct snd_soc_card *card) { int i; struct snd_soc_dai_link *dai_link; for_each_card_prelinks(card, i, dai_link) { if (dai_link->no_pcm && !dai_link->stream_name && dai_link->name) dai_link->stream_name = dai_link->name; } return 0; }
[ 1, 0 ]
Linux Kernel
sound/soc/mediatek/mt2701/mt2701-afe-clock-ctrl.c
static void mt2701_afe_disable_audsys(struct mtk_base_afe *afe) { struct mt2701_afe_private *afe_priv = afe->platform_priv; clk_disable_unprepare(afe_priv->base_ck[MT2701_AUDSYS_AFE_CONN]); clk_disable_unprepare(afe_priv->base_ck[MT2701_AUDSYS_A2SYS]); clk_disable_unprepare(afe_priv->base_ck[MT2701_AUDSYS_A1S...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt2701/mt2701-afe-clock-ctrl.c
int mt2701_afe_disable_clock(struct mtk_base_afe *afe) { regmap_update_bits(afe->regmap, ASYS_TOP_CON, ASYS_TOP_CON_ASYS_TIMING_ON, 0); regmap_update_bits(afe->regmap, AFE_DAC_CON0, AFE_DAC_CON0_AFE_ON, 0); mt2701_afe_disable_audsys(afe); return 0; }
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt2701/mt2701-afe-pcm.c
static void mt2701_afe_i2s_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai); struct mt2701_afe_private *afe_priv = afe->platform_priv; int i2s_num = mt2701_dai_num_to_i2s(afe, dai->id); struct mt2...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt2701/mt2701-afe-pcm.c
static int mt2701_afe_i2s_prepare(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai); struct mt2701_afe_private *afe_priv = afe->platform_priv; int ret, i2s_num = mt2701_dai_num_to_i2s(afe, dai->id); struct mt...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt2701/mt2701-afe-pcm.c
static int mt2701_btmrg_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai); struct mt2701_afe_private *afe_priv = afe->platform_priv; int ret; ret = mt2701_enable_btmrg_clk(afe); if (ret) return ...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt2701/mt2701-afe-pcm.c
static void mt2701_btmrg_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai); struct mt2701_afe_private *afe_priv = afe->platform_priv; if (!afe_priv->mrg_enable[!substream->stream]) { regmap_update...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt2701/mt2701-afe-pcm.c
static int mt2701_dlm_fe_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) { struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai); int channels = params_channels(params); regmap_updat...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt2701/mt2701-afe-pcm.c
static int mt2701_afe_pcm_probe(struct snd_soc_component *component) { struct mtk_base_afe *afe = snd_soc_component_get_drvdata(component); snd_soc_component_init_regmap(component, afe->regmap); return 0; }
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt6797/mt6797-afe-pcm.c
static int mt6797_afe_runtime_resume(struct device *dev) { struct mtk_base_afe *afe = dev_get_drvdata(dev); int ret; ret = mt6797_afe_enable_clock(afe); if (ret) return ret; regmap_write(afe->regmap, AFE_IRQ_MCU_EN, AFE_IRQ_MCU_EN_MASK_SFT); /* force all memif use normal mode */ regmap_update_bits(...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt6797/mt6797-dai-adda.c
static unsigned int adda_ul_rate_transform(struct mtk_base_afe *afe, unsigned int rate) { switch (rate) { case 8000: return MTK_AFE_ADDA_UL_RATE_8K; case 16000: return MTK_AFE_ADDA_UL_RATE_16K; case 32000: return MTK_AFE_ADDA_UL_RATE_32K; case 48000: ...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt6797/mt6797-dai-hostless.c
static int mtk_dai_hostless_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai); return snd_soc_set_runtime_hwparams(substream, afe->mtk_afe_hardware); }
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt6797/mt6797-mt6351.c
static int mt6797_mt6351_dev_probe(struct platform_device *pdev) { struct snd_soc_card *card = &mt6797_mt6351_card; struct device_node *platform_node, *codec_node; struct snd_soc_dai_link *dai_link; int ret, i; card->dev = &pdev->dev; platform_node = of_parse_phandle(pdev->dev.of_node, "mediatek,platform...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8173/mt8173-afe-pcm.c
static void mt8173_afe_set_i2s_enable(struct mtk_base_afe *afe, bool enable) { unsigned int val; regmap_read(afe->regmap, AFE_I2S_CON2, &val); if (!!(val & AFE_I2S_CON2_EN) == enable) return; regmap_update_bits(afe->regmap, AFE_I2S_CON2, 0x1, enable); /* output */ regmap_update_bits(afe->regmap, AFE_...
[ 1, 0 ]
Linux Kernel
sound/soc/mediatek/mt8173/mt8173-afe-pcm.c
static void mt8173_afe_dais_disable_clks(struct mtk_base_afe *afe, struct clk *m_ck, struct clk *b_ck) { clk_disable_unprepare(m_ck); clk_disable_unprepare(b_ck); }
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8173/mt8173-afe-pcm.c
static int mt8173_afe_init_audio_clk(struct mtk_base_afe *afe) { size_t i; struct mt8173_afe_private *afe_priv = afe->platform_priv; for (i = 0; i < ARRAY_SIZE(aud_clks); i++) { afe_priv->clocks[i] = devm_clk_get(afe->dev, aud_clks[i]); if (IS_ERR(afe_priv->clocks[i])) { dev_err(afe->dev, "%s devm_...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8173/mt8173-max98090.c
static int mt8173_max98090_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) { struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); return snd_soc_dai_set_sysclk(codec_da...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8173/mt8173-max98090.c
static int mt8173_max98090_dev_probe(struct platform_device *pdev) { struct snd_soc_card *card = &mt8173_max98090_card; struct device_node *codec_node, *platform_node; struct snd_soc_dai_link *dai_link; int ret, i; platform_node = of_parse_phandle(pdev->dev.of_node, "mediatek,platform", 0); if (!platform_...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8173/mt8173-rt5650-rt5514.c
static int mt8173_rt5650_rt5514_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) { struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); struct snd_soc_dai *codec_dai; int i, ret; for_each_rtd_codec_dais(rtd, i, codec_dai) ...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8173/mt8173-rt5650.c
static int mt8173_rt5650_init(struct snd_soc_pcm_runtime *runtime) { struct snd_soc_card *card = runtime->card; struct snd_soc_component *component = asoc_rtd_to_codec(runtime, 0)->component; const char *codec_capture_dai = asoc_rtd_to_codec(runtime, 1)->name; int ret; rt5645_sel_asrc_clk_src(component...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8173/mt8173-rt5650.c
static int mt8173_rt5650_hdmi_init(struct snd_soc_pcm_runtime *rtd) { int ret; ret = snd_soc_card_jack_new(rtd->card, "HDMI Jack", SND_JACK_LINEOUT, &mt8173_rt5650_hdmi_jack); if (ret) return ret; return snd_soc_component_set_jack(asoc_rtd_to_codec(rtd, 0)->component, ...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8183/mt8183-afe-clk.c
int mt8183_afe_disable_clock(struct mtk_base_afe *afe) { struct mt8183_afe_private *afe_priv = afe->platform_priv; clk_disable_unprepare(afe_priv->clk[CLK_I2S4_BCLK_SW]); clk_disable_unprepare(afe_priv->clk[CLK_I2S3_BCLK_SW]); clk_disable_unprepare(afe_priv->clk[CLK_I2S2_BCLK_SW]); clk_disable_unprepare(afe...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8183/mt8183-afe-clk.c
int mt8183_get_apll_by_rate(struct mtk_base_afe *afe, int rate) { return ((rate % 8000) == 0) ? MT8183_APLL2 : MT8183_APLL1; }
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8183/mt8183-afe-clk.c
int mt8183_get_apll_by_name(struct mtk_base_afe *afe, const char *name) { if (strcmp(name, APLL1_W_NAME) == 0) return MT8183_APLL1; else return MT8183_APLL2; }
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8183/mt8183-afe-clk.c
void mt8183_mck_disable(struct mtk_base_afe *afe, int mck_id) { struct mt8183_afe_private *afe_priv = afe->platform_priv; int m_sel_id = mck_div[mck_id].m_sel_id; int div_clk_id = mck_div[mck_id].div_clk_id; if (mck_id == MT8183_I2S5_MCK) return; clk_disable_unprepare(afe_priv->clk[div_clk_id]); if (m...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8183/mt8183-afe-pcm.c
static int mt8183_afe_runtime_resume(struct device *dev) { struct mtk_base_afe *afe = dev_get_drvdata(dev); struct mt8183_afe_private *afe_priv = afe->platform_priv; int ret; ret = mt8183_afe_enable_clock(afe); if (ret) return ret; if (!afe->regmap || afe_priv->pm_runtime_bypass_reg_ctl) goto skip...
[ 1, 0 ]
Linux Kernel
sound/soc/mediatek/mt8183/mt8183-afe-pcm.c
static int mt8183_afe_component_probe(struct snd_soc_component *component) { return mtk_afe_add_sub_dai_control(component); }
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c
static int mt8183_da7219_i2s_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) { struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); struct snd_soc_dai *codec_dai; unsigned int rate = params_rate(params); unsigned int mclk_fs...
[ 1, 0 ]
Linux Kernel
sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c
static int mt8183_da7219_max98357_hdmi_init(struct snd_soc_pcm_runtime *rtd) { struct mt8183_da7219_max98357_priv *priv = snd_soc_card_get_drvdata(rtd->card); int ret; ret = snd_soc_card_jack_new(rtd->card, "HDMI Jack", SND_JACK_LINEOUT, &priv->hdmi_jack); if (ret) retu...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c
static int mt8183_da7219_init(struct snd_soc_pcm_runtime *rtd) { struct snd_soc_component *cmpnt_afe = snd_soc_rtdcom_lookup(rtd, AFE_PCM_NAME); struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt_afe); int ret; ret = mt8183_dai_i2s_set_share(afe, "I2S2", "I2S3"); if (ret) { dev_err(rtd...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c
static int mt8183_da7219_max98357_headset_init(struct snd_soc_component *component) { int ret; struct mt8183_da7219_max98357_priv *priv = snd_soc_card_get_drvdata(component->card); ret = snd_soc_card_jack_new(component->card, "Headset Jack", SND_JACK_HEADSET | SND_JACK_BTN_0 |...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8183/mt8183-dai-adda.c
static int mtk_adda_ul_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event) { struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm); struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); struct mt8183_afe_private *afe_priv = afe->pla...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8183/mt8183-dai-adda.c
static int mt8183_adda_dmic_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); struct mt8183_afe_private *afe_priv = afe-...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8183/mt8183-dai-adda.c
int mt8183_dai_adda_register(struct mtk_base_afe *afe) { struct mtk_base_afe_dai *dai; dai = devm_kzalloc(afe->dev, sizeof(*dai), GFP_KERNEL); if (!dai) return -ENOMEM; list_add(&dai->list, &afe->sub_dais); dai->dai_drivers = mtk_dai_adda_driver; dai->num_dai_drivers = ARRAY_SIZE(mtk_dai_adda_driver...
[ 1, 0 ]
Linux Kernel
sound/soc/mediatek/mt8183/mt8183-dai-i2s.c
static int mt8183_i2s_hd_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); struct mtk_afe_i2s_priv *i2s_priv; i2s_priv =...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8183/mt8183-dai-i2s.c
static int mtk_apll_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event) { struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm); struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); dev_info(cmpnt->dev, "%s(), name %s, event 0x%x\n"...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8183/mt8183-dai-i2s.c
static int mtk_mclk_en_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event) { struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm); struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); struct mtk_afe_i2s_priv *i2s_priv; dev_inf...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8183/mt8183-dai-i2s.c
static int mtk_afe_mclk_apll_connect(struct snd_soc_dapm_widget *source, struct snd_soc_dapm_widget *sink) { struct snd_soc_dapm_widget *w = sink; struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm); struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmp...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8183/mt8183-dai-tdm.c
static unsigned int get_tdm_wlen(snd_pcm_format_t format) { return snd_pcm_format_physical_width(format) <= 16 ? TDM_WLEN_16_BIT : TDM_WLEN_32_BIT; }
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8183/mt8183-dai-tdm.c
static int mtk_tdm_mck_en_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event) { struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm); struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); struct mt8183_afe_private *afe_priv = a...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8183/mt8183-dai-tdm.c
static int mtk_dai_tdm_set_sysclk(struct snd_soc_dai *dai, int clk_id, unsigned int freq, int dir) { struct mtk_base_afe *afe = dev_get_drvdata(dai->dev); struct mt8183_afe_private *afe_priv = afe->platform_priv; struct mtk_afe_tdm_priv *tdm_priv = afe_priv->dai_priv[dai->id]; ...
[ 1, 0 ]
Linux Kernel
sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c
static int mt8183_mt6358_rt1015_i2s_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) { struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); unsigned int rate = params_rate(params); unsigned int mclk_fs_ratio = 128; unsigned int m...
[ 1, 0 ]
Linux Kernel
sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c
static int mt8183_i2s_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, struct snd_pcm_hw_params *params) { dev_dbg(rtd->dev, "%s(), fix format to S32_LE\n", __func__); snd_mask_reset_range(hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT), 0, (__force uns...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c
static int mt8183_rt1015_i2s_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, struct snd_pcm_hw_params *params) { dev_dbg(rtd->dev, "%s(), fix format to S24_LE\n", __func__); snd_mask_reset_range(hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT), 0, ...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c
static int mt8183_mt6358_tdm_startup(struct snd_pcm_substream *substream) { struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); struct mt8183_mt6358_ts3a227_max98357_priv *priv = snd_soc_card_get_drvdata(rtd->card); int ret; if (IS_ERR(priv->pin_states[PIN_TDM_OUT_ON])) return PTR_ER...
[ 1, 0 ]
Linux Kernel
sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c
static void mt8183_mt6358_tdm_shutdown(struct snd_pcm_substream *substream) { struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); struct mt8183_mt6358_ts3a227_max98357_priv *priv = snd_soc_card_get_drvdata(rtd->card); int ret; if (IS_ERR(priv->pin_states[PIN_TDM_OUT_OFF])) return; ...
[ 1, 0 ]