All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Liam Girdwood <lrg@slimlogic.co.uk>
Cc: alsa-devel@alsa-project.org, patches@opensource.wolfsonmicro.com,
	Mark Brown <broonie@opensource.wolfsonmicro.com>
Subject: [PATCH] ASoC: Fix type for snd_soc_volatile_register()
Date: Mon, 24 Jan 2011 12:39:32 +0000	[thread overview]
Message-ID: <1295872772-6308-1-git-send-email-broonie@opensource.wolfsonmicro.com> (raw)

We generally refer to registers as unsigned ints (including in the
underlying CODEC driver operation).

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 include/sound/soc.h  |    3 ++-
 sound/soc/soc-core.c |   22 +++++++++++++++++++++-
 2 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/include/sound/soc.h b/include/sound/soc.h
index c184f84..1355ef0 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -267,7 +267,8 @@ int snd_soc_register_codec(struct device *dev,
 		const struct snd_soc_codec_driver *codec_drv,
 		struct snd_soc_dai_driver *dai_drv, int num_dai);
 void snd_soc_unregister_codec(struct device *dev);
-int snd_soc_codec_volatile_register(struct snd_soc_codec *codec, int reg);
+int snd_soc_codec_volatile_register(struct snd_soc_codec *codec,
+				    unsigned int reg);
 int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec,
 			       int addr_bits, int data_bits,
 			       enum snd_soc_control_type control);
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index b0e7689..ba81892 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -2029,7 +2029,8 @@ static int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num)
  *
  * Boolean function indiciating if a CODEC register is volatile.
  */
-int snd_soc_codec_volatile_register(struct snd_soc_codec *codec, int reg)
+int snd_soc_codec_volatile_register(struct snd_soc_codec *codec,
+				    unsigned int reg)
 {
 	if (codec->volatile_register)
 		return codec->volatile_register(codec, reg);
@@ -2039,6 +2040,25 @@ int snd_soc_codec_volatile_register(struct snd_soc_codec *codec, int reg)
 EXPORT_SYMBOL_GPL(snd_soc_codec_volatile_register);
 
 /**
+ * snd_soc_codec_register_name: Return a plain text register name
+ *
+ * @codec: CODEC to query.
+ * @reg: Register to query for.
+ *
+ * Returns a string with a plain text name for the register, or NULL
+ * if none is available.
+ */
+const char *snd_soc_codec_register_name(struct snd_soc_codec *codec,
+					unsigned int reg)
+{
+	if (codec->volatile_register)
+		return codec->register_name(codec, reg);
+	else
+		return NULL;
+}
+EXPORT_SYMBOL_GPL(snd_soc_codec_register_name);
+
+/**
  * snd_soc_new_ac97_codec - initailise AC97 device
  * @codec: audio codec
  * @ops: AC97 bus operations
-- 
1.7.2.3

             reply	other threads:[~2011-01-24 12:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-24 12:39 Mark Brown [this message]
2011-01-24 12:41 ` [PATCH] ASoC: Fix type for snd_soc_volatile_register() Mark Brown

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=1295872772-6308-1-git-send-email-broonie@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=lrg@slimlogic.co.uk \
    --cc=patches@opensource.wolfsonmicro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.