Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
⌀
Function
large_stringlengths
11
3.45k
Label
list
Linux Kernel
sound/soc/mediatek/mt8186/mt8186-afe-clk.c
void mt8186_afe_disable_clock(struct mtk_base_afe *afe) { struct mt8186_afe_private *afe_priv = afe->platform_priv; clk_disable_unprepare(afe_priv->clk[CLK_AFE]); mt8186_set_audio_int_bus_parent(afe, CLK_CLK26M); clk_disable_unprepare(afe_priv->clk[CLK_MUX_AUDIOINTBUS]); clk_disable_unprepare(afe_priv->clk[...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8186/mt8186-afe-clk.c
int mt8186_afe_suspend_clock(struct mtk_base_afe *afe) { struct mt8186_afe_private *afe_priv = afe->platform_priv; int ret; ret = clk_prepare_enable(afe_priv->clk[CLK_MUX_AUDIOINTBUS]); if (ret) { dev_info(afe->dev, "%s clk_prepare_enable %s fail %d\n", __func__, aud_clks[CLK_MUX_AUDIOINTBUS],...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8186/mt8186-afe-clk.c
int mt8186_apll1_enable(struct mtk_base_afe *afe) { struct mt8186_afe_private *afe_priv = afe->platform_priv; int ret; apll1_mux_setting(afe, true); ret = clk_prepare_enable(afe_priv->clk[CLK_APLL22M]); if (ret) { dev_err(afe->dev, "%s clk_prepare_enable %s fail %d\n", __func__, aud_clks[CLK...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8186/mt8186-afe-clk.c
int mt8186_apll2_enable(struct mtk_base_afe *afe) { struct mt8186_afe_private *afe_priv = afe->platform_priv; int ret; apll2_mux_setting(afe, true); ret = clk_prepare_enable(afe_priv->clk[CLK_APLL24M]); if (ret) { dev_err(afe->dev, "%s clk_prepare_enable %s fail %d\n", __func__, aud_clks[CLK...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8186/mt8186-afe-clk.c
void mt8186_deinit_clock(void *priv) { struct mtk_base_afe *afe = priv; mt8186_audsys_clk_unregister(afe); }
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8186/mt8186-afe-control.c
unsigned int mt8186_general_rate_transform(struct device *dev, unsigned int rate) { switch (rate) { case 8000: return MTK_AFE_RATE_8K; case 11025: return MTK_AFE_RATE_11K; case 12000: return MTK_AFE_RATE_12K; case 16000: return MTK_AFE_RATE_16K; ca...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8186/mt8186-afe-control.c
static unsigned int tdm_rate_transform(struct device *dev, unsigned int rate) { switch (rate) { case 8000: return MTK_AFE_TDM_RATE_8K; case 11025: return MTK_AFE_TDM_RATE_11K; case 12000: return MTK_AFE_TDM_RATE_12K; case 16000: return MTK_AFE_TDM_RATE_16K; case 22050: return MTK_AFE_TD...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8186/mt8186-afe-gpio.c
int mt8186_afe_gpio_init(struct device *dev) { int i, j, ret; aud_pinctrl = devm_pinctrl_get(dev); if (IS_ERR(aud_pinctrl)) { ret = PTR_ERR(aud_pinctrl); dev_err(dev, "%s(), ret %d, cannot get aud_pinctrl!\n", __func__, ret); return ret; } for (i = 0; i < ARRAY_SIZE(aud_gpios); i++) { aud_gp...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8186/mt8186-afe-gpio.c
static int mt8186_afe_gpio_adda_dl(struct device *dev, bool enable) { int ret; if (enable) { ret = mt8186_afe_gpio_select(dev, MT8186_AFE_GPIO_CLK_MOSI_ON); if (ret) { dev_err(dev, "%s(), MOSI CLK ON select fail!\n", __func__); return ret; } ret = mt8186_afe_gpio_select(dev, MT8186_AF...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8186/mt8186-afe-pcm.c
static int mt8186_fe_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct snd_soc_pcm_runtime *rtd = substream->private_data; struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai); struct snd_pcm_runtime *runtime = substream->runtime; int id = asoc_rtd_to...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8186/mt8186-afe-pcm.c
static int mt8186_memif_fs(struct snd_pcm_substream *substream, unsigned int rate) { struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_component *component = snd_soc_rtdcom_lookup(rtd, AFE_PCM_NAME); struct mtk_base_afe *afe = snd_soc_component_get_drvdata...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8186/mt8186-afe-pcm.c
static int mt8186_irq_fs(struct snd_pcm_substream *substream, unsigned int rate) { struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_component *component = snd_soc_rtdcom_lookup(rtd, AFE_PCM_NAME); struct mtk_base_afe *afe = snd_soc_component_get_drvdata(com...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8186/mt8186-afe-pcm.c
static int mt8186_fe_prepare(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_pcm_runtime *const runtime = substream->runtime; struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai); int id = asoc_...
[ 1, 0 ]
Linux Kernel
sound/soc/mediatek/mt8186/mt8186-afe-pcm.c
static int mt8186_irq_cnt2_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 mt8186_afe_private *afe_priv = afe->p...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8186/mt8186-afe-pcm.c
static int mt8186_irq_cnt2_set(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 mt8186_afe_private *afe_priv = afe->p...
[ 1, 0 ]
Linux Kernel
sound/soc/mediatek/mt8186/mt8186-afe-pcm.c
static int mt8186_record_xrun_assert_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 mt8186_afe_privat...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8186/mt8186-afe-pcm.c
static irqreturn_t mt8186_afe_irq_handler(int irq_id, void *dev) { struct mtk_base_afe *afe = dev; struct mtk_base_afe_irq *irq; unsigned int status; unsigned int status_mcu; unsigned int mcu_en; int ret; int i; ret = regmap_read(afe->regmap, AFE_IRQ_MCU_EN, &mcu_en); if (ret) { dev_err(afe->dev,...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8186/mt8186-afe-pcm.c
static int mt8186_afe_runtime_suspend(struct device *dev) { struct mtk_base_afe *afe = dev_get_drvdata(dev); struct mt8186_afe_private *afe_priv = afe->platform_priv; unsigned int value = 0; int ret; if (!afe->regmap || afe_priv->pm_runtime_bypass_reg_ctl) goto skip_regmap; regmap_update_bits(afe->reg...
[ 1, 0 ]
Linux Kernel
sound/soc/mediatek/mt8186/mt8186-afe-pcm.c
static int mt8186_afe_runtime_resume(struct device *dev) { struct mtk_base_afe *afe = dev_get_drvdata(dev); struct mt8186_afe_private *afe_priv = afe->platform_priv; int ret; ret = mt8186_afe_enable_clock(afe); if (ret) return ret; ret = mt8186_afe_enable_cgs(afe); if (ret) return ret; if (!a...
[ 1, 0 ]
Linux Kernel
sound/soc/mediatek/mt8186/mt8186-dai-adda.c
static int mtk_adda_dl_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_dbg(afe->dev, "%s(), name %s, event 0x%x\...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8186/mt8186-dai-adda.c
static int mt8186_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 mt8186_afe_private *afe_priv = afe-...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8186/mt8186-dai-adda.c
int mt8186_dai_adda_register(struct mtk_base_afe *afe) { struct mtk_base_afe_dai *dai; struct mt8186_afe_private *afe_priv = afe->platform_priv; int ret; dai = devm_kzalloc(afe->dev, sizeof(*dai), GFP_KERNEL); if (!dai) return -ENOMEM; list_add(&dai->list, &afe->sub_dais); dai->dai_drivers = mtk_da...
[ 1, 0 ]
Linux Kernel
sound/soc/mediatek/mt8186/mt8186-dai-hw-gain.c
static int mtk_dai_gain_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); unsigned int rate = params_rate(params); unsigned int rat...
[ 1, 0 ]
Linux Kernel
sound/soc/mediatek/mt8186/mt8186-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_dbg(cmpnt->dev, "%s(), name %s, event 0x%x\n",...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8186/mt8186-dai-i2s.c
static int mtk_afe_i2s_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(cmpnt...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8186/mt8186-dai-pcm.c
static int mtk_pcm_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); dev_dbg(afe->dev, "%s(), name %s, event 0x%x\n...
[ 1, 0 ]
Linux Kernel
sound/soc/mediatek/mt8186/mt8186-dai-pcm.c
static int mtk_dai_pcm_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) { struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai); struct mt8186_afe_private *afe_priv = afe->platform_priv; struct mtk_afe_pcm_priv *pcm_priv = afe_priv->dai_priv[dai->id]; switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) { case SND_...
[ 1, 0 ]
Linux Kernel
sound/soc/mediatek/mt8186/mt8186-dai-src.c
static int mtk_afe_src_en_connect(struct snd_soc_dapm_widget *source, struct snd_soc_dapm_widget *sink) { struct snd_soc_dapm_widget *w = source; struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm); struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt)...
[ 1, 0 ]
Linux Kernel
sound/soc/mediatek/mt8186/mt8186-dai-src.c
static int mtk_dai_src_hw_free(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai); struct mt8186_afe_private *afe_priv = afe->platform_priv; int id = dai->id; struct mtk_afe_src_priv *src_priv = afe_priv->dai_pr...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8186/mt8186-dai-tdm.c
static unsigned int get_tdm_ch_fixup(unsigned int channels) { if (channels > 4) return 8; else if (channels > 2) return 4; return 2; }
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8186/mt8186-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 mt8186_afe_private *afe_priv = a...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8186/mt8186-dai-tdm.c
static int mt8186_tdm_hd_set(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 mt8186_afe_private *afe_priv = afe->platf...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8186/mt8186-dai-tdm.c
static int mtk_dai_tdm_cal_mclk(struct mtk_base_afe *afe, struct mtk_afe_tdm_priv *tdm_priv, int freq) { int apll; int apll_rate; apll = mt8186_get_apll_by_rate(afe, freq); apll_rate = mt8186_get_apll_rate(afe, apll); if (!freq || freq > apll_rate) { dev_err(afe->dev, "%s...
[ 1, 0 ]
Linux Kernel
sound/soc/mediatek/mt8186/mt8186-dai-tdm.c
static struct mtk_afe_tdm_priv *init_tdm_priv_data(struct mtk_base_afe *afe) { struct mtk_afe_tdm_priv *tdm_priv; tdm_priv = devm_kzalloc(afe->dev, sizeof(struct mtk_afe_tdm_priv), GFP_KERNEL); if (!tdm_priv) return NULL; tdm_priv->mclk_multiple = 512; tdm_priv->mclk_id = MT8186_TDM_MCK; tdm_pr...
[ 1, 0 ]
Linux Kernel
sound/soc/mediatek/mt8186/mt8186-dai-tdm.c
int mt8186_dai_tdm_register(struct mtk_base_afe *afe) { struct mt8186_afe_private *afe_priv = afe->platform_priv; struct mtk_afe_tdm_priv *tdm_priv; 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); ...
[ 1, 0 ]
Linux Kernel
sound/soc/mediatek/mt8186/mt8186-misc-control.c
static int mt8186_sgen_rate_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 mt8186_afe_private *afe_priv = afe-...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8186/mt8186-misc-control.c
static int mt8186_sgen_amplitude_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 mt8186_afe_private *afe_p...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8186/mt8186-mt6366-da7219-max98357.c
static int mt8186_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); struct mtk_soc_card_data *soc_card_data = snd_soc_card_get_drvdata(rtd->card); struct mt8186...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8186/mt8186-mt6366-da7219-max98357.c
static int mt8186_sof_dai_link_fixup(struct snd_soc_pcm_runtime *rtd, struct snd_pcm_hw_params *params) { int ret; ret = mtk_sof_dai_link_fixup(rtd, params); if (!strcmp(rtd->dai_link->name, "I2S0") || !strcmp(rtd->dai_link->name, "I2S1") || !strcmp(rtd->dai_link...
[ 1, 0 ]
Linux Kernel
sound/soc/mediatek/mt8186/mt8186-mt6366-da7219-max98357.c
static int mt8186_mt6366_da7219_max98357_playback_startup( struct snd_pcm_substream *substream) { static const unsigned int rates[] = {48000}; static const unsigned int channels[] = {2}; static const struct snd_pcm_hw_constraint_list constraints_rates = { .count = ARRAY_SIZE(rates), .list = rates...
[ 1, 0 ]
Linux Kernel
sound/soc/mediatek/mt8186/mt8186-mt6366-da7219-max98357.c
static int mt8186_mt6366_da7219_max98357_capture_startup( struct snd_pcm_substream *substream) { static const unsigned int rates[] = {48000}; static const unsigned int channels[] = {1, 2}; static const struct snd_pcm_hw_constraint_list constraints_rates = { .count = ARRAY_SIZE(rates), .list = rat...
[ 1, 0 ]
Linux Kernel
sound/soc/mediatek/mt8186/mt8186-mt6366-rt1019-rt5682s.c
static int mt8186_rt5682s_i2s_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) { struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_card *card = rtd->card; struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); struc...
[ 1, 0 ]
Linux Kernel
sound/soc/mediatek/mt8186/mt8186-mt6366-rt1019-rt5682s.c
static int mt8186_i2s_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, struct snd_pcm_hw_params *params) { return mt8186_hw_params_fixup(rtd, params, SNDRV_PCM_FORMAT_S24_LE); }
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8186/mt8186-mt6366-rt1019-rt5682s.c
static int mt8186_it6505_i2s_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, struct snd_pcm_hw_params *params) { return mt8186_hw_params_fixup(rtd, params, SNDRV_PCM_FORMAT_S32_LE); }
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8186/mt8186-mt6366-rt1019-rt5682s.c
static int mt8186_sof_dai_link_fixup(struct snd_soc_pcm_runtime *rtd, struct snd_pcm_hw_params *params) { int ret; ret = mtk_sof_dai_link_fixup(rtd, params); if (!strcmp(rtd->dai_link->name, "I2S0") || !strcmp(rtd->dai_link->name, "I2S1") || !strcmp(rtd->dai_link...
[ 1, 0 ]
Linux Kernel
sound/soc/mediatek/mt8186/mt8186-mt6366-rt1019-rt5682s.c
static int mt8186_mt6366_rt1019_rt5682s_capture_startup( struct snd_pcm_substream *substream) { static const unsigned int rates[] = {48000}; static const unsigned int channels[] = {1, 2}; static const struct snd_pcm_hw_constraint_list constraints_rates = { .count = ARRAY_SIZE(rates), .list = rate...
[ 1, 0 ]
Linux Kernel
sound/soc/mediatek/mt8192/mt8192-afe-clk.c
void mt8192_apll2_disable(struct mtk_base_afe *afe) { struct mt8192_afe_private *afe_priv = afe->platform_priv; regmap_update_bits(afe->regmap, AFE_HD_ENGEN_ENABLE, AFE_24M_ON_MASK_SFT, 0x0 << AFE_24M_ON_SFT); regmap_update_bits(afe->regmap, AFE_APLL2_TUNER_CFG, 0x1, 0x0); clk_disable_u...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8192/mt8192-afe-clk.c
int mt8192_get_apll_rate(struct mtk_base_afe *afe, int apll) { return (apll == MT8192_APLL1) ? 180633600 : 196608000; }
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8192/mt8192-afe-clk.c
int mt8192_get_apll_by_rate(struct mtk_base_afe *afe, int rate) { return ((rate % 8000) == 0) ? MT8192_APLL2 : MT8192_APLL1; }
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8192/mt8192-afe-clk.c
int mt8192_get_apll_by_name(struct mtk_base_afe *afe, const char *name) { if (strcmp(name, APLL1_W_NAME) == 0) return MT8192_APLL1; else return MT8192_APLL2; }
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8192/mt8192-afe-clk.c
int mt8192_mck_enable(struct mtk_base_afe *afe, int mck_id, int rate) { struct mt8192_afe_private *afe_priv = afe->platform_priv; int apll = mt8192_get_apll_by_rate(afe, rate); int apll_clk_id = apll == MT8192_APLL1 ? CLK_TOP_MUX_AUD_1 : CLK_TOP_MUX_AUD_2; int m_sel_id = mck_div[mck_id].m_sel_id; int di...
[ 1, 0 ]
Linux Kernel
sound/soc/mediatek/mt8192/mt8192-afe-clk.c
int mt8192_init_clock(struct mtk_base_afe *afe) { struct mt8192_afe_private *afe_priv = afe->platform_priv; struct device_node *of_node = afe->dev->of_node; int i = 0; afe_priv->clk = devm_kcalloc(afe->dev, CLK_NUM, sizeof(*afe_priv->clk), GFP_KERNEL); if (!afe_priv->clk) return -ENOMEM; for (i...
[ 1, 0 ]
Linux Kernel
sound/soc/mediatek/mt8192/mt8192-afe-control.c
unsigned int mt8192_rate_transform(struct device *dev, unsigned int rate, int aud_blk) { switch (aud_blk) { case MT8192_MEMIF_DAI: case MT8192_MEMIF_MOD_DAI: return dai_memif_rate_transform(dev, rate); case MT8192_DAI_PCM_1: case MT8192_DAI_PCM_2: return pcm_rate_tr...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8192/mt8192-afe-gpio.c
static int mt8192_afe_gpio_adda_ul(struct device *dev, bool enable) { if (enable) { return mt8192_afe_gpio_select(dev, MT8192_AFE_GPIO_DAT_MISO_ON); } else { return mt8192_afe_gpio_select(dev, MT8192_AFE_GPIO_DAT_MISO_OFF); } }
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8192/mt8192-afe-pcm.c
static int mt8192_irq_fs(struct snd_pcm_substream *substream, unsigned int rate) { struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); struct snd_soc_component *component = snd_soc_rtdcom_lookup(rtd, AFE_PCM_NAME); struct mtk_base_afe *afe = snd_soc_component_get_dr...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8192/mt8192-afe-pcm.c
static int mt8192_dai_memif_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 = mt8192_memif_dai_driver; dai->num_dai_drivers = ARRAY_SIZE(mt8192_...
[ 1, 0 ]
Linux Kernel
sound/soc/mediatek/mt8192/mt8192-dai-adda.c
static int stf_positive_gain_set(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 mt8192_afe_private *afe_priv = af...
[ 1, 0 ]
Linux Kernel
sound/soc/mediatek/mt8192/mt8192-dai-i2s.c
static unsigned int get_i2s_wlen(snd_pcm_format_t format) { return snd_pcm_format_physical_width(format) <= 16 ? I2S_WLEN_16_BIT : I2S_WLEN_32_BIT; }
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8192/mt8192-dai-i2s.c
static int get_i2s_id_by_name(struct mtk_base_afe *afe, const char *name) { if (strncmp(name, "I2S0", 4) == 0) return MT8192_DAI_I2S_0; else if (strncmp(name, "I2S1", 4) == 0) return MT8192_DAI_I2S_1; else if (strncmp(name, "I2S2", 4) == 0) return MT8192_DAI_I2S_2; else if (strncmp(name, "I2S3", 4)...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8192/mt8192-dai-i2s.c
static int mtk_i2s_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; i2s_priv ...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8192/mt8192-dai-i2s.c
static int mtk_afe_i2s_share_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(cm...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8192/mt8192-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/mt8192/mt8192-dai-pcm.c
int mt8192_dai_pcm_register(struct mtk_base_afe *afe) { struct mtk_base_afe_dai *dai; dev_info(afe->dev, "%s()\n", __func__); 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_pcm_driver; dai->num_dai...
[ 1, 0 ]
Linux Kernel
sound/soc/mediatek/mt8192/mt8192-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/mt8192/mt8192-dai-tdm.c
static unsigned int get_tdm_channel_bck(snd_pcm_format_t format) { return snd_pcm_format_physical_width(format) <= 16 ? TDM_CHANNEL_BCK_16 : TDM_CHANNEL_BCK_32; }
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8192/mt8192-dai-tdm.c
static unsigned int get_tdm_ch_fixup(unsigned int channels) { if (channels > 4) return 8; else if (channels > 2) return 4; else return 2; }
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8192/mt8192-dai-tdm.c
static unsigned int get_tdm_ch_per_sdata(unsigned int mode, unsigned int channels) { if (mode == TDM_OUT_DSP_A || mode == TDM_OUT_DSP_B) return get_tdm_ch_fixup(channels); else return 2; }
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8192/mt8192-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 mt8192_afe_private *afe_priv = a...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8192/mt8192-dai-tdm.c
int mt8192_dai_tdm_register(struct mtk_base_afe *afe) { struct mt8192_afe_private *afe_priv = afe->platform_priv; struct mtk_afe_tdm_priv *tdm_priv; struct mtk_base_afe_dai *dai; dev_info(afe->dev, "%s()\n", __func__); dai = devm_kzalloc(afe->dev, sizeof(*dai), GFP_KERNEL); if (!dai) return -ENOMEM; ...
[ 1, 0 ]
Linux Kernel
sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c
static int mt8192_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); struct snd_soc_card *card = rtd->card; struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); ...
[ 1, 0 ]
Linux Kernel
sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c
static int mt8192_rt5682x_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_card *card = rtd->card; struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0)...
[ 1, 0 ]
Linux Kernel
sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c
static int mt8192_mt6359_init(struct snd_soc_pcm_runtime *rtd) { struct snd_soc_component *cmpnt_afe = snd_soc_rtdcom_lookup(rtd, AFE_PCM_NAME); struct snd_soc_component *cmpnt_codec = asoc_rtd_to_codec(rtd, 0)->component; struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt_afe); struct mt8192_...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c
static int mt8192_mt6359_hdmi_init(struct snd_soc_pcm_runtime *rtd) { struct snd_soc_component *cmpnt_codec = asoc_rtd_to_codec(rtd, 0)->component; struct mt8192_mt6359_priv *priv = snd_soc_card_get_drvdata(rtd->card); int ret; ret = snd_soc_card_jack_new(rtd->card, "HDMI Jack", SND_JACK_LINEOUT, ...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c
static int mt8192_mt6359_rt5682_startup(struct snd_pcm_substream *substream) { static const unsigned int channels[] = {1, 2}; static const struct snd_pcm_hw_constraint_list constraints_channels = { .count = ARRAY_SIZE(channels), .list = channels, .mask = 0, }; static const unsigned int rates[...
[ 1, 0 ]
Linux Kernel
sound/soc/mediatek/mt8195/mt8195-afe-clk.c
static int mt8195_afe_init_apll_tuner(unsigned int id) { struct mt8195_afe_tuner_cfg *cfg = mt8195_afe_found_apll_tuner(id); if (!cfg) return -EINVAL; cfg->ref_cnt = 0; spin_lock_init(&cfg->ctrl_lock); return 0; }
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8195/mt8195-afe-clk.c
static int mt8195_afe_disable_apll_tuner(struct mtk_base_afe *afe, unsigned int id) { struct mt8195_afe_tuner_cfg *cfg = mt8195_afe_found_apll_tuner(id); unsigned long flags; int ret; if (!cfg) return -EINVAL; spin_lock_irqsave(&cfg->ctrl_lock, flags); cfg->r...
[ 1, 0 ]
Linux Kernel
sound/soc/mediatek/mt8195/mt8195-afe-clk.c
int mt8195_afe_get_default_mclk_source_by_rate(int rate) { return ((rate % 8000) == 0) ? MT8195_MCK_SEL_APLL1 : MT8195_MCK_SEL_APLL2; }
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8195/mt8195-afe-clk.c
void mt8195_afe_disable_clk(struct mtk_base_afe *afe, struct clk *clk) { if (clk) clk_disable_unprepare(clk); else dev_dbg(afe->dev, "NULL clk\n"); }
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8195/mt8195-afe-clk.c
void mt8195_afe_unprepare_clk(struct mtk_base_afe *afe, struct clk *clk) { if (clk) clk_unprepare(clk); else dev_dbg(afe->dev, "NULL clk\n"); }
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8195/mt8195-afe-clk.c
void mt8195_afe_disable_clk_atomic(struct mtk_base_afe *afe, struct clk *clk) { if (clk) clk_disable(clk); else dev_dbg(afe->dev, "NULL clk\n"); }
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8195/mt8195-afe-clk.c
static unsigned int get_top_cg_reg(unsigned int cg_type) { switch (cg_type) { case MT8195_TOP_CG_A1SYS_TIMING: case MT8195_TOP_CG_A2SYS_TIMING: case MT8195_TOP_CG_26M_TIMING: return ASYS_TOP_CON; default: return 0; } }
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8195/mt8195-afe-clk.c
static int mt8195_afe_enable_timing_sys(struct mtk_base_afe *afe) { struct mt8195_afe_private *afe_priv = afe->platform_priv; int i; static const unsigned int clk_array[] = { MT8195_CLK_AUD_A1SYS, MT8195_CLK_AUD_A2SYS, }; static const unsigned int cg_array[] = { MT8195_TOP_CG_A1SYS_TIMING, ...
[ 1, 0 ]
Linux Kernel
sound/soc/mediatek/mt8195/mt8195-afe-clk.c
int mt8195_afe_disable_main_clock(struct mtk_base_afe *afe) { mt8195_afe_disable_apll_tuner(afe, MT8195_AUD_PLL2); mt8195_afe_disable_apll_tuner(afe, MT8195_AUD_PLL1); mt8195_afe_disable_afe_on(afe); mt8195_afe_disable_timing_sys(afe); return 0; }
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8195/mt8195-afe-pcm.c
static int mt8195_memif_fs(struct snd_pcm_substream *substream, unsigned int rate) { struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_component *component = snd_soc_rtdcom_lookup(rtd, AFE_PCM_NAME); struct mtk_base_afe *afe = snd_soc_component_get_drvdata...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8195/mt8195-afe-pcm.c
static int mt8195_irq_fs(struct snd_pcm_substream *substream, unsigned int rate) { int fs = mt8195_memif_fs(substream, rate); switch (fs) { case MT8195_ETDM_IN1_NX_EN: fs = MT8195_ETDM_IN1_1X_EN; break; case MT8195_ETDM_IN2_NX_EN: fs = MT8195_ETDM_IN2_1X_EN; break; d...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8195/mt8195-afe-pcm.c
static int mt8195_afe_memif_is_ul(int id) { if (id >= MT8195_AFE_MEMIF_UL_START && id < MT8195_AFE_MEMIF_END) return 1; else return 0; }
[ 1, 0 ]
Linux Kernel
sound/soc/mediatek/mt8195/mt8195-afe-pcm.c
static int mt8195_afe_fe_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_pcm_runtime *runtime = substream->runtime; struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai); int id = as...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8195/mt8195-afe-pcm.c
static int mt8195_afe_fe_hw_free(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { return mtk_afe_fe_hw_free(substream, dai); }
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8195/mt8195-afe-pcm.c
static int mt8195_afe_fe_trigger(struct snd_pcm_substream *substream, int cmd, struct snd_soc_dai *dai) { int ret = 0; struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai); const struct mt8195_afe_channel_merge *cm = mt8195_afe_found_cm(dai); switch (cmd) { case SNDRV_PCM...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8195/mt8195-afe-pcm.c
static int mt8195_afe_fe_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) { return 0; }
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8195/mt8195-dai-adda.c
static int mtk_adda6_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 mt8195_afe_private *afe_priv = afe->p...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8195/mt8195-dai-etdm.c
static int get_etdm_fs_timing(unsigned int rate) { int i; for (i = 0; i < ARRAY_SIZE(mt8195_etdm_rates); i++) if (mt8195_etdm_rates[i].rate == rate) return mt8195_etdm_rates[i].reg_value; return -EINVAL; }
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8195/mt8195-dai-etdm.c
static int is_cowork_mode(struct snd_soc_dai *dai) { struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai); struct mt8195_afe_private *afe_priv = afe->platform_priv; struct mtk_dai_etdm_priv *etdm_data = afe_priv->dai_priv[dai->id]; return (etdm_data->cowork_slv_count > 0 || etdm_data->cowork_sour...
[ 1, 0 ]
Linux Kernel
sound/soc/mediatek/mt8195/mt8195-dai-etdm.c
static int get_etdm_cowork_master_id(struct snd_soc_dai *dai) { struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai); struct mt8195_afe_private *afe_priv = afe->platform_priv; struct mtk_dai_etdm_priv *etdm_data = afe_priv->dai_priv[dai->id]; int dai_id = etdm_data->cowork_source_id; if (dai_id == COWORK...
[ 1, 0 ]
Linux Kernel
sound/soc/mediatek/mt8195/mt8195-dai-etdm.c
static int mt8195_etdm_sync_mode_configure(struct mtk_base_afe *afe, int dai_id) { struct mt8195_afe_private *afe_priv = afe->platform_priv; struct mtk_dai_etdm_priv *etdm_data = afe_priv->dai_priv[dai_id]; unsigned int reg = 0; unsigned int mask; unsigned int val; ...
[ 1, 0 ]
Linux Kernel
sound/soc/mediatek/mt8195/mt8195-dai-etdm.c
static int mtk_dai_etdm_mclk_configure(struct mtk_base_afe *afe, int dai_id) { struct mt8195_afe_private *afe_priv = afe->platform_priv; struct mtk_dai_etdm_priv *etdm_data = afe_priv->dai_priv[dai_id]; int clk_id = mtk_dai_etdm_get_clk_id_by_dai_id(dai_id); int clkdiv_id = mtk_dai_etdm_get_clkdiv_id_by_dai_id(...
[ 1, 0 ]
Linux Kernel
sound/soc/mediatek/mt8195/mt8195-dai-etdm.c
static int mtk_dai_hdmitx_dptx_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai); struct mt8195_afe_private *afe_priv = afe->platform_priv; int cg_id = mtk_dai_etdm_get_cg_id_by_dai_id(dai->id); ...
[ 0, 0 ]
Linux Kernel
sound/soc/mediatek/mt8195/mt8195-dai-etdm.c
static int mtk_dai_hdmitx_dptx_set_sysclk(struct snd_soc_dai *dai, int clk_id, unsigned int freq, int dir) { struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai); struct mt8195_afe_private *afe_priv = afe->platform_priv; struct mtk_dai_etdm_priv *etdm_data = afe_priv-...
[ 1, 0 ]
Linux Kernel
sound/soc/mediatek/mt8195/mt8195-mt6359.c
static int mt8195_hdmitx_dptx_startup(struct snd_pcm_substream *substream) { static const unsigned int rates[] = {48000}; static const unsigned int channels[] = {2, 4, 6, 8}; static const struct snd_pcm_hw_constraint_list constraints_rates = { .count = ARRAY_SIZE(rates), .list = rates, .mask = ...
[ 1, 0 ]
Linux Kernel
sound/soc/mediatek/mt8195/mt8195-mt6359.c
static int mt8195_dptx_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) { struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); return snd_soc_dai_set_sysclk(cpu_dai, 0, params_rate(param...
[ 0, 0 ]