diff mbox

ASoC: wm8741: Drop misleading readable_reg callback implementation

Message ID 1439546281.5150.2.camel@ingics.com (mailing list archive)
State Accepted
Commit 84eac6196c4b3930fc81f9bcd76c4a1a2161fd34
Headers show

Commit Message

Axel Lin Aug. 14, 2015, 9:58 a.m. UTC
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(-)

Comments

Charles Keepax Aug. 18, 2015, 1:09 p.m. UTC | #1
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
diff mbox

Patch

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)