public inbox for alsa-devel@alsa-project.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: wm8741: Drop misleading readable_reg callback implementation
@ 2015-08-14  9:58 Axel Lin
  2015-08-18 13:09 ` Charles Keepax
  2015-08-18 16:33 ` Applied "ASoC: wm8741: Drop misleading readable_reg callback implementation" to the asoc tree Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Axel Lin @ 2015-08-14  9:58 UTC (permalink / raw)
  To: Mark Brown; +Cc: Charles Keepax, patches, Liam Girdwood, alsa-devel

regmap_readable() returns false if map->format.format_write is set.
For .reg_bits = 7, .val_bits = 9, setting,
  map->format.format_write = regmap_format_7_9_write;

Even current code has implemented map->readable_reg, regmap_readable()
still returns false anyway. Thus drop the misleading readable_reg callback
implementation.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 sound/soc/codecs/wm8741.c | 21 ---------------------
 1 file changed, 21 deletions(-)

diff --git a/sound/soc/codecs/wm8741.c b/sound/soc/codecs/wm8741.c
index 9723e44..de42c03 100644
--- a/sound/soc/codecs/wm8741.c
+++ b/sound/soc/codecs/wm8741.c
@@ -61,25 +61,6 @@ static const struct reg_default wm8741_reg_defaults[] = {
 	{ 32, 0x0002 },     /* R32 - ADDITONAL_CONTROL_1 */
 };
 
-static bool wm8741_readable(struct device *dev, unsigned int reg)
-{
-	switch (reg) {
-	case WM8741_DACLLSB_ATTENUATION:
-	case WM8741_DACLMSB_ATTENUATION:
-	case WM8741_DACRLSB_ATTENUATION:
-	case WM8741_DACRMSB_ATTENUATION:
-	case WM8741_VOLUME_CONTROL:
-	case WM8741_FORMAT_CONTROL:
-	case WM8741_FILTER_CONTROL:
-	case WM8741_MODE_CONTROL_1:
-	case WM8741_MODE_CONTROL_2:
-	case WM8741_ADDITIONAL_CONTROL_1:
-		return true;
-	default:
-		return false;
-	}
-}
-
 static int wm8741_reset(struct snd_soc_codec *codec)
 {
 	return snd_soc_write(codec, WM8741_RESET, 0);
@@ -541,8 +522,6 @@ static const struct regmap_config wm8741_regmap = {
 	.reg_defaults = wm8741_reg_defaults,
 	.num_reg_defaults = ARRAY_SIZE(wm8741_reg_defaults),
 	.cache_type = REGCACHE_RBTREE,
-
-	.readable_reg = wm8741_readable,
 };
 
 static int wm8741_set_pdata(struct device *dev, struct wm8741_priv *wm8741)
-- 
2.1.0

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

* Re: [PATCH] ASoC: wm8741: Drop misleading readable_reg callback implementation
  2015-08-14  9:58 [PATCH] ASoC: wm8741: Drop misleading readable_reg callback implementation Axel Lin
@ 2015-08-18 13:09 ` Charles Keepax
  2015-08-18 16:33 ` Applied "ASoC: wm8741: Drop misleading readable_reg callback implementation" to the asoc tree Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Charles Keepax @ 2015-08-18 13:09 UTC (permalink / raw)
  To: Axel Lin; +Cc: alsa-devel, Mark Brown, Liam Girdwood, patches

On Fri, Aug 14, 2015 at 05:58:01PM +0800, Axel Lin wrote:
> regmap_readable() returns false if map->format.format_write is set.
> For .reg_bits = 7, .val_bits = 9, setting,
>   map->format.format_write = regmap_format_7_9_write;
> 
> Even current code has implemented map->readable_reg, regmap_readable()
> still returns false anyway. Thus drop the misleading readable_reg callback
> implementation.
> 
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---

Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

Apologies, on the slight delay we have had a bit of an email
fiasco going on at this end, hopefully all resolved now.

Thanks,
Charles

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

* Applied "ASoC: wm8741: Drop misleading readable_reg callback implementation" to the asoc tree
  2015-08-14  9:58 [PATCH] ASoC: wm8741: Drop misleading readable_reg callback implementation Axel Lin
  2015-08-18 13:09 ` Charles Keepax
@ 2015-08-18 16:33 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2015-08-18 16:33 UTC (permalink / raw)
  To: Axel Lin, Charles Keepax, Mark Brown; +Cc: alsa-devel

The patch

   ASoC: wm8741: Drop misleading readable_reg callback implementation

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 84eac6196c4b3930fc81f9bcd76c4a1a2161fd34 Mon Sep 17 00:00:00 2001
From: Axel Lin <axel.lin@ingics.com>
Date: Fri, 14 Aug 2015 17:58:01 +0800
Subject: [PATCH] ASoC: wm8741: Drop misleading readable_reg callback
 implementation

regmap_readable() returns false if map->format.format_write is set.
For .reg_bits = 7, .val_bits = 9, setting,
  map->format.format_write = regmap_format_7_9_write;

Even current code has implemented map->readable_reg, regmap_readable()
still returns false anyway. Thus drop the misleading readable_reg callback
implementation.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/codecs/wm8741.c | 21 ---------------------
 1 file changed, 21 deletions(-)

diff --git a/sound/soc/codecs/wm8741.c b/sound/soc/codecs/wm8741.c
index 506792b..c24c1a3 100644
--- a/sound/soc/codecs/wm8741.c
+++ b/sound/soc/codecs/wm8741.c
@@ -61,25 +61,6 @@ static const struct reg_default wm8741_reg_defaults[] = {
 	{ 32, 0x0002 },     /* R32 - ADDITONAL_CONTROL_1 */
 };
 
-static bool wm8741_readable(struct device *dev, unsigned int reg)
-{
-	switch (reg) {
-	case WM8741_DACLLSB_ATTENUATION:
-	case WM8741_DACLMSB_ATTENUATION:
-	case WM8741_DACRLSB_ATTENUATION:
-	case WM8741_DACRMSB_ATTENUATION:
-	case WM8741_VOLUME_CONTROL:
-	case WM8741_FORMAT_CONTROL:
-	case WM8741_FILTER_CONTROL:
-	case WM8741_MODE_CONTROL_1:
-	case WM8741_MODE_CONTROL_2:
-	case WM8741_ADDITIONAL_CONTROL_1:
-		return true;
-	default:
-		return false;
-	}
-}
-
 static int wm8741_reset(struct snd_soc_codec *codec)
 {
 	return snd_soc_write(codec, WM8741_RESET, 0);
@@ -541,8 +522,6 @@ static const struct regmap_config wm8741_regmap = {
 	.reg_defaults = wm8741_reg_defaults,
 	.num_reg_defaults = ARRAY_SIZE(wm8741_reg_defaults),
 	.cache_type = REGCACHE_RBTREE,
-
-	.readable_reg = wm8741_readable,
 };
 
 static int wm8741_set_pdata(struct device *dev, struct wm8741_priv *wm8741)
-- 
2.5.0

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

end of thread, other threads:[~2015-08-18 16:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-14  9:58 [PATCH] ASoC: wm8741: Drop misleading readable_reg callback implementation Axel Lin
2015-08-18 13:09 ` Charles Keepax
2015-08-18 16:33 ` Applied "ASoC: wm8741: Drop misleading readable_reg callback implementation" to the asoc tree Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox