ASoC: rsnd: tidyup debug information when read/write
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Wed, 22 Oct 2014 01:13:46 +0000 (18:13 -0700)
committerMark Brown <broonie@kernel.org>
Wed, 22 Oct 2014 22:42:46 +0000 (23:42 +0100)
b8c637864a6904a9ba8e0df556d5bdf9f26b2c54
(ASoC: rsnd: use regmap_mmio instead of original regmap bus)
added regmap_mmio support on Renesas R-Car sound driver.
Then, debug information of register read/write
indicates regmap index, not register address.
This is a little bit confusable information.
This patch tidyup debug message, and added regmap debug hint
on comment area.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sh/rcar/gen.c

index f95e7ab135e83266f958c49801284a6e780744a3..61dee68ffc0dd90d6fc2738ae6fbb584c1b3c38e 100644 (file)
@@ -8,6 +8,17 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
+
+/*
+ * #define DEBUG
+ *
+ * you can also add below in
+ * ${LINUX}/drivers/base/regmap/regmap.c
+ * for regmap debug
+ *
+ * #define LOG_DEVICE "xxxx.rcar_sound"
+ */
+
 #include "rsnd.h"
 
 struct rsnd_gen {
@@ -67,9 +78,10 @@ u32 rsnd_read(struct rsnd_priv *priv,
        if (!rsnd_is_accessible_reg(priv, gen, reg))
                return 0;
 
-       regmap_fields_read(gen->regs[reg], rsnd_mod_id(mod), &val);
+       dev_dbg(dev, "r %s(%d) - %4d : %08x\n",
+               rsnd_mod_name(mod), rsnd_mod_id(mod), reg, val);
 
-       dev_dbg(dev, "r %s - 0x%04d : %08x\n", rsnd_mod_name(mod), reg, val);
+       regmap_fields_read(gen->regs[reg], rsnd_mod_id(mod), &val);
 
        return val;
 }
@@ -84,9 +96,10 @@ void rsnd_write(struct rsnd_priv *priv,
        if (!rsnd_is_accessible_reg(priv, gen, reg))
                return;
 
-       regmap_fields_write(gen->regs[reg], rsnd_mod_id(mod), data);
+       dev_dbg(dev, "w %s(%d) - %4d : %08x\n",
+               rsnd_mod_name(mod), rsnd_mod_id(mod), reg, data);
 
-       dev_dbg(dev, "w %s - 0x%04d : %08x\n", rsnd_mod_name(mod), reg, data);
+       regmap_fields_write(gen->regs[reg], rsnd_mod_id(mod), data);
 }
 
 void rsnd_bset(struct rsnd_priv *priv, struct rsnd_mod *mod,
@@ -98,11 +111,11 @@ void rsnd_bset(struct rsnd_priv *priv, struct rsnd_mod *mod,
        if (!rsnd_is_accessible_reg(priv, gen, reg))
                return;
 
+       dev_dbg(dev, "b %s(%d) - %4d : %08x/%08x\n",
+               rsnd_mod_name(mod), rsnd_mod_id(mod), reg, data, mask);
+
        regmap_fields_update_bits(gen->regs[reg], rsnd_mod_id(mod),
                                  mask, data);
-
-       dev_dbg(dev, "b %s - 0x%04d : %08x/%08x\n",
-               rsnd_mod_name(mod), reg, data, mask);
 }
 
 #define rsnd_gen_regmap_init(priv, id_size, reg_id, conf)              \