All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: Push snd_soc_write() and snd_soc_read() into the source file
@ 2010-11-01 19:44 Mark Brown
  2010-11-03 13:51 ` Dimitris Papastamos
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Brown @ 2010-11-01 19:44 UTC (permalink / raw)
  To: Liam Girdwood; +Cc: alsa-devel, patches, Mark Brown

Facilitating adding trace type stuff. For a first pass add some dev_dbg()
statements into them.

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

diff --git a/include/sound/soc.h b/include/sound/soc.h
index 5c3bce8..aaf34d7 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -639,17 +639,9 @@ struct soc_enum {
 };
 
 /* codec IO */
-static inline unsigned int snd_soc_read(struct snd_soc_codec *codec,
-					unsigned int reg)
-{
-	return codec->driver->read(codec, reg);
-}
-
-static inline unsigned int snd_soc_write(struct snd_soc_codec *codec,
-					 unsigned int reg, unsigned int val)
-{
-	return codec->driver->write(codec, reg, val);
-}
+unsigned int snd_soc_read(struct snd_soc_codec *codec, unsigned int reg);
+unsigned int snd_soc_write(struct snd_soc_codec *codec,
+			   unsigned int reg, unsigned int val);
 
 /* device driver data */
 
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 805343f..6d93d44 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1876,6 +1876,25 @@ void snd_soc_free_ac97_codec(struct snd_soc_codec *codec)
 }
 EXPORT_SYMBOL_GPL(snd_soc_free_ac97_codec);
 
+unsigned int snd_soc_read(struct snd_soc_codec *codec, unsigned int reg)
+{
+	unsigned int ret;
+
+	ret = codec->driver->read(codec, reg);
+	dev_dbg(codec->dev, "read %x => %x\n", reg, ret);
+
+	return ret;
+}
+EXPORT_SYMBOL_GPL(snd_soc_read);
+
+unsigned int snd_soc_write(struct snd_soc_codec *codec,
+			   unsigned int reg, unsigned int val)
+{
+	dev_dbg(codec->dev, "write %x = %x\n", reg, val);
+	return codec->driver->write(codec, reg, val);
+}
+EXPORT_SYMBOL_GPL(snd_soc_write);
+
 /**
  * snd_soc_update_bits - update codec register bits
  * @codec: audio codec
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ASoC: Push snd_soc_write() and snd_soc_read() into the source file
  2010-11-01 19:44 [PATCH] ASoC: Push snd_soc_write() and snd_soc_read() into the source file Mark Brown
@ 2010-11-03 13:51 ` Dimitris Papastamos
  2010-11-03 16:30   ` Mark Brown
  0 siblings, 1 reply; 3+ messages in thread
From: Dimitris Papastamos @ 2010-11-03 13:51 UTC (permalink / raw)
  To: Mark Brown; +Cc: alsa-devel, patches, Liam Girdwood

On Mon, 2010-11-01 at 15:44 -0400, Mark Brown wrote:
> +unsigned int snd_soc_write(struct snd_soc_codec *codec,
> +			   unsigned int reg, unsigned int val)
> +{
> +	dev_dbg(codec->dev, "write %x = %x\n", reg, val);
> +	return codec->driver->write(codec, reg, val);
> +}
> +EXPORT_SYMBOL_GPL(snd_soc_write);

This sort of debugging output is already present in soc-cache.c.  I
guess it should be removed from soc-cache.c since it is duplicated
across all different write() I/O types.

Thanks,
Dimitrios

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ASoC: Push snd_soc_write() and snd_soc_read() into the source file
  2010-11-03 13:51 ` Dimitris Papastamos
@ 2010-11-03 16:30   ` Mark Brown
  0 siblings, 0 replies; 3+ messages in thread
From: Mark Brown @ 2010-11-03 16:30 UTC (permalink / raw)
  To: Dimitris Papastamos; +Cc: alsa-devel, patches, Liam Girdwood

On Wed, Nov 03, 2010 at 01:51:48PM +0000, Dimitris Papastamos wrote:
> On Mon, 2010-11-01 at 15:44 -0400, Mark Brown wrote:
> > +unsigned int snd_soc_write(struct snd_soc_codec *codec,
> > +			   unsigned int reg, unsigned int val)
> > +{
> > +	dev_dbg(codec->dev, "write %x = %x\n", reg, val);
> > +	return codec->driver->write(codec, reg, val);
> > +}
> > +EXPORT_SYMBOL_GPL(snd_soc_write);

> This sort of debugging output is already present in soc-cache.c.  I
> guess it should be removed from soc-cache.c since it is duplicated
> across all different write() I/O types.

That's the idea; this is much fewer lines of code and also covers all
the MFDs and whatnot that can't use the soc-cache code for whatever
reasons.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-11-03 16:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-01 19:44 [PATCH] ASoC: Push snd_soc_write() and snd_soc_read() into the source file Mark Brown
2010-11-03 13:51 ` Dimitris Papastamos
2010-11-03 16:30   ` Mark Brown

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.