Commit ded00543 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: amd: use asoc_substream_to_rtd()

Now we can use asoc_substream_to_rtd() macro,
let's use it.
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87ft9n0ytv.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 5c5eb29e
...@@ -99,7 +99,7 @@ static int cz_da7219_init(struct snd_soc_pcm_runtime *rtd) ...@@ -99,7 +99,7 @@ static int cz_da7219_init(struct snd_soc_pcm_runtime *rtd)
static int da7219_clk_enable(struct snd_pcm_substream *substream) static int da7219_clk_enable(struct snd_pcm_substream *substream)
{ {
int ret = 0; int ret = 0;
struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
/* /*
* Set wclk to 48000 because the rate constraint of this driver is * Set wclk to 48000 because the rate constraint of this driver is
...@@ -146,7 +146,7 @@ static const struct snd_pcm_hw_constraint_list constraints_channels = { ...@@ -146,7 +146,7 @@ static const struct snd_pcm_hw_constraint_list constraints_channels = {
static int cz_da7219_play_startup(struct snd_pcm_substream *substream) static int cz_da7219_play_startup(struct snd_pcm_substream *substream)
{ {
struct snd_pcm_runtime *runtime = substream->runtime; struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
struct snd_soc_card *card = rtd->card; struct snd_soc_card *card = rtd->card;
struct acp_platform_info *machine = snd_soc_card_get_drvdata(card); struct acp_platform_info *machine = snd_soc_card_get_drvdata(card);
...@@ -167,7 +167,7 @@ static int cz_da7219_play_startup(struct snd_pcm_substream *substream) ...@@ -167,7 +167,7 @@ static int cz_da7219_play_startup(struct snd_pcm_substream *substream)
static int cz_da7219_cap_startup(struct snd_pcm_substream *substream) static int cz_da7219_cap_startup(struct snd_pcm_substream *substream)
{ {
struct snd_pcm_runtime *runtime = substream->runtime; struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
struct snd_soc_card *card = rtd->card; struct snd_soc_card *card = rtd->card;
struct acp_platform_info *machine = snd_soc_card_get_drvdata(card); struct acp_platform_info *machine = snd_soc_card_get_drvdata(card);
...@@ -189,7 +189,7 @@ static int cz_da7219_cap_startup(struct snd_pcm_substream *substream) ...@@ -189,7 +189,7 @@ static int cz_da7219_cap_startup(struct snd_pcm_substream *substream)
static int cz_max_startup(struct snd_pcm_substream *substream) static int cz_max_startup(struct snd_pcm_substream *substream)
{ {
struct snd_pcm_runtime *runtime = substream->runtime; struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
struct snd_soc_card *card = rtd->card; struct snd_soc_card *card = rtd->card;
struct acp_platform_info *machine = snd_soc_card_get_drvdata(card); struct acp_platform_info *machine = snd_soc_card_get_drvdata(card);
...@@ -210,7 +210,7 @@ static int cz_max_startup(struct snd_pcm_substream *substream) ...@@ -210,7 +210,7 @@ static int cz_max_startup(struct snd_pcm_substream *substream)
static int cz_dmic0_startup(struct snd_pcm_substream *substream) static int cz_dmic0_startup(struct snd_pcm_substream *substream)
{ {
struct snd_pcm_runtime *runtime = substream->runtime; struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
struct snd_soc_card *card = rtd->card; struct snd_soc_card *card = rtd->card;
struct acp_platform_info *machine = snd_soc_card_get_drvdata(card); struct acp_platform_info *machine = snd_soc_card_get_drvdata(card);
...@@ -231,7 +231,7 @@ static int cz_dmic0_startup(struct snd_pcm_substream *substream) ...@@ -231,7 +231,7 @@ static int cz_dmic0_startup(struct snd_pcm_substream *substream)
static int cz_dmic1_startup(struct snd_pcm_substream *substream) static int cz_dmic1_startup(struct snd_pcm_substream *substream)
{ {
struct snd_pcm_runtime *runtime = substream->runtime; struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
struct snd_soc_card *card = rtd->card; struct snd_soc_card *card = rtd->card;
struct acp_platform_info *machine = snd_soc_card_get_drvdata(card); struct acp_platform_info *machine = snd_soc_card_get_drvdata(card);
......
...@@ -840,7 +840,7 @@ static int acp_dma_hw_params(struct snd_soc_component *component, ...@@ -840,7 +840,7 @@ static int acp_dma_hw_params(struct snd_soc_component *component,
u32 val = 0; u32 val = 0;
struct snd_pcm_runtime *runtime; struct snd_pcm_runtime *runtime;
struct audio_substream_data *rtd; struct audio_substream_data *rtd;
struct snd_soc_pcm_runtime *prtd = substream->private_data; struct snd_soc_pcm_runtime *prtd = asoc_substream_to_rtd(substream);
struct audio_drv_data *adata = dev_get_drvdata(component->dev); struct audio_drv_data *adata = dev_get_drvdata(component->dev);
struct snd_soc_card *card = prtd->card; struct snd_soc_card *card = prtd->card;
struct acp_platform_info *pinfo = snd_soc_card_get_drvdata(card); struct acp_platform_info *pinfo = snd_soc_card_get_drvdata(card);
......
...@@ -47,7 +47,7 @@ static int cz_aif1_hw_params(struct snd_pcm_substream *substream, ...@@ -47,7 +47,7 @@ static int cz_aif1_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params) struct snd_pcm_hw_params *params)
{ {
int ret = 0; int ret = 0;
struct snd_soc_pcm_runtime *rtd = substream->private_data; 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 *codec_dai = asoc_rtd_to_codec(rtd, 0);
ret = snd_soc_dai_set_pll(codec_dai, 0, RT5645_PLL1_S_MCLK, ret = snd_soc_dai_set_pll(codec_dai, 0, RT5645_PLL1_S_MCLK,
......
...@@ -105,7 +105,7 @@ static int acp3x_5682_init(struct snd_soc_pcm_runtime *rtd) ...@@ -105,7 +105,7 @@ static int acp3x_5682_init(struct snd_soc_pcm_runtime *rtd)
static int rt5682_clk_enable(struct snd_pcm_substream *substream) static int rt5682_clk_enable(struct snd_pcm_substream *substream)
{ {
int ret = 0; int ret = 0;
struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
/* RT5682 will support only 48K output with 48M mclk */ /* RT5682 will support only 48K output with 48M mclk */
clk_set_rate(rt5682_dai_wclk, 48000); clk_set_rate(rt5682_dai_wclk, 48000);
...@@ -147,7 +147,7 @@ static const struct snd_pcm_hw_constraint_list constraints_channels = { ...@@ -147,7 +147,7 @@ static const struct snd_pcm_hw_constraint_list constraints_channels = {
static int acp3x_5682_startup(struct snd_pcm_substream *substream) static int acp3x_5682_startup(struct snd_pcm_substream *substream)
{ {
struct snd_pcm_runtime *runtime = substream->runtime; struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
struct snd_soc_card *card = rtd->card; struct snd_soc_card *card = rtd->card;
struct acp3x_platform_info *machine = snd_soc_card_get_drvdata(card); struct acp3x_platform_info *machine = snd_soc_card_get_drvdata(card);
...@@ -165,7 +165,7 @@ static int acp3x_5682_startup(struct snd_pcm_substream *substream) ...@@ -165,7 +165,7 @@ static int acp3x_5682_startup(struct snd_pcm_substream *substream)
static int acp3x_max_startup(struct snd_pcm_substream *substream) static int acp3x_max_startup(struct snd_pcm_substream *substream)
{ {
struct snd_pcm_runtime *runtime = substream->runtime; struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
struct snd_soc_card *card = rtd->card; struct snd_soc_card *card = rtd->card;
struct acp3x_platform_info *machine = snd_soc_card_get_drvdata(card); struct acp3x_platform_info *machine = snd_soc_card_get_drvdata(card);
...@@ -181,7 +181,7 @@ static int acp3x_max_startup(struct snd_pcm_substream *substream) ...@@ -181,7 +181,7 @@ static int acp3x_max_startup(struct snd_pcm_substream *substream)
static int acp3x_ec_dmic0_startup(struct snd_pcm_substream *substream) static int acp3x_ec_dmic0_startup(struct snd_pcm_substream *substream)
{ {
struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
struct snd_soc_card *card = rtd->card; struct snd_soc_card *card = rtd->card;
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
struct acp3x_platform_info *machine = snd_soc_card_get_drvdata(card); struct acp3x_platform_info *machine = snd_soc_card_get_drvdata(card);
......
...@@ -80,7 +80,7 @@ static int acp3x_i2s_hwparams(struct snd_pcm_substream *substream, ...@@ -80,7 +80,7 @@ static int acp3x_i2s_hwparams(struct snd_pcm_substream *substream,
u32 val; u32 val;
u32 reg_val, frmt_reg; u32 reg_val, frmt_reg;
prtd = substream->private_data; prtd = asoc_substream_to_rtd(substream);
rtd = substream->runtime->private_data; rtd = substream->runtime->private_data;
card = prtd->card; card = prtd->card;
adata = snd_soc_dai_get_drvdata(dai); adata = snd_soc_dai_get_drvdata(dai);
......
...@@ -217,7 +217,7 @@ static int acp3x_dma_open(struct snd_soc_component *component, ...@@ -217,7 +217,7 @@ static int acp3x_dma_open(struct snd_soc_component *component,
int ret; int ret;
runtime = substream->runtime; runtime = substream->runtime;
prtd = substream->private_data; prtd = asoc_substream_to_rtd(substream);
component = snd_soc_rtdcom_lookup(prtd, DRV_NAME); component = snd_soc_rtdcom_lookup(prtd, DRV_NAME);
adata = dev_get_drvdata(component->dev); adata = dev_get_drvdata(component->dev);
i2s_data = kzalloc(sizeof(*i2s_data), GFP_KERNEL); i2s_data = kzalloc(sizeof(*i2s_data), GFP_KERNEL);
...@@ -258,7 +258,7 @@ static int acp3x_dma_hw_params(struct snd_soc_component *component, ...@@ -258,7 +258,7 @@ static int acp3x_dma_hw_params(struct snd_soc_component *component,
struct i2s_dev_data *adata; struct i2s_dev_data *adata;
u64 size; u64 size;
prtd = substream->private_data; prtd = asoc_substream_to_rtd(substream);
card = prtd->card; card = prtd->card;
pinfo = snd_soc_card_get_drvdata(card); pinfo = snd_soc_card_get_drvdata(card);
adata = dev_get_drvdata(component->dev); adata = dev_get_drvdata(component->dev);
...@@ -340,7 +340,7 @@ static int acp3x_dma_close(struct snd_soc_component *component, ...@@ -340,7 +340,7 @@ static int acp3x_dma_close(struct snd_soc_component *component,
struct i2s_dev_data *adata; struct i2s_dev_data *adata;
struct i2s_stream_instance *ins; struct i2s_stream_instance *ins;
prtd = substream->private_data; prtd = asoc_substream_to_rtd(substream);
component = snd_soc_rtdcom_lookup(prtd, DRV_NAME); component = snd_soc_rtdcom_lookup(prtd, DRV_NAME);
adata = dev_get_drvdata(component->dev); adata = dev_get_drvdata(component->dev);
ins = substream->runtime->private_data; ins = substream->runtime->private_data;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment