From: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
To: vinod.koul@intel.com, broonie@kernel.org
Cc: lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.de,
alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
ckeepax@opensource.wolfsonmicro.com
Subject: [PATCH 1/1] ASoC: soc_compress: Add set_metadata
Date: Mon, 25 Nov 2013 10:16:48 +0000 [thread overview]
Message-ID: <20131125101648.GA1818@opensource.wolfsonmicro.com> (raw)
Pass the set_metadata() calls through to the codec driver.
Signed-off-by: Zhao Weijia <weijia.zhao@capelabs.com>
Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
---
sound/soc/soc-compress.c | 18 +++++++++++++++++-
1 files changed, 17 insertions(+), 1 deletions(-)
diff --git a/sound/soc/soc-compress.c b/sound/soc/soc-compress.c
index 53c9ecd..186802b 100644
--- a/sound/soc/soc-compress.c
+++ b/sound/soc/soc-compress.c
@@ -318,6 +318,21 @@ static int soc_compr_pointer(struct snd_compr_stream *cstream,
mutex_unlock(&rtd->pcm_mutex);
return 0;
}
+static int soc_compr_set_metadata(struct snd_compr_stream *cstream,
+ struct snd_compr_metadata *metadata)
+{
+ struct snd_soc_pcm_runtime *rtd = cstream->private_data;
+ struct snd_soc_platform *platform = rtd->platform;
+
+ mutex_lock_nested(&rtd->pcm_mutex, rtd->pcm_subclass);
+
+ if (platform->driver->compr_ops && platform->driver->compr_ops->set_metadata)
+ platform->driver->compr_ops->set_metadata(cstream, metadata);
+
+ mutex_unlock(&rtd->pcm_mutex);
+ return 0;
+}
+
static int soc_compr_copy(struct snd_compr_stream *cstream,
char __user *buf, size_t count)
@@ -372,7 +387,8 @@ static struct snd_compr_ops soc_compr_ops = {
.pointer = soc_compr_pointer,
.ack = soc_compr_ack,
.get_caps = soc_compr_get_caps,
- .get_codec_caps = soc_compr_get_codec_caps
+ .get_codec_caps = soc_compr_get_codec_caps,
+ .set_metadata = soc_compr_set_metadata,
};
/* create a new compress */
--
1.7.2.5
next reply other threads:[~2013-11-25 10:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-25 10:16 Richard Fitzgerald [this message]
2013-11-28 6:19 ` [PATCH 1/1] ASoC: soc_compress: Add set_metadata Vinod Koul
2013-12-02 11:55 ` Richard Fitzgerald
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=20131125101648.GA1818@opensource.wolfsonmicro.com \
--to=rf@opensource.wolfsonmicro.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=ckeepax@opensource.wolfsonmicro.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.de \
--cc=vinod.koul@intel.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).