Commit 7f110661 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: fsl: asrc: replace platform to component

Now platform can be replaced to component, let's do it.
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: default avatarNicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 4cb1ea92
...@@ -582,10 +582,6 @@ static struct snd_soc_dai_driver fsl_asrc_dai = { ...@@ -582,10 +582,6 @@ static struct snd_soc_dai_driver fsl_asrc_dai = {
.ops = &fsl_asrc_dai_ops, .ops = &fsl_asrc_dai_ops,
}; };
static const struct snd_soc_component_driver fsl_asrc_component = {
.name = "fsl-asrc-dai",
};
static bool fsl_asrc_readable_reg(struct device *dev, unsigned int reg) static bool fsl_asrc_readable_reg(struct device *dev, unsigned int reg)
{ {
switch (reg) { switch (reg) {
...@@ -927,12 +923,6 @@ static int fsl_asrc_probe(struct platform_device *pdev) ...@@ -927,12 +923,6 @@ static int fsl_asrc_probe(struct platform_device *pdev)
return ret; return ret;
} }
ret = devm_snd_soc_register_platform(&pdev->dev, &fsl_asrc_platform);
if (ret) {
dev_err(&pdev->dev, "failed to register ASoC platform\n");
return ret;
}
return 0; return 0;
} }
......
...@@ -462,6 +462,7 @@ struct fsl_asrc { ...@@ -462,6 +462,7 @@ struct fsl_asrc {
u32 regcache_cfg; u32 regcache_cfg;
}; };
extern struct snd_soc_platform_driver fsl_asrc_platform; #define DRV_NAME "fsl-asrc-dai"
extern struct snd_soc_component_driver fsl_asrc_component;
struct dma_chan *fsl_asrc_get_dma_channel(struct fsl_asrc_pair *pair, bool dir); struct dma_chan *fsl_asrc_get_dma_channel(struct fsl_asrc_pair *pair, bool dir);
#endif /* _FSL_ASRC_H */ #endif /* _FSL_ASRC_H */
...@@ -64,7 +64,8 @@ static int fsl_asrc_dma_prepare_and_submit(struct snd_pcm_substream *substream) ...@@ -64,7 +64,8 @@ static int fsl_asrc_dma_prepare_and_submit(struct snd_pcm_substream *substream)
struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct snd_pcm_runtime *runtime = substream->runtime; struct snd_pcm_runtime *runtime = substream->runtime;
struct fsl_asrc_pair *pair = runtime->private_data; struct fsl_asrc_pair *pair = runtime->private_data;
struct device *dev = rtd->platform->dev; struct snd_soc_component *component = snd_soc_rtdcom_lookup(rtd, DRV_NAME);
struct device *dev = component->dev;
unsigned long flags = DMA_CTRL_ACK; unsigned long flags = DMA_CTRL_ACK;
/* Prepare and submit Front-End DMA channel */ /* Prepare and submit Front-End DMA channel */
...@@ -137,12 +138,13 @@ static int fsl_asrc_dma_hw_params(struct snd_pcm_substream *substream, ...@@ -137,12 +138,13 @@ static int fsl_asrc_dma_hw_params(struct snd_pcm_substream *substream,
bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
struct snd_dmaengine_dai_dma_data *dma_params_fe = NULL; struct snd_dmaengine_dai_dma_data *dma_params_fe = NULL;
struct snd_dmaengine_dai_dma_data *dma_params_be = NULL; struct snd_dmaengine_dai_dma_data *dma_params_be = NULL;
struct snd_soc_component *component = snd_soc_rtdcom_lookup(rtd, DRV_NAME);
struct snd_pcm_runtime *runtime = substream->runtime; struct snd_pcm_runtime *runtime = substream->runtime;
struct fsl_asrc_pair *pair = runtime->private_data; struct fsl_asrc_pair *pair = runtime->private_data;
struct fsl_asrc *asrc_priv = pair->asrc_priv; struct fsl_asrc *asrc_priv = pair->asrc_priv;
struct dma_slave_config config_fe, config_be; struct dma_slave_config config_fe, config_be;
enum asrc_pair_index index = pair->index; enum asrc_pair_index index = pair->index;
struct device *dev = rtd->platform->dev; struct device *dev = component->dev;
int stream = substream->stream; int stream = substream->stream;
struct imx_dma_data *tmp_data; struct imx_dma_data *tmp_data;
struct snd_soc_dpcm *dpcm; struct snd_soc_dpcm *dpcm;
...@@ -274,7 +276,8 @@ static int fsl_asrc_dma_startup(struct snd_pcm_substream *substream) ...@@ -274,7 +276,8 @@ static int fsl_asrc_dma_startup(struct snd_pcm_substream *substream)
{ {
struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct snd_pcm_runtime *runtime = substream->runtime; struct snd_pcm_runtime *runtime = substream->runtime;
struct device *dev = rtd->platform->dev; struct snd_soc_component *component = snd_soc_rtdcom_lookup(rtd, DRV_NAME);
struct device *dev = component->dev;
struct fsl_asrc *asrc_priv = dev_get_drvdata(dev); struct fsl_asrc *asrc_priv = dev_get_drvdata(dev);
struct fsl_asrc_pair *pair; struct fsl_asrc_pair *pair;
...@@ -381,9 +384,10 @@ static void fsl_asrc_dma_pcm_free(struct snd_pcm *pcm) ...@@ -381,9 +384,10 @@ static void fsl_asrc_dma_pcm_free(struct snd_pcm *pcm)
} }
} }
struct snd_soc_platform_driver fsl_asrc_platform = { struct snd_soc_component_driver fsl_asrc_component = {
.name = DRV_NAME,
.ops = &fsl_asrc_dma_pcm_ops, .ops = &fsl_asrc_dma_pcm_ops,
.pcm_new = fsl_asrc_dma_pcm_new, .pcm_new = fsl_asrc_dma_pcm_new,
.pcm_free = fsl_asrc_dma_pcm_free, .pcm_free = fsl_asrc_dma_pcm_free,
}; };
EXPORT_SYMBOL_GPL(fsl_asrc_platform); EXPORT_SYMBOL_GPL(fsl_asrc_component);
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