mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 22:26:55 +00:00
ASoC: mediatek: convert not to use asoc_xxx()
ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/877codh2qg.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
4c1a094692
commit
de9e70137f
24 changed files with 124 additions and 124 deletions
|
@ -37,10 +37,10 @@ static int mtk_regmap_write(struct regmap *map, int reg, unsigned int val)
|
|||
int mtk_afe_fe_startup(struct snd_pcm_substream *substream,
|
||||
struct snd_soc_dai *dai)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai);
|
||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
int memif_num = asoc_rtd_to_cpu(rtd, 0)->id;
|
||||
int memif_num = snd_soc_rtd_to_cpu(rtd, 0)->id;
|
||||
struct mtk_base_afe_memif *memif = &afe->memif[memif_num];
|
||||
const struct snd_pcm_hardware *mtk_afe_hardware = afe->mtk_afe_hardware;
|
||||
int ret;
|
||||
|
@ -98,9 +98,9 @@ EXPORT_SYMBOL_GPL(mtk_afe_fe_startup);
|
|||
void mtk_afe_fe_shutdown(struct snd_pcm_substream *substream,
|
||||
struct snd_soc_dai *dai)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai);
|
||||
struct mtk_base_afe_memif *memif = &afe->memif[asoc_rtd_to_cpu(rtd, 0)->id];
|
||||
struct mtk_base_afe_memif *memif = &afe->memif[snd_soc_rtd_to_cpu(rtd, 0)->id];
|
||||
int irq_id;
|
||||
|
||||
irq_id = memif->irq_usage;
|
||||
|
@ -120,9 +120,9 @@ int mtk_afe_fe_hw_params(struct snd_pcm_substream *substream,
|
|||
struct snd_pcm_hw_params *params,
|
||||
struct snd_soc_dai *dai)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai);
|
||||
int id = asoc_rtd_to_cpu(rtd, 0)->id;
|
||||
int id = snd_soc_rtd_to_cpu(rtd, 0)->id;
|
||||
struct mtk_base_afe_memif *memif = &afe->memif[id];
|
||||
int ret;
|
||||
unsigned int channels = params_channels(params);
|
||||
|
@ -196,10 +196,10 @@ EXPORT_SYMBOL_GPL(mtk_afe_fe_hw_free);
|
|||
int mtk_afe_fe_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 snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_pcm_runtime * const runtime = substream->runtime;
|
||||
struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai);
|
||||
int id = asoc_rtd_to_cpu(rtd, 0)->id;
|
||||
int id = snd_soc_rtd_to_cpu(rtd, 0)->id;
|
||||
struct mtk_base_afe_memif *memif = &afe->memif[id];
|
||||
struct mtk_base_afe_irq *irqs = &afe->irqs[memif->irq_usage];
|
||||
const struct mtk_base_irq_data *irq_data = irqs->irq_data;
|
||||
|
@ -263,9 +263,9 @@ EXPORT_SYMBOL_GPL(mtk_afe_fe_trigger);
|
|||
int mtk_afe_fe_prepare(struct snd_pcm_substream *substream,
|
||||
struct snd_soc_dai *dai)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai);
|
||||
int id = asoc_rtd_to_cpu(rtd, 0)->id;
|
||||
int id = snd_soc_rtd_to_cpu(rtd, 0)->id;
|
||||
int pbuf_size;
|
||||
|
||||
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
|
||||
|
@ -523,7 +523,7 @@ EXPORT_SYMBOL_GPL(mtk_memif_set_rate);
|
|||
int mtk_memif_set_rate_substream(struct snd_pcm_substream *substream,
|
||||
int id, unsigned int rate)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_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_drvdata(component);
|
||||
|
|
|
@ -80,9 +80,9 @@ EXPORT_SYMBOL_GPL(mtk_afe_add_sub_dai_control);
|
|||
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 snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct mtk_base_afe *afe = snd_soc_component_get_drvdata(component);
|
||||
struct mtk_base_afe_memif *memif = &afe->memif[asoc_rtd_to_cpu(rtd, 0)->id];
|
||||
struct mtk_base_afe_memif *memif = &afe->memif[snd_soc_rtd_to_cpu(rtd, 0)->id];
|
||||
const struct mtk_base_memif_data *memif_data = memif->data;
|
||||
struct regmap *regmap = afe->regmap;
|
||||
struct device *dev = afe->dev;
|
||||
|
|
|
@ -494,10 +494,10 @@ static int mt2701_dlm_fe_trigger(struct snd_pcm_substream *substream,
|
|||
static int mt2701_memif_fs(struct snd_pcm_substream *substream,
|
||||
unsigned int rate)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
int fs;
|
||||
|
||||
if (asoc_rtd_to_cpu(rtd, 0)->id != MT2701_MEMIF_ULBT)
|
||||
if (snd_soc_rtd_to_cpu(rtd, 0)->id != MT2701_MEMIF_ULBT)
|
||||
fs = mt2701_afe_i2s_fs(rate);
|
||||
else
|
||||
fs = (rate == 16000 ? 1 : 0);
|
||||
|
|
|
@ -127,9 +127,9 @@ static const struct snd_soc_ops mt2701_cs42448_48k_fe_ops = {
|
|||
static int mt2701_cs42448_be_ops_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 *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
|
||||
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
|
||||
struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
|
||||
unsigned int mclk_rate;
|
||||
unsigned int rate = params_rate(params);
|
||||
unsigned int div_mclk_over_bck = rate > 192000 ? 2 : 4;
|
||||
|
|
|
@ -24,9 +24,9 @@ static const struct snd_kcontrol_new mt2701_wm8960_controls[] = {
|
|||
static int mt2701_wm8960_be_ops_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);
|
||||
struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
|
||||
struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
|
||||
unsigned int mclk_rate;
|
||||
unsigned int rate = params_rate(params);
|
||||
unsigned int div_mclk_over_bck = rate > 192000 ? 2 : 4;
|
||||
|
|
|
@ -139,18 +139,18 @@ static const struct snd_pcm_hardware mt6797_afe_hardware = {
|
|||
static int mt6797_memif_fs(struct snd_pcm_substream *substream,
|
||||
unsigned int rate)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_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_drvdata(component);
|
||||
int id = asoc_rtd_to_cpu(rtd, 0)->id;
|
||||
int id = snd_soc_rtd_to_cpu(rtd, 0)->id;
|
||||
|
||||
return mt6797_rate_transform(afe->dev, rate, id);
|
||||
}
|
||||
|
||||
static int mt6797_irq_fs(struct snd_pcm_substream *substream, unsigned int rate)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_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_drvdata(component);
|
||||
|
|
|
@ -480,10 +480,10 @@ static int mt8173_afe_hdmi_trigger(struct snd_pcm_substream *substream, int cmd,
|
|||
static int mt8173_memif_fs(struct snd_pcm_substream *substream,
|
||||
unsigned int rate)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_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_drvdata(component);
|
||||
struct mtk_base_afe_memif *memif = &afe->memif[asoc_rtd_to_cpu(rtd, 0)->id];
|
||||
struct mtk_base_afe_memif *memif = &afe->memif[snd_soc_rtd_to_cpu(rtd, 0)->id];
|
||||
int fs;
|
||||
|
||||
if (memif->data->id == MT8173_AFE_MEMIF_DAI ||
|
||||
|
|
|
@ -52,8 +52,8 @@ static const struct snd_kcontrol_new mt8173_max98090_controls[] = {
|
|||
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);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
|
||||
|
||||
return snd_soc_dai_set_sysclk(codec_dai, 0, params_rate(params) * 256,
|
||||
SND_SOC_CLOCK_IN);
|
||||
|
@ -67,7 +67,7 @@ static int mt8173_max98090_init(struct snd_soc_pcm_runtime *runtime)
|
|||
{
|
||||
int ret;
|
||||
struct snd_soc_card *card = runtime->card;
|
||||
struct snd_soc_component *component = asoc_rtd_to_codec(runtime, 0)->component;
|
||||
struct snd_soc_component *component = snd_soc_rtd_to_codec(runtime, 0)->component;
|
||||
|
||||
/* enable jack detection */
|
||||
ret = snd_soc_card_jack_new_pins(card, "Headphone", SND_JACK_HEADSET,
|
||||
|
|
|
@ -54,7 +54,7 @@ static struct snd_soc_jack_pin mt8173_rt5650_rt5514_jack_pins[] = {
|
|||
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_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_dai *codec_dai;
|
||||
int i, ret;
|
||||
|
||||
|
@ -84,7 +84,7 @@ static struct snd_soc_jack mt8173_rt5650_rt5514_jack;
|
|||
static int mt8173_rt5650_rt5514_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;
|
||||
struct snd_soc_component *component = snd_soc_rtd_to_codec(runtime, 0)->component;
|
||||
int ret;
|
||||
|
||||
rt5645_sel_asrc_clk_src(component,
|
||||
|
|
|
@ -58,7 +58,7 @@ static struct snd_soc_jack_pin mt8173_rt5650_rt5676_jack_pins[] = {
|
|||
static int mt8173_rt5650_rt5676_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_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_dai *codec_dai;
|
||||
int i, ret;
|
||||
|
||||
|
@ -88,8 +88,8 @@ static struct snd_soc_jack mt8173_rt5650_rt5676_jack;
|
|||
static int mt8173_rt5650_rt5676_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;
|
||||
struct snd_soc_component *component_sub = asoc_rtd_to_codec(runtime, 1)->component;
|
||||
struct snd_soc_component *component = snd_soc_rtd_to_codec(runtime, 0)->component;
|
||||
struct snd_soc_component *component_sub = snd_soc_rtd_to_codec(runtime, 1)->component;
|
||||
int ret;
|
||||
|
||||
rt5645_sel_asrc_clk_src(component,
|
||||
|
|
|
@ -68,7 +68,7 @@ static struct snd_soc_jack_pin mt8173_rt5650_jack_pins[] = {
|
|||
static int mt8173_rt5650_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_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
unsigned int mclk_clock;
|
||||
struct snd_soc_dai *codec_dai;
|
||||
int i, ret;
|
||||
|
@ -114,8 +114,8 @@ static struct snd_soc_jack mt8173_rt5650_jack, mt8173_rt5650_hdmi_jack;
|
|||
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;
|
||||
struct snd_soc_component *component = snd_soc_rtd_to_codec(runtime, 0)->component;
|
||||
const char *codec_capture_dai = snd_soc_rtd_to_codec(runtime, 1)->name;
|
||||
int ret;
|
||||
|
||||
rt5645_sel_asrc_clk_src(component,
|
||||
|
@ -166,7 +166,7 @@ static int mt8173_rt5650_hdmi_init(struct snd_soc_pcm_runtime *rtd)
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
return snd_soc_component_set_jack(asoc_rtd_to_codec(rtd, 0)->component,
|
||||
return snd_soc_component_set_jack(snd_soc_rtd_to_codec(rtd, 0)->component,
|
||||
&mt8173_rt5650_hdmi_jack, NULL);
|
||||
}
|
||||
|
||||
|
|
|
@ -142,18 +142,18 @@ static const struct snd_pcm_hardware mt8183_afe_hardware = {
|
|||
static int mt8183_memif_fs(struct snd_pcm_substream *substream,
|
||||
unsigned int rate)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_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_drvdata(component);
|
||||
int id = asoc_rtd_to_cpu(rtd, 0)->id;
|
||||
int id = snd_soc_rtd_to_cpu(rtd, 0)->id;
|
||||
|
||||
return mt8183_rate_transform(afe->dev, rate, id);
|
||||
}
|
||||
|
||||
static int mt8183_irq_fs(struct snd_pcm_substream *substream, unsigned int rate)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_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_drvdata(component);
|
||||
|
|
|
@ -47,12 +47,12 @@ static struct snd_soc_jack_pin mt8183_da7219_max98357_jack_pins[] = {
|
|||
static int mt8183_mt6358_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_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
unsigned int rate = params_rate(params);
|
||||
unsigned int mclk_fs_ratio = 128;
|
||||
unsigned int mclk_fs = rate * mclk_fs_ratio;
|
||||
|
||||
return snd_soc_dai_set_sysclk(asoc_rtd_to_cpu(rtd, 0),
|
||||
return snd_soc_dai_set_sysclk(snd_soc_rtd_to_cpu(rtd, 0),
|
||||
0, mclk_fs, SND_SOC_CLOCK_OUT);
|
||||
}
|
||||
|
||||
|
@ -63,7 +63,7 @@ static const struct snd_soc_ops mt8183_mt6358_i2s_ops = {
|
|||
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_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_dai *codec_dai;
|
||||
unsigned int rate = params_rate(params);
|
||||
unsigned int mclk_fs_ratio = 256;
|
||||
|
@ -71,7 +71,7 @@ static int mt8183_da7219_i2s_hw_params(struct snd_pcm_substream *substream,
|
|||
unsigned int freq;
|
||||
int ret = 0, j;
|
||||
|
||||
ret = snd_soc_dai_set_sysclk(asoc_rtd_to_cpu(rtd, 0), 0,
|
||||
ret = snd_soc_dai_set_sysclk(snd_soc_rtd_to_cpu(rtd, 0), 0,
|
||||
mclk_fs, SND_SOC_CLOCK_OUT);
|
||||
if (ret < 0)
|
||||
dev_err(rtd->dev, "failed to set cpu dai sysclk\n");
|
||||
|
@ -104,7 +104,7 @@ static int mt8183_da7219_i2s_hw_params(struct snd_pcm_substream *substream,
|
|||
|
||||
static int mt8183_da7219_hw_free(struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_dai *codec_dai;
|
||||
int ret = 0, j;
|
||||
|
||||
|
@ -132,7 +132,7 @@ static int
|
|||
mt8183_da7219_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_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
unsigned int rate = params_rate(params);
|
||||
struct snd_soc_dai *codec_dai;
|
||||
int ret = 0, i;
|
||||
|
@ -383,7 +383,7 @@ static int mt8183_da7219_max98357_hdmi_init(struct snd_soc_pcm_runtime *rtd)
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
return snd_soc_component_set_jack(asoc_rtd_to_codec(rtd, 0)->component,
|
||||
return snd_soc_component_set_jack(snd_soc_rtd_to_codec(rtd, 0)->component,
|
||||
&priv->hdmi_jack, NULL);
|
||||
}
|
||||
|
||||
|
|
|
@ -43,12 +43,12 @@ struct mt8183_mt6358_ts3a227_max98357_priv {
|
|||
static int mt8183_mt6358_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_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
unsigned int rate = params_rate(params);
|
||||
unsigned int mclk_fs_ratio = 128;
|
||||
unsigned int mclk_fs = rate * mclk_fs_ratio;
|
||||
|
||||
return snd_soc_dai_set_sysclk(asoc_rtd_to_cpu(rtd, 0),
|
||||
return snd_soc_dai_set_sysclk(snd_soc_rtd_to_cpu(rtd, 0),
|
||||
0, mclk_fs, SND_SOC_CLOCK_OUT);
|
||||
}
|
||||
|
||||
|
@ -60,7 +60,7 @@ 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);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
unsigned int rate = params_rate(params);
|
||||
unsigned int mclk_fs_ratio = 128;
|
||||
unsigned int mclk_fs = rate * mclk_fs_ratio;
|
||||
|
@ -84,7 +84,7 @@ mt8183_mt6358_rt1015_i2s_hw_params(struct snd_pcm_substream *substream,
|
|||
}
|
||||
}
|
||||
|
||||
return snd_soc_dai_set_sysclk(asoc_rtd_to_cpu(rtd, 0),
|
||||
return snd_soc_dai_set_sysclk(snd_soc_rtd_to_cpu(rtd, 0),
|
||||
0, mclk_fs, SND_SOC_CLOCK_OUT);
|
||||
}
|
||||
|
||||
|
@ -302,7 +302,7 @@ SND_SOC_DAILINK_DEFS(tdm,
|
|||
|
||||
static int mt8183_mt6358_tdm_startup(struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct mt8183_mt6358_ts3a227_max98357_priv *priv =
|
||||
snd_soc_card_get_drvdata(rtd->card);
|
||||
int ret;
|
||||
|
@ -321,7 +321,7 @@ static int mt8183_mt6358_tdm_startup(struct snd_pcm_substream *substream)
|
|||
|
||||
static void mt8183_mt6358_tdm_shutdown(struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct mt8183_mt6358_ts3a227_max98357_priv *priv =
|
||||
snd_soc_card_get_drvdata(rtd->card);
|
||||
int ret;
|
||||
|
@ -345,7 +345,7 @@ static int
|
|||
mt8183_mt6358_ts3a227_max98357_wov_startup(
|
||||
struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
struct mt8183_mt6358_ts3a227_max98357_priv *priv =
|
||||
snd_soc_card_get_drvdata(card);
|
||||
|
@ -358,7 +358,7 @@ static void
|
|||
mt8183_mt6358_ts3a227_max98357_wov_shutdown(
|
||||
struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
struct mt8183_mt6358_ts3a227_max98357_priv *priv =
|
||||
snd_soc_card_get_drvdata(card);
|
||||
|
@ -388,7 +388,7 @@ mt8183_mt6358_ts3a227_max98357_hdmi_init(struct snd_soc_pcm_runtime *rtd)
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
return snd_soc_component_set_jack(asoc_rtd_to_codec(rtd, 0)->component,
|
||||
return snd_soc_component_set_jack(snd_soc_rtd_to_codec(rtd, 0)->component,
|
||||
&priv->hdmi_jack, NULL);
|
||||
}
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ static int mt8186_fe_startup(struct snd_pcm_substream *substream,
|
|||
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_cpu(rtd, 0)->id;
|
||||
int id = snd_soc_rtd_to_cpu(rtd, 0)->id;
|
||||
struct mtk_base_afe_memif *memif = &afe->memif[id];
|
||||
const struct snd_pcm_hardware *mtk_afe_hardware = afe->mtk_afe_hardware;
|
||||
int ret;
|
||||
|
@ -85,7 +85,7 @@ static void mt8186_fe_shutdown(struct snd_pcm_substream *substream,
|
|||
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
||||
struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai);
|
||||
struct mt8186_afe_private *afe_priv = afe->platform_priv;
|
||||
int id = asoc_rtd_to_cpu(rtd, 0)->id;
|
||||
int id = snd_soc_rtd_to_cpu(rtd, 0)->id;
|
||||
struct mtk_base_afe_memif *memif = &afe->memif[id];
|
||||
int irq_id = memif->irq_usage;
|
||||
|
||||
|
@ -106,7 +106,7 @@ static int mt8186_fe_hw_params(struct snd_pcm_substream *substream,
|
|||
{
|
||||
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
||||
struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai);
|
||||
int id = asoc_rtd_to_cpu(rtd, 0)->id;
|
||||
int id = snd_soc_rtd_to_cpu(rtd, 0)->id;
|
||||
unsigned int channels = params_channels(params);
|
||||
unsigned int rate = params_rate(params);
|
||||
int ret;
|
||||
|
@ -157,7 +157,7 @@ static int mt8186_fe_trigger(struct snd_pcm_substream *substream, int cmd,
|
|||
struct snd_pcm_runtime * const runtime = substream->runtime;
|
||||
struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai);
|
||||
struct mt8186_afe_private *afe_priv = afe->platform_priv;
|
||||
int id = asoc_rtd_to_cpu(rtd, 0)->id;
|
||||
int id = snd_soc_rtd_to_cpu(rtd, 0)->id;
|
||||
struct mtk_base_afe_memif *memif = &afe->memif[id];
|
||||
int irq_id = memif->irq_usage;
|
||||
struct mtk_base_afe_irq *irqs = &afe->irqs[irq_id];
|
||||
|
@ -256,7 +256,7 @@ static int mt8186_memif_fs(struct snd_pcm_substream *substream,
|
|||
struct snd_soc_component *component =
|
||||
snd_soc_rtdcom_lookup(rtd, AFE_PCM_NAME);
|
||||
struct mtk_base_afe *afe = snd_soc_component_get_drvdata(component);
|
||||
int id = asoc_rtd_to_cpu(rtd, 0)->id;
|
||||
int id = snd_soc_rtd_to_cpu(rtd, 0)->id;
|
||||
|
||||
return mt8186_rate_transform(afe->dev, rate, id);
|
||||
}
|
||||
|
@ -293,7 +293,7 @@ static int mt8186_fe_prepare(struct snd_pcm_substream *substream,
|
|||
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_rtd_to_cpu(rtd, 0)->id;
|
||||
int id = snd_soc_rtd_to_cpu(rtd, 0)->id;
|
||||
struct mtk_base_afe_memif *memif = &afe->memif[id];
|
||||
int irq_id = memif->irq_usage;
|
||||
struct mtk_base_afe_irq *irqs = &afe->irqs[irq_id];
|
||||
|
|
|
@ -18,7 +18,7 @@ int mt8186_mt6366_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;
|
||||
snd_soc_rtd_to_codec(rtd, 0)->component;
|
||||
struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt_afe);
|
||||
struct mt8186_afe_private *afe_priv = afe->platform_priv;
|
||||
struct snd_soc_dapm_context *dapm = &rtd->card->dapm;
|
||||
|
|
|
@ -77,7 +77,7 @@ static int mt8186_da7219_init(struct snd_soc_pcm_runtime *rtd)
|
|||
struct mt8186_mt6366_da7219_max98357_priv *priv = soc_card_data->mach_priv;
|
||||
struct snd_soc_jack *jack = &priv->headset_jack;
|
||||
struct snd_soc_component *cmpnt_codec =
|
||||
asoc_rtd_to_codec(rtd, 0)->component;
|
||||
snd_soc_rtd_to_codec(rtd, 0)->component;
|
||||
int ret;
|
||||
|
||||
ret = mt8186_dai_i2s_set_share(afe, "I2S1", "I2S0");
|
||||
|
@ -111,7 +111,7 @@ static int mt8186_da7219_init(struct snd_soc_pcm_runtime *rtd)
|
|||
static int mt8186_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_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_dai *codec_dai;
|
||||
unsigned int rate = params_rate(params);
|
||||
unsigned int mclk_fs_ratio = 256;
|
||||
|
@ -119,7 +119,7 @@ static int mt8186_da7219_i2s_hw_params(struct snd_pcm_substream *substream,
|
|||
unsigned int freq;
|
||||
int ret, j;
|
||||
|
||||
ret = snd_soc_dai_set_sysclk(asoc_rtd_to_cpu(rtd, 0), 0,
|
||||
ret = snd_soc_dai_set_sysclk(snd_soc_rtd_to_cpu(rtd, 0), 0,
|
||||
mclk_fs, SND_SOC_CLOCK_OUT);
|
||||
if (ret < 0) {
|
||||
dev_err(rtd->dev, "failed to set cpu dai sysclk: %d\n", ret);
|
||||
|
@ -159,7 +159,7 @@ static int mt8186_da7219_i2s_hw_params(struct snd_pcm_substream *substream,
|
|||
|
||||
static int mt8186_da7219_i2s_hw_free(struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_dai *codec_dai;
|
||||
int ret = 0, j;
|
||||
|
||||
|
@ -189,7 +189,7 @@ static int mt8186_mt6366_da7219_max98357_hdmi_init(struct snd_soc_pcm_runtime *r
|
|||
snd_soc_rtdcom_lookup(rtd, AFE_PCM_NAME);
|
||||
struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt_afe);
|
||||
struct snd_soc_component *cmpnt_codec =
|
||||
asoc_rtd_to_codec(rtd, 0)->component;
|
||||
snd_soc_rtd_to_codec(rtd, 0)->component;
|
||||
struct mtk_soc_card_data *soc_card_data =
|
||||
snd_soc_card_get_drvdata(rtd->card);
|
||||
struct mt8186_mt6366_da7219_max98357_priv *priv = soc_card_data->mach_priv;
|
||||
|
@ -281,7 +281,7 @@ static int mt8186_mt6366_da7219_max98357_playback_startup(struct snd_pcm_substre
|
|||
.mask = 0,
|
||||
};
|
||||
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
int ret;
|
||||
|
||||
|
@ -327,7 +327,7 @@ static int mt8186_mt6366_da7219_max98357_capture_startup(struct snd_pcm_substrea
|
|||
.mask = 0,
|
||||
};
|
||||
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
int ret;
|
||||
|
||||
|
|
|
@ -169,7 +169,7 @@ static int mt8186_rt5682s_init(struct snd_soc_pcm_runtime *rtd)
|
|||
struct mt8186_mt6366_rt1019_rt5682s_priv *priv = soc_card_data->mach_priv;
|
||||
struct snd_soc_jack *jack = &priv->headset_jack;
|
||||
struct snd_soc_component *cmpnt_codec =
|
||||
asoc_rtd_to_codec(rtd, 0)->component;
|
||||
snd_soc_rtd_to_codec(rtd, 0)->component;
|
||||
int ret;
|
||||
|
||||
ret = mt8186_dai_i2s_set_share(afe, "I2S1", "I2S0");
|
||||
|
@ -202,8 +202,8 @@ static int mt8186_rt5682s_i2s_hw_params(struct snd_pcm_substream *substream,
|
|||
{
|
||||
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);
|
||||
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
|
||||
struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
|
||||
struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
|
||||
unsigned int rate = params_rate(params);
|
||||
unsigned int mclk_fs_ratio = 128;
|
||||
unsigned int mclk_fs = rate * mclk_fs_ratio;
|
||||
|
@ -253,7 +253,7 @@ static int mt8186_mt6366_rt1019_rt5682s_hdmi_init(struct snd_soc_pcm_runtime *rt
|
|||
snd_soc_rtdcom_lookup(rtd, AFE_PCM_NAME);
|
||||
struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt_afe);
|
||||
struct snd_soc_component *cmpnt_codec =
|
||||
asoc_rtd_to_codec(rtd, 0)->component;
|
||||
snd_soc_rtd_to_codec(rtd, 0)->component;
|
||||
struct mtk_soc_card_data *soc_card_data =
|
||||
snd_soc_card_get_drvdata(rtd->card);
|
||||
struct mt8186_mt6366_rt1019_rt5682s_priv *priv = soc_card_data->mach_priv;
|
||||
|
@ -345,7 +345,7 @@ static int mt8186_mt6366_rt1019_rt5682s_playback_startup(struct snd_pcm_substrea
|
|||
.mask = 0,
|
||||
};
|
||||
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
int ret;
|
||||
|
||||
|
@ -391,7 +391,7 @@ static int mt8186_mt6366_rt1019_rt5682s_capture_startup(struct snd_pcm_substream
|
|||
.mask = 0,
|
||||
};
|
||||
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
int ret;
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ static int mt8188_memif_fs(struct snd_pcm_substream *substream,
|
|||
struct mtk_base_afe_memif *memif = NULL;
|
||||
struct mtk_dai_memif_priv *memif_priv = NULL;
|
||||
int fs = mt8188_afe_fs_timing(rate);
|
||||
int id = asoc_rtd_to_cpu(rtd, 0)->id;
|
||||
int id = snd_soc_rtd_to_cpu(rtd, 0)->id;
|
||||
|
||||
if (id < 0)
|
||||
return -EINVAL;
|
||||
|
@ -303,7 +303,7 @@ static int mt8188_afe_fe_startup(struct snd_pcm_substream *substream,
|
|||
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 = asoc_rtd_to_cpu(rtd, 0)->id;
|
||||
int id = snd_soc_rtd_to_cpu(rtd, 0)->id;
|
||||
int ret;
|
||||
|
||||
ret = mtk_afe_fe_startup(substream, dai);
|
||||
|
@ -336,7 +336,7 @@ static int mt8188_afe_fe_hw_params(struct snd_pcm_substream *substream,
|
|||
{
|
||||
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
||||
struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai);
|
||||
int id = asoc_rtd_to_cpu(rtd, 0)->id;
|
||||
int id = snd_soc_rtd_to_cpu(rtd, 0)->id;
|
||||
struct mtk_base_afe_memif *memif = &afe->memif[id];
|
||||
const struct mtk_base_memif_data *data = memif->data;
|
||||
const struct mt8188_afe_channel_merge *cm = mt8188_afe_found_cm(dai);
|
||||
|
@ -360,7 +360,7 @@ static int mt8188_afe_fe_trigger(struct snd_pcm_substream *substream, int cmd,
|
|||
const struct mt8188_afe_channel_merge *cm = mt8188_afe_found_cm(dai);
|
||||
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
||||
struct snd_pcm_runtime * const runtime = substream->runtime;
|
||||
int id = asoc_rtd_to_cpu(rtd, 0)->id;
|
||||
int id = snd_soc_rtd_to_cpu(rtd, 0)->id;
|
||||
struct mtk_base_afe_memif *memif = &afe->memif[id];
|
||||
struct mtk_base_afe_irq *irqs = &afe->irqs[memif->irq_usage];
|
||||
const struct mtk_base_irq_data *irq_data = irqs->irq_data;
|
||||
|
|
|
@ -338,7 +338,7 @@ static int mt8188_mt6359_mtkaif_calibration(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;
|
||||
snd_soc_rtd_to_codec(rtd, 0)->component;
|
||||
struct snd_soc_dapm_widget *pin_w = NULL, *w;
|
||||
struct mtk_base_afe *afe;
|
||||
struct mt8188_afe_private *afe_priv;
|
||||
|
@ -500,7 +500,7 @@ static int mt8188_mt6359_mtkaif_calibration(struct snd_soc_pcm_runtime *rtd)
|
|||
static int mt8188_mt6359_init(struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
struct snd_soc_component *cmpnt_codec =
|
||||
asoc_rtd_to_codec(rtd, 0)->component;
|
||||
snd_soc_rtd_to_codec(rtd, 0)->component;
|
||||
|
||||
/* set mtkaif protocol */
|
||||
mt6359_set_mtkaif_protocol(cmpnt_codec,
|
||||
|
@ -556,7 +556,7 @@ static int mt8188_dptx_hw_params(struct snd_pcm_substream *substream,
|
|||
unsigned int rate = params_rate(params);
|
||||
unsigned int mclk_fs_ratio = 256;
|
||||
unsigned int mclk_fs = rate * mclk_fs_ratio;
|
||||
struct snd_soc_dai *dai = asoc_rtd_to_cpu(rtd, 0);
|
||||
struct snd_soc_dai *dai = snd_soc_rtd_to_cpu(rtd, 0);
|
||||
|
||||
return snd_soc_dai_set_sysclk(dai, 0, mclk_fs, SND_SOC_CLOCK_OUT);
|
||||
}
|
||||
|
@ -581,7 +581,7 @@ static int mt8188_hdmi_codec_init(struct snd_soc_pcm_runtime *rtd)
|
|||
{
|
||||
struct mtk_soc_card_data *soc_card_data = snd_soc_card_get_drvdata(rtd->card);
|
||||
struct mt8188_mt6359_priv *priv = soc_card_data->mach_priv;
|
||||
struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component;
|
||||
struct snd_soc_component *component = snd_soc_rtd_to_codec(rtd, 0)->component;
|
||||
int ret = 0;
|
||||
|
||||
ret = snd_soc_card_jack_new_pins(rtd->card, "HDMI Jack",
|
||||
|
@ -607,7 +607,7 @@ static int mt8188_dptx_codec_init(struct snd_soc_pcm_runtime *rtd)
|
|||
{
|
||||
struct mtk_soc_card_data *soc_card_data = snd_soc_card_get_drvdata(rtd->card);
|
||||
struct mt8188_mt6359_priv *priv = soc_card_data->mach_priv;
|
||||
struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component;
|
||||
struct snd_soc_component *component = snd_soc_rtd_to_codec(rtd, 0)->component;
|
||||
int ret = 0;
|
||||
|
||||
ret = snd_soc_card_jack_new_pins(rtd->card, "DP Jack", SND_JACK_LINEOUT,
|
||||
|
@ -655,7 +655,7 @@ static int mt8188_max98390_hw_params(struct snd_pcm_substream *substream,
|
|||
{
|
||||
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
||||
unsigned int bit_width = params_width(params);
|
||||
struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
|
||||
struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
|
||||
struct snd_soc_dai *codec_dai;
|
||||
int i;
|
||||
|
||||
|
@ -728,7 +728,7 @@ static int mt8188_nau8825_codec_init(struct snd_soc_pcm_runtime *rtd)
|
|||
struct snd_soc_card *card = rtd->card;
|
||||
struct mtk_soc_card_data *soc_card_data = snd_soc_card_get_drvdata(card);
|
||||
struct mt8188_mt6359_priv *priv = soc_card_data->mach_priv;
|
||||
struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component;
|
||||
struct snd_soc_component *component = snd_soc_rtd_to_codec(rtd, 0)->component;
|
||||
struct snd_soc_jack *jack = &priv->headset_jack;
|
||||
int ret;
|
||||
|
||||
|
@ -774,7 +774,7 @@ static int mt8188_nau8825_codec_init(struct snd_soc_pcm_runtime *rtd)
|
|||
|
||||
static void mt8188_nau8825_codec_exit(struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component;
|
||||
struct snd_soc_component *component = snd_soc_rtd_to_codec(rtd, 0)->component;
|
||||
|
||||
snd_soc_component_set_jack(component, NULL, NULL);
|
||||
}
|
||||
|
@ -782,8 +782,8 @@ static void mt8188_nau8825_codec_exit(struct snd_soc_pcm_runtime *rtd)
|
|||
static int mt8188_nau8825_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);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
|
||||
unsigned int rate = params_rate(params);
|
||||
unsigned int bit_width = params_width(params);
|
||||
int clk_freq, ret;
|
||||
|
@ -816,7 +816,7 @@ static const struct snd_soc_ops mt8188_nau8825_ops = {
|
|||
static int mt8188_sof_be_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_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_component *cmpnt_afe = NULL;
|
||||
struct snd_soc_pcm_runtime *runtime;
|
||||
|
||||
|
|
|
@ -42,11 +42,11 @@ static const struct snd_pcm_hardware mt8192_afe_hardware = {
|
|||
static int mt8192_memif_fs(struct snd_pcm_substream *substream,
|
||||
unsigned int rate)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_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_drvdata(component);
|
||||
int id = asoc_rtd_to_cpu(rtd, 0)->id;
|
||||
int id = snd_soc_rtd_to_cpu(rtd, 0)->id;
|
||||
|
||||
return mt8192_rate_transform(afe->dev, rate, id);
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ static int mt8192_get_dai_fs(struct mtk_base_afe *afe,
|
|||
|
||||
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_pcm_runtime *rtd = snd_soc_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_drvdata(component);
|
||||
|
|
|
@ -58,9 +58,9 @@ static struct snd_soc_jack_pin mt8192_jack_pins[] = {
|
|||
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_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
|
||||
struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
|
||||
struct snd_soc_dai *codec_dai;
|
||||
unsigned int rate = params_rate(params);
|
||||
unsigned int mclk_fs_ratio = 128;
|
||||
|
@ -93,10 +93,10 @@ static int mt8192_rt1015_i2s_hw_params(struct snd_pcm_substream *substream,
|
|||
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_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
|
||||
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
|
||||
struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
|
||||
struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
|
||||
unsigned int rate = params_rate(params);
|
||||
unsigned int mclk_fs_ratio = 128;
|
||||
unsigned int mclk_fs = rate * mclk_fs_ratio;
|
||||
|
@ -149,7 +149,7 @@ static int mt8192_mt6359_mtkaif_calibration(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;
|
||||
snd_soc_rtd_to_codec(rtd, 0)->component;
|
||||
struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt_afe);
|
||||
struct mt8192_afe_private *afe_priv = afe->platform_priv;
|
||||
int phase;
|
||||
|
@ -306,7 +306,7 @@ 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;
|
||||
snd_soc_rtd_to_codec(rtd, 0)->component;
|
||||
struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt_afe);
|
||||
struct mt8192_afe_private *afe_priv = afe->platform_priv;
|
||||
|
||||
|
@ -327,7 +327,7 @@ static int mt8192_rt5682_init(struct snd_soc_pcm_runtime *rtd)
|
|||
snd_soc_rtdcom_lookup(rtd, AFE_PCM_NAME);
|
||||
struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt_afe);
|
||||
struct snd_soc_component *cmpnt_codec =
|
||||
asoc_rtd_to_codec(rtd, 0)->component;
|
||||
snd_soc_rtd_to_codec(rtd, 0)->component;
|
||||
struct mt8192_mt6359_priv *priv = snd_soc_card_get_drvdata(rtd->card);
|
||||
struct snd_soc_jack *jack = &priv->headset_jack;
|
||||
int ret;
|
||||
|
@ -360,7 +360,7 @@ static int mt8192_rt5682_init(struct snd_soc_pcm_runtime *rtd)
|
|||
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;
|
||||
snd_soc_rtd_to_codec(rtd, 0)->component;
|
||||
struct mt8192_mt6359_priv *priv = snd_soc_card_get_drvdata(rtd->card);
|
||||
int ret;
|
||||
|
||||
|
@ -406,7 +406,7 @@ mt8192_mt6359_cap1_startup(struct snd_pcm_substream *substream)
|
|||
.mask = 0,
|
||||
};
|
||||
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
int ret;
|
||||
|
||||
|
@ -453,7 +453,7 @@ mt8192_mt6359_rt5682_startup(struct snd_pcm_substream *substream)
|
|||
.mask = 0,
|
||||
};
|
||||
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
int ret;
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ static int mt8195_memif_fs(struct snd_pcm_substream *substream,
|
|||
struct snd_soc_component *component =
|
||||
snd_soc_rtdcom_lookup(rtd, AFE_PCM_NAME);
|
||||
struct mtk_base_afe *afe = snd_soc_component_get_drvdata(component);
|
||||
int id = asoc_rtd_to_cpu(rtd, 0)->id;
|
||||
int id = snd_soc_rtd_to_cpu(rtd, 0)->id;
|
||||
struct mtk_base_afe_memif *memif = &afe->memif[id];
|
||||
int fs = mt8195_afe_fs_timing(rate);
|
||||
|
||||
|
@ -284,7 +284,7 @@ mt8195_afe_paired_memif_clk_prepare(struct snd_pcm_substream *substream,
|
|||
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
||||
struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai);
|
||||
struct mt8195_afe_private *afe_priv = afe->platform_priv;
|
||||
int id = asoc_rtd_to_cpu(rtd, 0)->id;
|
||||
int id = snd_soc_rtd_to_cpu(rtd, 0)->id;
|
||||
int clk_id;
|
||||
|
||||
if (id != MT8195_AFE_MEMIF_DL8 && id != MT8195_AFE_MEMIF_DL10)
|
||||
|
@ -313,7 +313,7 @@ mt8195_afe_paired_memif_clk_enable(struct snd_pcm_substream *substream,
|
|||
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
||||
struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai);
|
||||
struct mt8195_afe_private *afe_priv = afe->platform_priv;
|
||||
int id = asoc_rtd_to_cpu(rtd, 0)->id;
|
||||
int id = snd_soc_rtd_to_cpu(rtd, 0)->id;
|
||||
int clk_id;
|
||||
|
||||
if (id != MT8195_AFE_MEMIF_DL8 && id != MT8195_AFE_MEMIF_DL10)
|
||||
|
@ -345,7 +345,7 @@ static int mt8195_afe_fe_startup(struct snd_pcm_substream *substream,
|
|||
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 = asoc_rtd_to_cpu(rtd, 0)->id;
|
||||
int id = snd_soc_rtd_to_cpu(rtd, 0)->id;
|
||||
int ret = 0;
|
||||
|
||||
mt8195_afe_paired_memif_clk_prepare(substream, dai, 1);
|
||||
|
@ -382,7 +382,7 @@ static int mt8195_afe_fe_hw_params(struct snd_pcm_substream *substream,
|
|||
{
|
||||
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
||||
struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai);
|
||||
int id = asoc_rtd_to_cpu(rtd, 0)->id;
|
||||
int id = snd_soc_rtd_to_cpu(rtd, 0)->id;
|
||||
struct mtk_base_afe_memif *memif = &afe->memif[id];
|
||||
const struct mtk_base_memif_data *data = memif->data;
|
||||
const struct mt8195_afe_channel_merge *cm = mt8195_afe_found_cm(dai);
|
||||
|
|
|
@ -146,7 +146,7 @@ static int mt8195_mt6359_mtkaif_calibration(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;
|
||||
snd_soc_rtd_to_codec(rtd, 0)->component;
|
||||
struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt_afe);
|
||||
struct mt8195_afe_private *afe_priv = afe->platform_priv;
|
||||
struct mtkaif_param *param = &afe_priv->mtkaif_params;
|
||||
|
@ -307,7 +307,7 @@ static int mt8195_mt6359_mtkaif_calibration(struct snd_soc_pcm_runtime *rtd)
|
|||
static int mt8195_mt6359_init(struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
struct snd_soc_component *cmpnt_codec =
|
||||
asoc_rtd_to_codec(rtd, 0)->component;
|
||||
snd_soc_rtd_to_codec(rtd, 0)->component;
|
||||
|
||||
/* set mtkaif protocol */
|
||||
mt6359_set_mtkaif_protocol(cmpnt_codec,
|
||||
|
@ -338,7 +338,7 @@ static int mt8195_hdmitx_dptx_startup(struct snd_pcm_substream *substream)
|
|||
.mask = 0,
|
||||
};
|
||||
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
int ret;
|
||||
|
||||
|
@ -369,7 +369,7 @@ 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);
|
||||
struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
|
||||
|
||||
return snd_soc_dai_set_sysclk(cpu_dai, 0, params_rate(params) * 256,
|
||||
SND_SOC_CLOCK_OUT);
|
||||
|
@ -384,7 +384,7 @@ static int mt8195_dptx_codec_init(struct snd_soc_pcm_runtime *rtd)
|
|||
struct mtk_soc_card_data *soc_card_data = snd_soc_card_get_drvdata(rtd->card);
|
||||
struct mt8195_mt6359_priv *priv = soc_card_data->mach_priv;
|
||||
struct snd_soc_component *cmpnt_codec =
|
||||
asoc_rtd_to_codec(rtd, 0)->component;
|
||||
snd_soc_rtd_to_codec(rtd, 0)->component;
|
||||
int ret;
|
||||
|
||||
ret = snd_soc_card_jack_new(rtd->card, "DP Jack", SND_JACK_LINEOUT,
|
||||
|
@ -400,7 +400,7 @@ static int mt8195_hdmi_codec_init(struct snd_soc_pcm_runtime *rtd)
|
|||
struct mtk_soc_card_data *soc_card_data = snd_soc_card_get_drvdata(rtd->card);
|
||||
struct mt8195_mt6359_priv *priv = soc_card_data->mach_priv;
|
||||
struct snd_soc_component *cmpnt_codec =
|
||||
asoc_rtd_to_codec(rtd, 0)->component;
|
||||
snd_soc_rtd_to_codec(rtd, 0)->component;
|
||||
int ret;
|
||||
|
||||
ret = snd_soc_card_jack_new(rtd->card, "HDMI Jack", SND_JACK_LINEOUT,
|
||||
|
@ -442,7 +442,7 @@ static int mt8195_playback_startup(struct snd_pcm_substream *substream)
|
|||
.mask = 0,
|
||||
};
|
||||
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
int ret;
|
||||
|
||||
|
@ -488,7 +488,7 @@ static int mt8195_capture_startup(struct snd_pcm_substream *substream)
|
|||
.mask = 0,
|
||||
};
|
||||
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
int ret;
|
||||
|
||||
|
@ -520,8 +520,8 @@ static int mt8195_rt5682_etdm_hw_params(struct snd_pcm_substream *substream,
|
|||
{
|
||||
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);
|
||||
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
|
||||
struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
|
||||
struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
|
||||
unsigned int rate = params_rate(params);
|
||||
int bitwidth;
|
||||
int ret;
|
||||
|
@ -563,7 +563,7 @@ static const struct snd_soc_ops mt8195_rt5682_etdm_ops = {
|
|||
static int mt8195_rt5682_init(struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
struct snd_soc_component *cmpnt_codec =
|
||||
asoc_rtd_to_codec(rtd, 0)->component;
|
||||
snd_soc_rtd_to_codec(rtd, 0)->component;
|
||||
struct mtk_soc_card_data *soc_card_data = snd_soc_card_get_drvdata(rtd->card);
|
||||
struct mt8195_mt6359_priv *priv = soc_card_data->mach_priv;
|
||||
struct snd_soc_jack *jack = &priv->headset_jack;
|
||||
|
@ -603,7 +603,7 @@ static int mt8195_rt5682_init(struct snd_soc_pcm_runtime *rtd)
|
|||
static int mt8195_rt1011_etdm_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_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_dai *codec_dai;
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
int srate, i, ret;
|
||||
|
@ -636,7 +636,7 @@ static const struct snd_soc_ops mt8195_rt1011_etdm_ops = {
|
|||
static int mt8195_sof_be_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_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_component *cmpnt_afe = NULL;
|
||||
struct snd_soc_pcm_runtime *runtime;
|
||||
|
||||
|
|
Loading…
Reference in a new issue