ASoC: amd: use asoc_substream_to_rtd()
Now we can use asoc_substream_to_rtd() macro, let's use it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87ft9n0ytv.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
5c5eb29e8a
commit
ded0054359
|
@ -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)
|
||||
{
|
||||
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
|
||||
|
@ -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)
|
||||
{
|
||||
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 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)
|
|||
static int cz_da7219_cap_startup(struct snd_pcm_substream *substream)
|
||||
{
|
||||
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 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)
|
|||
static int cz_max_startup(struct snd_pcm_substream *substream)
|
||||
{
|
||||
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 acp_platform_info *machine = snd_soc_card_get_drvdata(card);
|
||||
|
||||
|
@ -210,7 +210,7 @@ static int cz_max_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_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 acp_platform_info *machine = snd_soc_card_get_drvdata(card);
|
||||
|
||||
|
@ -231,7 +231,7 @@ static int cz_dmic0_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_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 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,
|
|||
u32 val = 0;
|
||||
struct snd_pcm_runtime *runtime;
|
||||
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 snd_soc_card *card = prtd->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,
|
|||
struct snd_pcm_hw_params *params)
|
||||
{
|
||||
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);
|
||||
|
||||
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)
|
|||
static int rt5682_clk_enable(struct snd_pcm_substream *substream)
|
||||
{
|
||||
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 */
|
||||
clk_set_rate(rt5682_dai_wclk, 48000);
|
||||
|
@ -147,7 +147,7 @@ static const struct snd_pcm_hw_constraint_list constraints_channels = {
|
|||
static int acp3x_5682_startup(struct snd_pcm_substream *substream)
|
||||
{
|
||||
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 acp3x_platform_info *machine = snd_soc_card_get_drvdata(card);
|
||||
|
||||
|
@ -165,7 +165,7 @@ static int acp3x_5682_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_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 acp3x_platform_info *machine = snd_soc_card_get_drvdata(card);
|
||||
|
||||
|
@ -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)
|
||||
{
|
||||
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_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
|
||||
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,
|
|||
u32 val;
|
||||
u32 reg_val, frmt_reg;
|
||||
|
||||
prtd = substream->private_data;
|
||||
prtd = asoc_substream_to_rtd(substream);
|
||||
rtd = substream->runtime->private_data;
|
||||
card = prtd->card;
|
||||
adata = snd_soc_dai_get_drvdata(dai);
|
||||
|
|
|
@ -217,7 +217,7 @@ static int acp3x_dma_open(struct snd_soc_component *component,
|
|||
int ret;
|
||||
|
||||
runtime = substream->runtime;
|
||||
prtd = substream->private_data;
|
||||
prtd = asoc_substream_to_rtd(substream);
|
||||
component = snd_soc_rtdcom_lookup(prtd, DRV_NAME);
|
||||
adata = dev_get_drvdata(component->dev);
|
||||
i2s_data = kzalloc(sizeof(*i2s_data), GFP_KERNEL);
|
||||
|
@ -258,7 +258,7 @@ static int acp3x_dma_hw_params(struct snd_soc_component *component,
|
|||
struct i2s_dev_data *adata;
|
||||
u64 size;
|
||||
|
||||
prtd = substream->private_data;
|
||||
prtd = asoc_substream_to_rtd(substream);
|
||||
card = prtd->card;
|
||||
pinfo = snd_soc_card_get_drvdata(card);
|
||||
adata = dev_get_drvdata(component->dev);
|
||||
|
@ -340,7 +340,7 @@ static int acp3x_dma_close(struct snd_soc_component *component,
|
|||
struct i2s_dev_data *adata;
|
||||
struct i2s_stream_instance *ins;
|
||||
|
||||
prtd = substream->private_data;
|
||||
prtd = asoc_substream_to_rtd(substream);
|
||||
component = snd_soc_rtdcom_lookup(prtd, DRV_NAME);
|
||||
adata = dev_get_drvdata(component->dev);
|
||||
ins = substream->runtime->private_data;
|
||||
|
|
Loading…
Reference in New Issue