mirror of https://gitee.com/openkylin/linux.git
ASoC: ti: 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/87tuy30yv5.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
3e44c47979
commit
02cde14ab5
|
@ -28,7 +28,7 @@ struct snd_soc_card_drvdata_davinci {
|
|||
|
||||
static int evm_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 *soc_card = rtd->card;
|
||||
struct snd_soc_card_drvdata_davinci *drvdata =
|
||||
snd_soc_card_get_drvdata(soc_card);
|
||||
|
@ -41,7 +41,7 @@ static int evm_startup(struct snd_pcm_substream *substream)
|
|||
|
||||
static void evm_shutdown(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 *soc_card = rtd->card;
|
||||
struct snd_soc_card_drvdata_davinci *drvdata =
|
||||
snd_soc_card_get_drvdata(soc_card);
|
||||
|
@ -53,7 +53,7 @@ static void evm_shutdown(struct snd_pcm_substream *substream)
|
|||
static int evm_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_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_card *soc_card = rtd->card;
|
||||
|
|
|
@ -41,7 +41,7 @@ struct davinci_vcif_dev {
|
|||
|
||||
static void davinci_vcif_start(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 davinci_vcif_dev *davinci_vcif_dev =
|
||||
snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(rtd, 0));
|
||||
struct davinci_vc *davinci_vc = davinci_vcif_dev->davinci_vc;
|
||||
|
@ -60,7 +60,7 @@ static void davinci_vcif_start(struct snd_pcm_substream *substream)
|
|||
|
||||
static void davinci_vcif_stop(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 davinci_vcif_dev *davinci_vcif_dev =
|
||||
snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(rtd, 0));
|
||||
struct davinci_vc *davinci_vc = davinci_vcif_dev->davinci_vc;
|
||||
|
|
|
@ -249,7 +249,7 @@ static int j721e_rule_rate(struct snd_pcm_hw_params *params,
|
|||
|
||||
static int j721e_audio_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 j721e_priv *priv = snd_soc_card_get_drvdata(rtd->card);
|
||||
unsigned int domain_id = rtd->dai_link->id;
|
||||
struct j721e_audio_domain *domain = &priv->audio_domains[domain_id];
|
||||
|
@ -300,7 +300,7 @@ static int j721e_audio_startup(struct snd_pcm_substream *substream)
|
|||
static int j721e_audio_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_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
struct j721e_priv *priv = snd_soc_card_get_drvdata(card);
|
||||
unsigned int domain_id = rtd->dai_link->id;
|
||||
|
@ -367,7 +367,7 @@ static int j721e_audio_hw_params(struct snd_pcm_substream *substream,
|
|||
|
||||
static void j721e_audio_shutdown(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 j721e_priv *priv = snd_soc_card_get_drvdata(rtd->card);
|
||||
unsigned int domain_id = rtd->dai_link->id;
|
||||
struct j721e_audio_domain *domain = &priv->audio_domains[domain_id];
|
||||
|
|
|
@ -84,7 +84,7 @@ static void n810_ext_control(struct snd_soc_dapm_context *dapm)
|
|||
static int n810_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);
|
||||
|
||||
snd_pcm_hw_constraint_single(runtime, SNDRV_PCM_HW_PARAM_CHANNELS, 2);
|
||||
|
||||
|
@ -100,7 +100,7 @@ static void n810_shutdown(struct snd_pcm_substream *substream)
|
|||
static int n810_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_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
|
||||
int err;
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ static struct platform_device *dmic_codec_dev;
|
|||
static int omap_abe_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_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
struct abe_twl6040 *priv = snd_soc_card_get_drvdata(card);
|
||||
|
@ -77,7 +77,7 @@ static const struct snd_soc_ops omap_abe_ops = {
|
|||
static int omap_abe_dmic_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_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
|
||||
int ret = 0;
|
||||
|
||||
|
|
|
@ -731,7 +731,7 @@ static int omap_mcbsp_init(struct platform_device *pdev)
|
|||
static void omap_mcbsp_set_threshold(struct snd_pcm_substream *substream,
|
||||
unsigned int packet_size)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
|
||||
struct omap_mcbsp *mcbsp = snd_soc_dai_get_drvdata(cpu_dai);
|
||||
int words;
|
||||
|
@ -896,7 +896,7 @@ static snd_pcm_sframes_t omap_mcbsp_dai_delay(
|
|||
struct snd_pcm_substream *substream,
|
||||
struct snd_soc_dai *dai)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
|
||||
struct omap_mcbsp *mcbsp = snd_soc_dai_get_drvdata(cpu_dai);
|
||||
u16 fifo_use;
|
||||
|
|
|
@ -38,7 +38,7 @@ struct omap_twl4030 {
|
|||
static int omap_twl4030_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_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
unsigned int fmt;
|
||||
|
||||
switch (params_channels(params)) {
|
||||
|
|
|
@ -31,7 +31,7 @@ static struct regulator *omap3pandora_dac_reg;
|
|||
static int omap3pandora_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_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);
|
||||
int ret;
|
||||
|
|
|
@ -38,7 +38,7 @@ static void osk_shutdown(struct snd_pcm_substream *substream)
|
|||
static int osk_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_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
|
||||
int err;
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@ static void rx51_ext_control(struct snd_soc_dapm_context *dapm)
|
|||
static int rx51_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;
|
||||
|
||||
snd_pcm_hw_constraint_single(runtime, SNDRV_PCM_HW_PARAM_CHANNELS, 2);
|
||||
|
@ -102,7 +102,7 @@ static int rx51_startup(struct snd_pcm_substream *substream)
|
|||
static int rx51_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_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
|
||||
|
||||
/* Set the codec system clock for DAC and ADC */
|
||||
|
|
Loading…
Reference in New Issue