All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
To: Mark Brown <broonie@kernel.org>
Cc: Linux-Kernel <linux-kernel@vger.kernel.org>,
	Greg KH <gregkh@linuxfoundation.org>,
	shiiba <naoya.shiiba.nx@renesas.com>
Subject: [PATCH 4/4][RFC] ASoC: rsnd: gen: add rsnd_force_write()
Date: Tue, 16 Jun 2015 08:53:11 +0000	[thread overview]
Message-ID: <87zj40hw9i.wl%kuninori.morimoto.gx@renesas.com> (raw)
In-Reply-To: <87616ojaw9.wl%kuninori.morimoto.gx@renesas.com>

rsnd_force_write() is similar to rsnd_write(),
but rsnd_force_write() write data to register even though
it is same value.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/sh/rcar/gen.c  | 16 ++++++++++++++++
 sound/soc/sh/rcar/rsnd.h |  4 ++++
 2 files changed, 20 insertions(+)

diff --git a/sound/soc/sh/rcar/gen.c b/sound/soc/sh/rcar/gen.c
index 8c7dc51..48f704b 100644
--- a/sound/soc/sh/rcar/gen.c
+++ b/sound/soc/sh/rcar/gen.c
@@ -103,6 +103,22 @@ void rsnd_write(struct rsnd_priv *priv,
 	regmap_fields_write(gen->regs[reg], rsnd_mod_id(mod), data);
 }
 
+void rsnd_force_write(struct rsnd_priv *priv,
+		      struct rsnd_mod *mod,
+		      enum rsnd_reg reg, u32 data)
+{
+	struct device *dev = rsnd_priv_to_dev(priv);
+	struct rsnd_gen *gen = rsnd_priv_to_gen(priv);
+
+	if (!rsnd_is_accessible_reg(priv, gen, reg))
+		return;
+
+	dev_dbg(dev, "w %s[%d] - %4d : %08x\n",
+		rsnd_mod_name(mod), rsnd_mod_id(mod), reg, data);
+
+	regmap_fields_force_write(gen->regs[reg], rsnd_mod_id(mod), data);
+}
+
 void rsnd_bset(struct rsnd_priv *priv, struct rsnd_mod *mod,
 	       enum rsnd_reg reg, u32 mask, u32 data)
 {
diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h
index 03ff071..9760183 100644
--- a/sound/soc/sh/rcar/rsnd.h
+++ b/sound/soc/sh/rcar/rsnd.h
@@ -157,12 +157,16 @@ struct rsnd_dai_stream;
 	rsnd_read(rsnd_mod_to_priv(m), m, RSND_REG_##r)
 #define rsnd_mod_write(m, r, d) \
 	rsnd_write(rsnd_mod_to_priv(m), m, RSND_REG_##r, d)
+#define rsnd_mod_force_write(m, r, d) \
+	rsnd_force_write(rsnd_mod_to_priv(m), m, RSND_REG_##r, d)
 #define rsnd_mod_bset(m, r, s, d) \
 	rsnd_bset(rsnd_mod_to_priv(m), m, RSND_REG_##r, s, d)
 
 u32 rsnd_read(struct rsnd_priv *priv, struct rsnd_mod *mod, enum rsnd_reg reg);
 void rsnd_write(struct rsnd_priv *priv, struct rsnd_mod *mod,
 		enum rsnd_reg reg, u32 data);
+void rsnd_force_write(struct rsnd_priv *priv, struct rsnd_mod *mod,
+		enum rsnd_reg reg, u32 data);
 void rsnd_bset(struct rsnd_priv *priv, struct rsnd_mod *mod, enum rsnd_reg reg,
 		    u32 mask, u32 data);
 u32 rsnd_get_adinr(struct rsnd_mod *mod);
-- 
1.9.1


  parent reply	other threads:[~2015-06-16  8:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-16  8:51 [PATCH 0/4][RFC] regmap: add force write option Kuninori Morimoto
2015-06-16  8:52 ` [PATCH 1/4][RFC] regmap: add force_write option on _regmap_update_bits() Kuninori Morimoto
2015-07-10 10:40   ` Applied "regmap: add force_write option on _regmap_update_bits()" to the regmap tree Mark Brown
2015-06-16  8:52 ` [PATCH 2/4][RFC] regmap: add regmap_write_bits() Kuninori Morimoto
2015-07-10 10:40   ` Applied "regmap: add regmap_write_bits()" to the regmap tree Mark Brown
2015-06-16  8:52 ` [PATCH 3/4][RFC] regmap: add regmap_fields_force_write() Kuninori Morimoto
2015-07-10 10:40   ` Applied "regmap: add regmap_fields_force_write()" to the regmap tree Mark Brown
2015-06-16  8:53 ` Kuninori Morimoto [this message]
2015-07-02  7:07 ` [PATCH 0/4][RFC] regmap: add force write option Kuninori Morimoto
2015-07-03 12:48   ` Mark Brown
2015-07-08  0:52     ` Kuninori Morimoto
2015-07-02  7:46 ` Lars-Peter Clausen
2015-07-02  8:58   ` Kuninori Morimoto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zj40hw9i.wl%kuninori.morimoto.gx@renesas.com \
    --to=kuninori.morimoto.gx@renesas.com \
    --cc=broonie@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=naoya.shiiba.nx@renesas.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.