alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] ASoC: Name jack GPIOs based on jack not codec
@ 2011-04-01 20:50 Stephen Warren
  2011-04-01 20:50 ` [PATCH 2/2] ASoC: format_register_str: Don't clip register values Stephen Warren
  2011-04-03 13:18 ` [PATCH 1/2] ASoC: Name jack GPIOs based on jack not codec Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Stephen Warren @ 2011-04-01 20:50 UTC (permalink / raw)
  To: broonie, lrg; +Cc: alsa-devel, Stephen Warren

snd_soc_jack_gpio has a name field. Use that name when registering the IRQ,
since this is far more informative than the codec driver name. This shows
up in /proc/interrupts.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
 sound/soc/soc-jack.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sound/soc/soc-jack.c b/sound/soc/soc-jack.c
index fcab80b..6203a72 100644
--- a/sound/soc/soc-jack.c
+++ b/sound/soc/soc-jack.c
@@ -325,7 +325,7 @@ int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count,
 					      gpio_handler,
 					      IRQF_TRIGGER_RISING |
 					      IRQF_TRIGGER_FALLING,
-					      jack->codec->dev->driver->name,
+					      gpios[i].name,
 					      &gpios[i]);
 		if (ret)
 			goto err;
-- 
1.7.1

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

* [PATCH 2/2] ASoC: format_register_str: Don't clip register values
  2011-04-01 20:50 [PATCH 1/2] ASoC: Name jack GPIOs based on jack not codec Stephen Warren
@ 2011-04-01 20:50 ` Stephen Warren
  2011-04-03 13:18 ` [PATCH 1/2] ASoC: Name jack GPIOs based on jack not codec Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Warren @ 2011-04-01 20:50 UTC (permalink / raw)
  To: broonie, lrg; +Cc: alsa-devel, Stephen Warren

wordsize is used as the textual width of a register address.

regsize is used as the textual width of a register value.

The assignments to these values were swapped. In the case of WM8903, which
has 8-bit register addresses and 16-bit register values, this caused the
register values to be clipped to 2 digits instead of the full 4.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
 sound/soc/soc-core.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 4dda589..b76b74d 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -92,8 +92,8 @@ static int min_bytes_needed(unsigned long val)
 static int format_register_str(struct snd_soc_codec *codec,
 			       unsigned int reg, char *buf, size_t len)
 {
-	int wordsize = codec->driver->reg_word_size * 2;
-	int regsize = min_bytes_needed(codec->driver->reg_cache_size) * 2;
+	int wordsize = min_bytes_needed(codec->driver->reg_cache_size) * 2;
+	int regsize = codec->driver->reg_word_size * 2;
 	int ret;
 	char tmpbuf[len + 1];
 	char regbuf[regsize + 1];
@@ -132,8 +132,8 @@ static ssize_t soc_codec_reg_show(struct snd_soc_codec *codec, char *buf,
 	size_t total = 0;
 	loff_t p = 0;
 
-	wordsize = codec->driver->reg_word_size * 2;
-	regsize = min_bytes_needed(codec->driver->reg_cache_size) * 2;
+	wordsize = min_bytes_needed(codec->driver->reg_cache_size) * 2;
+	regsize = codec->driver->reg_word_size * 2;
 
 	len = wordsize + regsize + 2 + 1;
 
-- 
1.7.1

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

* Re: [PATCH 1/2] ASoC: Name jack GPIOs based on jack not codec
  2011-04-01 20:50 [PATCH 1/2] ASoC: Name jack GPIOs based on jack not codec Stephen Warren
  2011-04-01 20:50 ` [PATCH 2/2] ASoC: format_register_str: Don't clip register values Stephen Warren
@ 2011-04-03 13:18 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2011-04-03 13:18 UTC (permalink / raw)
  To: Stephen Warren; +Cc: alsa-devel, lrg

On Fri, Apr 01, 2011 at 02:50:43PM -0600, Stephen Warren wrote:
> snd_soc_jack_gpio has a name field. Use that name when registering the IRQ,
> since this is far more informative than the codec driver name. This shows
> up in /proc/interrupts.
> 
> Signed-off-by: Stephen Warren <swarren@nvidia.com>

Applied both, thanks.

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

end of thread, other threads:[~2011-04-03 13:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-01 20:50 [PATCH 1/2] ASoC: Name jack GPIOs based on jack not codec Stephen Warren
2011-04-01 20:50 ` [PATCH 2/2] ASoC: format_register_str: Don't clip register values Stephen Warren
2011-04-03 13:18 ` [PATCH 1/2] ASoC: Name jack GPIOs based on jack not codec Mark Brown

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).