summaryrefslogtreecommitdiff
path: root/sound/soc/stm/stm32_adfsdm.c
diff options
context:
space:
mode:
authorOlivier Moysan <olivier.moysan@st.com>2020-11-21 19:14:56 +0300
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2020-12-03 22:32:40 +0300
commit9afaf9a5b80e6f4fd29a9d04476f2f1a0a8fd995 (patch)
tree83e28df607f2d199596d88fd85ba8638051376e2 /sound/soc/stm/stm32_adfsdm.c
parent29e96f5a6e8178277a05c80e58ad056c5e68b934 (diff)
downloadlinux-9afaf9a5b80e6f4fd29a9d04476f2f1a0a8fd995.tar.xz
ASoC: stm32: dfsdm: add stm32_adfsdm_dummy_cb() callback
Adapt STM32 DFSDM driver to a change in iio_channel_get_all_cb() API. The callback pointer becomes a requested parameter of this API, so add a dummy callback to be given as parameter of this function. However, the stm32_dfsdm_get_buff_cb() API is still used instead, to optimize DMA transfers. Signed-off-by: Olivier Moysan <olivier.moysan@st.com> Signed-off-by: Nuno Sá <nuno.sa@analog.com> Acked-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20201121161457.957-2-nuno.sa@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'sound/soc/stm/stm32_adfsdm.c')
-rw-r--r--sound/soc/stm/stm32_adfsdm.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/sound/soc/stm/stm32_adfsdm.c b/sound/soc/stm/stm32_adfsdm.c
index c4031988f981..47fae8dd20b4 100644
--- a/sound/soc/stm/stm32_adfsdm.c
+++ b/sound/soc/stm/stm32_adfsdm.c
@@ -293,6 +293,16 @@ static int stm32_adfsdm_pcm_new(struct snd_soc_component *component,
return 0;
}
+static int stm32_adfsdm_dummy_cb(const void *data, void *private)
+{
+ /*
+ * This dummmy callback is requested by iio_channel_get_all_cb() API,
+ * but the stm32_dfsdm_get_buff_cb() API is used instead, to optimize
+ * DMA transfers.
+ */
+ return 0;
+}
+
static struct snd_soc_component_driver stm32_adfsdm_soc_platform = {
.open = stm32_adfsdm_pcm_open,
.close = stm32_adfsdm_pcm_close,
@@ -335,7 +345,7 @@ static int stm32_adfsdm_probe(struct platform_device *pdev)
if (IS_ERR(priv->iio_ch))
return PTR_ERR(priv->iio_ch);
- priv->iio_cb = iio_channel_get_all_cb(&pdev->dev, NULL, NULL);
+ priv->iio_cb = iio_channel_get_all_cb(&pdev->dev, &stm32_adfsdm_dummy_cb, NULL);
if (IS_ERR(priv->iio_cb))
return PTR_ERR(priv->iio_cb);