From: "Nuno Sá" <nuno.sa@analog.com>
To: <linux-iio@vger.kernel.org>, <alsa-devel@alsa-project.org>
Cc: Lars-Peter Clausen <lars@metafoo.de>,
Olivier Moysan <olivier.moysan@st.com>,
Liam Girdwood <lgirdwood@gmail.com>,
Arnaud Pouliquen <arnaud.pouliquen@st.com>,
Takashi Iwai <tiwai@suse.com>, Mark Brown <broonie@kernel.org>,
Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
Jonathan Cameron <jic23@kernel.org>
Subject: [PATCH 1/2] ASoC: stm32: dfsdm: add stm32_adfsdm_dummy_cb() callback
Date: Sat, 21 Nov 2020 17:14:56 +0100 [thread overview]
Message-ID: <20201121161457.957-2-nuno.sa@analog.com> (raw)
In-Reply-To: <20201121161457.957-1-nuno.sa@analog.com>
From: Olivier Moysan <olivier.moysan@st.com>
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>
---
sound/soc/stm/stm32_adfsdm.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/sound/soc/stm/stm32_adfsdm.c b/sound/soc/stm/stm32_adfsdm.c
index ec27c13af04f..fb9df3caba12 100644
--- a/sound/soc/stm/stm32_adfsdm.c
+++ b/sound/soc/stm/stm32_adfsdm.c
@@ -295,6 +295,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,
@@ -337,7 +347,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);
--
2.17.1
next prev parent reply other threads:[~2020-11-21 16:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-21 16:14 [PATCH 0/2] Make cb a required parameter of buffer-cb Nuno Sá
2020-11-21 16:14 ` Nuno Sá [this message]
2020-11-23 13:51 ` [PATCH 1/2] ASoC: stm32: dfsdm: add stm32_adfsdm_dummy_cb() callback Mark Brown
2020-11-21 16:14 ` [PATCH 2/2] iio: buffer: Return error if no callback is given Nuno Sá
2020-11-23 8:40 ` Olivier MOYSAN
2020-11-22 16:19 ` [PATCH 0/2] Make cb a required parameter of buffer-cb Jonathan Cameron
2020-11-28 13:25 ` Jonathan Cameron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201121161457.957-2-nuno.sa@analog.com \
--to=nuno.sa@analog.com \
--cc=alsa-devel@alsa-project.org \
--cc=arnaud.pouliquen@st.com \
--cc=broonie@kernel.org \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=lgirdwood@gmail.com \
--cc=linux-iio@vger.kernel.org \
--cc=olivier.moysan@st.com \
--cc=pmeerw@pmeerw.net \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).