mirror of
https://github.com/torvalds/linux.git
synced 2024-11-30 16:11:38 +00:00
ASoC: kirkwood: replace platform to component
Now platform can be replaced to component, let's do it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
ddce03ceea
commit
f98fc0f815
@ -318,7 +318,8 @@ static void kirkwood_dma_free_dma_buffers(struct snd_pcm *pcm)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const struct snd_soc_platform_driver kirkwood_soc_platform = {
|
const struct snd_soc_component_driver kirkwood_soc_component = {
|
||||||
|
.name = DRV_NAME,
|
||||||
.ops = &kirkwood_dma_ops,
|
.ops = &kirkwood_dma_ops,
|
||||||
.pcm_new = kirkwood_dma_new,
|
.pcm_new = kirkwood_dma_new,
|
||||||
.pcm_free = kirkwood_dma_free_dma_buffers,
|
.pcm_free = kirkwood_dma_free_dma_buffers,
|
||||||
|
@ -26,8 +26,6 @@
|
|||||||
|
|
||||||
#include "kirkwood.h"
|
#include "kirkwood.h"
|
||||||
|
|
||||||
#define DRV_NAME "mvebu-audio"
|
|
||||||
|
|
||||||
#define KIRKWOOD_I2S_FORMATS \
|
#define KIRKWOOD_I2S_FORMATS \
|
||||||
(SNDRV_PCM_FMTBIT_S16_LE | \
|
(SNDRV_PCM_FMTBIT_S16_LE | \
|
||||||
SNDRV_PCM_FMTBIT_S24_LE | \
|
SNDRV_PCM_FMTBIT_S24_LE | \
|
||||||
@ -524,10 +522,6 @@ static struct snd_soc_dai_driver kirkwood_i2s_dai_extclk[2] = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct snd_soc_component_driver kirkwood_i2s_component = {
|
|
||||||
.name = DRV_NAME,
|
|
||||||
};
|
|
||||||
|
|
||||||
static int kirkwood_i2s_dev_probe(struct platform_device *pdev)
|
static int kirkwood_i2s_dev_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct kirkwood_asoc_platform_data *data = pdev->dev.platform_data;
|
struct kirkwood_asoc_platform_data *data = pdev->dev.platform_data;
|
||||||
@ -601,24 +595,17 @@ static int kirkwood_i2s_dev_probe(struct platform_device *pdev)
|
|||||||
priv->ctl_rec |= KIRKWOOD_RECCTL_BURST_128;
|
priv->ctl_rec |= KIRKWOOD_RECCTL_BURST_128;
|
||||||
}
|
}
|
||||||
|
|
||||||
err = snd_soc_register_component(&pdev->dev, &kirkwood_i2s_component,
|
err = devm_snd_soc_register_component(&pdev->dev, &kirkwood_soc_component,
|
||||||
soc_dai, 2);
|
soc_dai, 2);
|
||||||
if (err) {
|
if (err) {
|
||||||
dev_err(&pdev->dev, "snd_soc_register_component failed\n");
|
dev_err(&pdev->dev, "snd_soc_register_component failed\n");
|
||||||
goto err_component;
|
goto err_component;
|
||||||
}
|
}
|
||||||
|
|
||||||
err = snd_soc_register_platform(&pdev->dev, &kirkwood_soc_platform);
|
|
||||||
if (err) {
|
|
||||||
dev_err(&pdev->dev, "snd_soc_register_platform failed\n");
|
|
||||||
goto err_platform;
|
|
||||||
}
|
|
||||||
|
|
||||||
kirkwood_i2s_init(priv);
|
kirkwood_i2s_init(priv);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
err_platform:
|
|
||||||
snd_soc_unregister_component(&pdev->dev);
|
|
||||||
err_component:
|
err_component:
|
||||||
if (!IS_ERR(priv->extclk))
|
if (!IS_ERR(priv->extclk))
|
||||||
clk_disable_unprepare(priv->extclk);
|
clk_disable_unprepare(priv->extclk);
|
||||||
@ -631,9 +618,6 @@ static int kirkwood_i2s_dev_remove(struct platform_device *pdev)
|
|||||||
{
|
{
|
||||||
struct kirkwood_dma_data *priv = dev_get_drvdata(&pdev->dev);
|
struct kirkwood_dma_data *priv = dev_get_drvdata(&pdev->dev);
|
||||||
|
|
||||||
snd_soc_unregister_platform(&pdev->dev);
|
|
||||||
snd_soc_unregister_component(&pdev->dev);
|
|
||||||
|
|
||||||
if (!IS_ERR(priv->extclk))
|
if (!IS_ERR(priv->extclk))
|
||||||
clk_disable_unprepare(priv->extclk);
|
clk_disable_unprepare(priv->extclk);
|
||||||
clk_disable_unprepare(priv->clk);
|
clk_disable_unprepare(priv->clk);
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
#ifndef _KIRKWOOD_AUDIO_H
|
#ifndef _KIRKWOOD_AUDIO_H
|
||||||
#define _KIRKWOOD_AUDIO_H
|
#define _KIRKWOOD_AUDIO_H
|
||||||
|
|
||||||
|
#define DRV_NAME "mvebu-audio"
|
||||||
|
|
||||||
#define KIRKWOOD_RECORD_WIN 0
|
#define KIRKWOOD_RECORD_WIN 0
|
||||||
#define KIRKWOOD_PLAYBACK_WIN 1
|
#define KIRKWOOD_PLAYBACK_WIN 1
|
||||||
#define KIRKWOOD_MAX_AUDIO_WIN 2
|
#define KIRKWOOD_MAX_AUDIO_WIN 2
|
||||||
@ -143,6 +145,6 @@ struct kirkwood_dma_data {
|
|||||||
int burst;
|
int burst;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern const struct snd_soc_platform_driver kirkwood_soc_platform;
|
extern const struct snd_soc_component_driver kirkwood_soc_component;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user