mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: linux-kernel@vger.kernel.org
Cc: patches@opensource.wolfsonmicro.com,
	Mark Brown <broonie@opensource.wolfsonmicro.com>
Subject: [PATCH 1/2] regmap: Add precious registers to the driver interface
Date: Mon,  8 Aug 2011 15:44:31 +0900	[thread overview]
Message-ID: <1312785872-19629-1-git-send-email-broonie@opensource.wolfsonmicro.com> (raw)

Some devices are sensitive to reads on their registers, especially for
things like clear on read interrupt status registers. Avoid creating
problems with these with things like debugfs by allowing drivers to tell
the core about them. If a register is marked as precious then the core
will not internally generate any reads of it.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 include/linux/regmap.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index aef2b36..c878a4b 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -33,6 +33,9 @@ struct spi_device;
  *                     can be read from.
  * @volatile_register: Optional callback returning true if the register
  *                     value can't be cached.
+ * @precious_register: Optional callback returning true if the rgister
+ *                     should not be read outside of a call from the driver
+ *                     (eg, a clear on read interrupt status register).
  */
 struct regmap_config {
 	int reg_bits;
@@ -42,6 +45,7 @@ struct regmap_config {
 	bool (*writeable_reg)(struct device *dev, unsigned int reg);
 	bool (*readable_reg)(struct device *dev, unsigned int reg);
 	bool (*volatile_reg)(struct device *dev, unsigned int reg);
+	bool (*precious_reg)(struct device *dev, unsigned int reg);
 };
 
 typedef int (*regmap_hw_write)(struct device *dev, const void *data,
-- 
1.7.5.4


             reply	other threads:[~2011-08-08  7:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-08  6:44 Mark Brown [this message]
2011-08-08  6:44 ` [PATCH 2/2] regmap: Skip precious registers when dumping registers via debugfs 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=1312785872-19629-1-git-send-email-broonie@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches@opensource.wolfsonmicro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome