All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: linux-kernel@vger.kernel.org,
	Lars-Peter Clausen <lars@metafoo.de>, Liam Girdwood <lrg@ti.com>
Subject: [PATCH 2/5] regmap: Implement regcache_cache_bypass helper function
Date: Tue, 27 Sep 2011 11:25:05 +0100	[thread overview]
Message-ID: <1317119108-15338-3-git-send-email-dp@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1317119108-15338-1-git-send-email-dp@opensource.wolfsonmicro.com>

Ensure we've got a function so users can enable/disable the
cache bypass option.

Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
---
 drivers/base/regmap/regcache.c |   17 +++++++++++++++++
 include/linux/regmap.h         |    1 +
 2 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c
index e2b172b..f2d1a5e 100644
--- a/drivers/base/regmap/regcache.c
+++ b/drivers/base/regmap/regcache.c
@@ -258,6 +258,23 @@ void regcache_cache_only(struct regmap *map, bool enable)
 }
 EXPORT_SYMBOL_GPL(regcache_cache_only);
 
+/**
+ * regcache_cache_bypass: Put a register map into cache bypass mode
+ *
+ * @map: map to configure
+ * @cache_only: flag if changes should not be written to the hardware
+ *
+ * When a register map is marked with the cache bypass option, writes
+ * to the register map API will only update the hardware and not the
+ * the cache directly.  This is useful when syncing the cache back to
+ * the hardware.
+ */
+void regcache_cache_bypass(struct regmap *map, bool enable)
+{
+	map->cache_bypass = enable;
+}
+EXPORT_SYMBOL_GPL(regcache_cache_bypass);
+
 bool regcache_set_val(void *base, unsigned int idx,
 		      unsigned int val, unsigned int word_size)
 {
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index 76ac255..3daac2d 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -142,5 +142,6 @@ int regmap_update_bits(struct regmap *map, unsigned int reg,
 
 int regcache_sync(struct regmap *map);
 void regcache_cache_only(struct regmap *map, bool enable);
+void regcache_cache_bypass(struct regmap *map, bool enable);
 
 #endif
-- 
1.7.6.4


  parent reply	other threads:[~2011-09-27 10:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-27 10:25 [PATCH 0/5] regcache updates Dimitris Papastamos
2011-09-27 10:25 ` [PATCH 1/5] regmap: Fix signed/unsigned comparison Dimitris Papastamos
2011-09-27 12:27   ` Mark Brown
2011-09-27 10:25 ` Dimitris Papastamos [this message]
2011-09-27 19:10   ` [PATCH 2/5] regmap: Implement regcache_cache_bypass helper function Mark Brown
2011-09-27 10:25 ` [PATCH 3/5] regmap: Implement generic syncing functionality Dimitris Papastamos
2011-09-27 19:08   ` Mark Brown
2011-09-27 10:25 ` [PATCH 4/5] regmap: Remove redundant member `word_size' from regcache_rbtree_node Dimitris Papastamos
2011-09-27 19:07   ` Mark Brown
2011-09-27 19:08   ` Mark Brown
2011-09-27 10:25 ` [PATCH 5/5] regmap: Ensure we scream if we enable cache bypass/only at the same time Dimitris Papastamos
2011-09-27 12:28   ` Mark Brown

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=1317119108-15338-3-git-send-email-dp@opensource.wolfsonmicro.com \
    --to=dp@opensource.wolfsonmicro.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=lars@metafoo.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrg@ti.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.