mirror of https://gitee.com/openkylin/linux.git
ASoC: stm: stm32_adfsdm: remove snd_pcm_ops
snd_pcm_ops is no longer needed. Let's use component driver callback. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/875zl7af0h.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
a857e073ff
commit
2149908976
|
@ -210,7 +210,8 @@ static int stm32_afsdm_pcm_cb(const void *data, size_t size, void *private)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int stm32_adfsdm_trigger(struct snd_pcm_substream *substream, int cmd)
|
static int stm32_adfsdm_trigger(struct snd_soc_component *component,
|
||||||
|
struct snd_pcm_substream *substream, int cmd)
|
||||||
{
|
{
|
||||||
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
||||||
struct stm32_adfsdm_priv *priv =
|
struct stm32_adfsdm_priv *priv =
|
||||||
|
@ -230,7 +231,8 @@ static int stm32_adfsdm_trigger(struct snd_pcm_substream *substream, int cmd)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int stm32_adfsdm_pcm_open(struct snd_pcm_substream *substream)
|
static int stm32_adfsdm_pcm_open(struct snd_soc_component *component,
|
||||||
|
struct snd_pcm_substream *substream)
|
||||||
{
|
{
|
||||||
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
||||||
struct stm32_adfsdm_priv *priv = snd_soc_dai_get_drvdata(rtd->cpu_dai);
|
struct stm32_adfsdm_priv *priv = snd_soc_dai_get_drvdata(rtd->cpu_dai);
|
||||||
|
@ -243,7 +245,8 @@ static int stm32_adfsdm_pcm_open(struct snd_pcm_substream *substream)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int stm32_adfsdm_pcm_close(struct snd_pcm_substream *substream)
|
static int stm32_adfsdm_pcm_close(struct snd_soc_component *component,
|
||||||
|
struct snd_pcm_substream *substream)
|
||||||
{
|
{
|
||||||
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
||||||
struct stm32_adfsdm_priv *priv =
|
struct stm32_adfsdm_priv *priv =
|
||||||
|
@ -256,6 +259,7 @@ static int stm32_adfsdm_pcm_close(struct snd_pcm_substream *substream)
|
||||||
}
|
}
|
||||||
|
|
||||||
static snd_pcm_uframes_t stm32_adfsdm_pcm_pointer(
|
static snd_pcm_uframes_t stm32_adfsdm_pcm_pointer(
|
||||||
|
struct snd_soc_component *component,
|
||||||
struct snd_pcm_substream *substream)
|
struct snd_pcm_substream *substream)
|
||||||
{
|
{
|
||||||
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
||||||
|
@ -265,7 +269,8 @@ static snd_pcm_uframes_t stm32_adfsdm_pcm_pointer(
|
||||||
return bytes_to_frames(substream->runtime, priv->pos);
|
return bytes_to_frames(substream->runtime, priv->pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int stm32_adfsdm_pcm_hw_params(struct snd_pcm_substream *substream,
|
static int stm32_adfsdm_pcm_hw_params(struct snd_soc_component *component,
|
||||||
|
struct snd_pcm_substream *substream,
|
||||||
struct snd_pcm_hw_params *params)
|
struct snd_pcm_hw_params *params)
|
||||||
{
|
{
|
||||||
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
||||||
|
@ -282,23 +287,16 @@ static int stm32_adfsdm_pcm_hw_params(struct snd_pcm_substream *substream,
|
||||||
params_period_size(params));
|
params_period_size(params));
|
||||||
}
|
}
|
||||||
|
|
||||||
static int stm32_adfsdm_pcm_hw_free(struct snd_pcm_substream *substream)
|
static int stm32_adfsdm_pcm_hw_free(struct snd_soc_component *component,
|
||||||
|
struct snd_pcm_substream *substream)
|
||||||
{
|
{
|
||||||
snd_pcm_lib_free_pages(substream);
|
snd_pcm_lib_free_pages(substream);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct snd_pcm_ops stm32_adfsdm_pcm_ops = {
|
static int stm32_adfsdm_pcm_new(struct snd_soc_component *component,
|
||||||
.open = stm32_adfsdm_pcm_open,
|
struct snd_soc_pcm_runtime *rtd)
|
||||||
.close = stm32_adfsdm_pcm_close,
|
|
||||||
.hw_params = stm32_adfsdm_pcm_hw_params,
|
|
||||||
.hw_free = stm32_adfsdm_pcm_hw_free,
|
|
||||||
.trigger = stm32_adfsdm_trigger,
|
|
||||||
.pointer = stm32_adfsdm_pcm_pointer,
|
|
||||||
};
|
|
||||||
|
|
||||||
static int stm32_adfsdm_pcm_new(struct snd_soc_pcm_runtime *rtd)
|
|
||||||
{
|
{
|
||||||
struct snd_pcm *pcm = rtd->pcm;
|
struct snd_pcm *pcm = rtd->pcm;
|
||||||
struct stm32_adfsdm_priv *priv =
|
struct stm32_adfsdm_priv *priv =
|
||||||
|
@ -310,7 +308,8 @@ static int stm32_adfsdm_pcm_new(struct snd_soc_pcm_runtime *rtd)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void stm32_adfsdm_pcm_free(struct snd_pcm *pcm)
|
static void stm32_adfsdm_pcm_free(struct snd_soc_component *component,
|
||||||
|
struct snd_pcm *pcm)
|
||||||
{
|
{
|
||||||
struct snd_pcm_substream *substream;
|
struct snd_pcm_substream *substream;
|
||||||
|
|
||||||
|
@ -320,9 +319,14 @@ static void stm32_adfsdm_pcm_free(struct snd_pcm *pcm)
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct snd_soc_component_driver stm32_adfsdm_soc_platform = {
|
static struct snd_soc_component_driver stm32_adfsdm_soc_platform = {
|
||||||
.ops = &stm32_adfsdm_pcm_ops,
|
.open = stm32_adfsdm_pcm_open,
|
||||||
.pcm_new = stm32_adfsdm_pcm_new,
|
.close = stm32_adfsdm_pcm_close,
|
||||||
.pcm_free = stm32_adfsdm_pcm_free,
|
.hw_params = stm32_adfsdm_pcm_hw_params,
|
||||||
|
.hw_free = stm32_adfsdm_pcm_hw_free,
|
||||||
|
.trigger = stm32_adfsdm_trigger,
|
||||||
|
.pointer = stm32_adfsdm_pcm_pointer,
|
||||||
|
.pcm_construct = stm32_adfsdm_pcm_new,
|
||||||
|
.pcm_destruct = stm32_adfsdm_pcm_free,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct of_device_id stm32_adfsdm_of_match[] = {
|
static const struct of_device_id stm32_adfsdm_of_match[] = {
|
||||||
|
|
Loading…
Reference in New Issue