All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: soc-core: Remove display_register() callback
@ 2011-02-02 10:20 Dimitris Papastamos
  2011-02-02 10:23 ` Mark Brown
  0 siblings, 1 reply; 5+ messages in thread
From: Dimitris Papastamos @ 2011-02-02 10:20 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood; +Cc: alsa-devel, patches

Remove the display_register() callback as there are no users of it
in the upstream kernel and makes it difficult to unify the format
of the codec_reg file.

Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
---
 include/sound/soc.h  |    2 --
 sound/soc/soc-core.c |   31 +++++++++++++------------------
 2 files changed, 13 insertions(+), 20 deletions(-)

diff --git a/include/sound/soc.h b/include/sound/soc.h
index 4b6c0a8..2e6463f 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -536,8 +536,6 @@ struct snd_soc_codec_driver {
 	/* codec IO */
 	unsigned int (*read)(struct snd_soc_codec *, unsigned int);
 	int (*write)(struct snd_soc_codec *, unsigned int, unsigned int);
-	int (*display_register)(struct snd_soc_codec *, char *,
-				size_t, unsigned int);
 	int (*volatile_register)(struct snd_soc_codec *, unsigned int);
 	int (*readable_register)(struct snd_soc_codec *, unsigned int);
 	short reg_cache_size;
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 205cbd7..4c061c3 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -110,24 +110,19 @@ static ssize_t soc_codec_reg_show(struct snd_soc_codec *codec, char *buf)
 		if (count >= PAGE_SIZE - 1)
 			break;
 
-		if (codec->driver->display_register) {
-			count += codec->driver->display_register(codec, buf + count,
-							 PAGE_SIZE - count, i);
-		} else {
-			/* If the read fails it's almost certainly due to
-			 * the register being volatile and the device being
-			 * powered off.
-			 */
-			ret = snd_soc_read(codec, i);
-			if (ret >= 0)
-				count += snprintf(buf + count,
-						  PAGE_SIZE - count,
-						  "%.*x", wordsize, ret);
-			else
-				count += snprintf(buf + count,
-						  PAGE_SIZE - count,
-						  "<no data: %d>", ret);
-		}
+		/* If the read fails it's almost certainly due to
+		 * the register being volatile and the device being
+		 * powered off.
+		 */
+		ret = snd_soc_read(codec, i);
+		if (ret >= 0)
+			count += snprintf(buf + count,
+					  PAGE_SIZE - count,
+					  "%.*x", wordsize, ret);
+		else
+			count += snprintf(buf + count,
+					  PAGE_SIZE - count,
+					  "<no data: %d>", ret);
 
 		if (count >= PAGE_SIZE - 1)
 			break;
-- 
1.7.3.5

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

* Re: [PATCH] ASoC: soc-core: Remove display_register() callback
  2011-02-02 10:20 [PATCH] ASoC: soc-core: Remove display_register() callback Dimitris Papastamos
@ 2011-02-02 10:23 ` Mark Brown
  2011-02-02 14:50   ` jonsmirl
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2011-02-02 10:23 UTC (permalink / raw)
  To: Dimitris Papastamos; +Cc: alsa-devel, patches, Liam Girdwood

On Wed, Feb 02, 2011 at 10:20:54AM +0000, Dimitris Papastamos wrote:
> Remove the display_register() callback as there are no users of it
> in the upstream kernel and makes it difficult to unify the format
> of the codec_reg file.

> Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>

This was rather strongly requested for some devices with extremely large
registers (128 bits at least IIRC) which may eventually make it to
mainline.  It seems better to just have some sort of fallback for those
devices, if it causes output problems people can always fix those.

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

* Re: [PATCH] ASoC: soc-core: Remove display_register() callback
  2011-02-02 10:23 ` Mark Brown
@ 2011-02-02 14:50   ` jonsmirl
  2011-02-02 14:51     ` Mark Brown
  2011-02-02 14:54     ` Dimitris Papastamos
  0 siblings, 2 replies; 5+ messages in thread
From: jonsmirl @ 2011-02-02 14:50 UTC (permalink / raw)
  To: Mark Brown; +Cc: Dimitris Papastamos, alsa-devel, patches, Liam Girdwood

On Wed, Feb 2, 2011 at 5:23 AM, Mark Brown
<broonie@opensource.wolfsonmicro.com> wrote:
> On Wed, Feb 02, 2011 at 10:20:54AM +0000, Dimitris Papastamos wrote:
>> Remove the display_register() callback as there are no users of it
>> in the upstream kernel and makes it difficult to unify the format
>> of the codec_reg file.
>
>> Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
>
> This was rather strongly requested for some devices with extremely large
> registers (128 bits at least IIRC) which may eventually make it to
> mainline.  It seems better to just have some sort of fallback for those
> devices, if it causes output problems people can always fix those.
>

TI Codec devices have two problems:
1) large registers - up to 128 bits
2) sparse register maps - big gaps between valid register addresses.



-- 
Jon Smirl
jonsmirl@gmail.com

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

* Re: [PATCH] ASoC: soc-core: Remove display_register() callback
  2011-02-02 14:50   ` jonsmirl
@ 2011-02-02 14:51     ` Mark Brown
  2011-02-02 14:54     ` Dimitris Papastamos
  1 sibling, 0 replies; 5+ messages in thread
From: Mark Brown @ 2011-02-02 14:51 UTC (permalink / raw)
  To: jonsmirl; +Cc: Dimitris Papastamos, alsa-devel, patches, Liam Girdwood

On Wed, Feb 02, 2011 at 09:50:40AM -0500, jonsmirl@gmail.com wrote:

> TI Codec devices have two problems:
> 1) large registers - up to 128 bits
> 2) sparse register maps - big gaps between valid register addresses.

The sparse register maps are already very well handled, they're quite
widespread.

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

* Re: [PATCH] ASoC: soc-core: Remove display_register() callback
  2011-02-02 14:50   ` jonsmirl
  2011-02-02 14:51     ` Mark Brown
@ 2011-02-02 14:54     ` Dimitris Papastamos
  1 sibling, 0 replies; 5+ messages in thread
From: Dimitris Papastamos @ 2011-02-02 14:54 UTC (permalink / raw)
  To: jonsmirl; +Cc: alsa-devel, Mark Brown, patches, Liam Girdwood

On Wed, 2011-02-02 at 09:50 -0500, jonsmirl@gmail.com wrote:
> On Wed, Feb 2, 2011 at 5:23 AM, Mark Brown
> <broonie@opensource.wolfsonmicro.com> wrote:
> > On Wed, Feb 02, 2011 at 10:20:54AM +0000, Dimitris Papastamos wrote:
> >> Remove the display_register() callback as there are no users of it
> >> in the upstream kernel and makes it difficult to unify the format
> >> of the codec_reg file.
> >
> >> Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
> >
> > This was rather strongly requested for some devices with extremely large
> > registers (128 bits at least IIRC) which may eventually make it to
> > mainline.  It seems better to just have some sort of fallback for those
> > devices, if it causes output problems people can always fix those.
> >
> 
> TI Codec devices have two problems:
> 1) large registers - up to 128 bits
> 2) sparse register maps - big gaps between valid register addresses.

Yes, I've dropped the patch.

Thanks,
Dimitris

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

end of thread, other threads:[~2011-02-02 14:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-02 10:20 [PATCH] ASoC: soc-core: Remove display_register() callback Dimitris Papastamos
2011-02-02 10:23 ` Mark Brown
2011-02-02 14:50   ` jonsmirl
2011-02-02 14:51     ` Mark Brown
2011-02-02 14:54     ` Dimitris Papastamos

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.