Unverified Commit ff96429c authored by Mark Brown's avatar Mark Brown
Browse files

ASoC: cleasnup rtd and its ID

Merge series from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

rtd has own ID, but it is naming "num" for it. The naming is confusable.
This patch rename it to "id".
And many functions request both "rtd" and its "id" as function parameter,
but rtd itself has rtd->id. This patch cleanup it.

And, Qcom driver want to use irregular rtd ID because of its topology,
and thus, soc-core need irregular calculation. I'm not sure why only Qcom
needs such calculation, but this patch also cleanup it.
But I guess we want to cleanup is not soc-core but Qcom side (?)
parents 99348781 8b12da9a
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -216,8 +216,7 @@ void snd_soc_dai_shutdown(struct snd_soc_dai *dai,
			  struct snd_pcm_substream *substream, int rollback);
void snd_soc_dai_suspend(struct snd_soc_dai *dai);
void snd_soc_dai_resume(struct snd_soc_dai *dai);
int snd_soc_dai_compress_new(struct snd_soc_dai *dai,
			     struct snd_soc_pcm_runtime *rtd, int num);
int snd_soc_dai_compress_new(struct snd_soc_dai *dai, struct snd_soc_pcm_runtime *rtd);
bool snd_soc_dai_stream_valid(const struct snd_soc_dai *dai, int stream);
void snd_soc_dai_action(struct snd_soc_dai *dai,
			int stream, int action);
@@ -275,7 +274,7 @@ struct snd_soc_dai_ops {
	int (*probe)(struct snd_soc_dai *dai);
	int (*remove)(struct snd_soc_dai *dai);
	/* compress dai */
	int (*compress_new)(struct snd_soc_pcm_runtime *rtd, int num);
	int (*compress_new)(struct snd_soc_pcm_runtime *rtd);
	/* Optional Callback used at pcm creation*/
	int (*pcm_new)(struct snd_soc_pcm_runtime *rtd,
		       struct snd_soc_dai *dai);
+4 −4
Original line number Diff line number Diff line
@@ -486,11 +486,11 @@ struct snd_soc_component *snd_soc_lookup_component_nolocked(struct device *dev,
struct snd_soc_component *snd_soc_lookup_component(struct device *dev,
						   const char *driver_name);

int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num);
int soc_new_pcm(struct snd_soc_pcm_runtime *rtd);
#ifdef CONFIG_SND_SOC_COMPRESS
int snd_soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num);
int snd_soc_new_compress(struct snd_soc_pcm_runtime *rtd);
#else
static inline int snd_soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num)
static inline int snd_soc_new_compress(struct snd_soc_pcm_runtime *rtd)
{
	return 0;
}
@@ -1195,7 +1195,7 @@ struct snd_soc_pcm_runtime {
	struct dentry *debugfs_dpcm_root;
#endif

	unsigned int num; /* 0-based and monotonic increasing */
	unsigned int id; /* 0-based and monotonic increasing */
	struct list_head list; /* rtd list of the soc card */

	/* function mark */
+3 −3
Original line number Diff line number Diff line
@@ -275,7 +275,7 @@ static unsigned long akcodec_get_mclk_rate(struct snd_pcm_substream *substream,
	struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
	struct imx_card_data *data = snd_soc_card_get_drvdata(rtd->card);
	const struct imx_card_plat_data *plat_data = data->plat_data;
	struct dai_link_data *link_data = &data->link_data[rtd->num];
	struct dai_link_data *link_data = &data->link_data[rtd->id];
	unsigned int width = slots * slot_width;
	unsigned int rate = params_rate(params);
	int i;
@@ -313,7 +313,7 @@ static int imx_aif_hw_params(struct snd_pcm_substream *substream,
	struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
	struct snd_soc_card *card = rtd->card;
	struct imx_card_data *data = snd_soc_card_get_drvdata(card);
	struct dai_link_data *link_data = &data->link_data[rtd->num];
	struct dai_link_data *link_data = &data->link_data[rtd->id];
	struct imx_card_plat_data *plat_data = data->plat_data;
	struct device *dev = card->dev;
	struct snd_soc_dai *codec_dai;
@@ -435,7 +435,7 @@ static int imx_aif_startup(struct snd_pcm_substream *substream)
	struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
	struct snd_soc_card *card = rtd->card;
	struct imx_card_data *data = snd_soc_card_get_drvdata(card);
	struct dai_link_data *link_data = &data->link_data[rtd->num];
	struct dai_link_data *link_data = &data->link_data[rtd->id];
	static struct snd_pcm_hw_constraint_list constraint_rates;
	static struct snd_pcm_hw_constraint_list constraint_channels;
	int ret = 0;
+5 −5
Original line number Diff line number Diff line
@@ -296,7 +296,7 @@ int simple_util_startup(struct snd_pcm_substream *substream)
{
	struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
	struct simple_util_priv *priv = snd_soc_card_get_drvdata(rtd->card);
	struct simple_dai_props *props = simple_priv_to_props(priv, rtd->num);
	struct simple_dai_props *props = simple_priv_to_props(priv, rtd->id);
	struct simple_util_dai *dai;
	unsigned int fixed_sysclk = 0;
	int i1, i2, i;
@@ -357,7 +357,7 @@ void simple_util_shutdown(struct snd_pcm_substream *substream)
{
	struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
	struct simple_util_priv *priv = snd_soc_card_get_drvdata(rtd->card);
	struct simple_dai_props *props = simple_priv_to_props(priv, rtd->num);
	struct simple_dai_props *props = simple_priv_to_props(priv, rtd->id);
	struct simple_util_dai *dai;
	int i;

@@ -448,7 +448,7 @@ int simple_util_hw_params(struct snd_pcm_substream *substream,
	struct simple_util_dai *pdai;
	struct snd_soc_dai *sdai;
	struct simple_util_priv *priv = snd_soc_card_get_drvdata(rtd->card);
	struct simple_dai_props *props = simple_priv_to_props(priv, rtd->num);
	struct simple_dai_props *props = simple_priv_to_props(priv, rtd->id);
	unsigned int mclk, mclk_fs = 0;
	int i, ret;

@@ -517,7 +517,7 @@ int simple_util_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
				   struct snd_pcm_hw_params *params)
{
	struct simple_util_priv *priv = snd_soc_card_get_drvdata(rtd->card);
	struct simple_dai_props *dai_props = simple_priv_to_props(priv, rtd->num);
	struct simple_dai_props *dai_props = simple_priv_to_props(priv, rtd->id);
	struct simple_util_data *data = &dai_props->adata;
	struct snd_interval *rate = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE);
	struct snd_interval *channels = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS);
@@ -628,7 +628,7 @@ static int simple_init_for_codec2codec(struct snd_soc_pcm_runtime *rtd,
int simple_util_dai_init(struct snd_soc_pcm_runtime *rtd)
{
	struct simple_util_priv *priv = snd_soc_card_get_drvdata(rtd->card);
	struct simple_dai_props *props = simple_priv_to_props(priv, rtd->num);
	struct simple_dai_props *props = simple_priv_to_props(priv, rtd->id);
	struct simple_util_dai *dai;
	int i, ret;

+3 −3
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ static int axg_card_tdm_be_hw_params(struct snd_pcm_substream *substream,
	struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
	struct meson_card *priv = snd_soc_card_get_drvdata(rtd->card);
	struct axg_dai_link_tdm_data *be =
		(struct axg_dai_link_tdm_data *)priv->link_data[rtd->num];
		(struct axg_dai_link_tdm_data *)priv->link_data[rtd->id];

	return meson_card_i2s_set_sysclk(substream, params, be->mclk_fs);
}
@@ -56,7 +56,7 @@ static int axg_card_tdm_dai_init(struct snd_soc_pcm_runtime *rtd)
{
	struct meson_card *priv = snd_soc_card_get_drvdata(rtd->card);
	struct axg_dai_link_tdm_data *be =
		(struct axg_dai_link_tdm_data *)priv->link_data[rtd->num];
		(struct axg_dai_link_tdm_data *)priv->link_data[rtd->id];
	struct snd_soc_dai *codec_dai;
	int ret, i;

@@ -86,7 +86,7 @@ static int axg_card_tdm_dai_lb_init(struct snd_soc_pcm_runtime *rtd)
{
	struct meson_card *priv = snd_soc_card_get_drvdata(rtd->card);
	struct axg_dai_link_tdm_data *be =
		(struct axg_dai_link_tdm_data *)priv->link_data[rtd->num];
		(struct axg_dai_link_tdm_data *)priv->link_data[rtd->id];
	int ret;

	/* The loopback rx_mask is the pad tx_mask */
Loading