[PATCH 2/2] regmap: debugfs: Add support for dumping write only device registers

From
Mark Brown <broonie@kernel.org>
Date
2016-08-04 20:27:09
Also in
lkml
Reply to
Cristian Birsan, 2016-08-04
On Thu, Aug 04, 2016 at 05:55:58PM +0300, Cristian Birsan wrote:
Add support for dumping write only device registers in debugfs. This is
useful for audio codecs that have write only registers (like WM8731).
The logic that decides if a value can be printed is moved to
regmap_printable() function to allow for easier future updates.
Please check your CC list when sending things upstream - try to ensure
that people you're sending patches to are relevant to the patch.
Maintainers often get lots of mail and having to sort out mail that's
not really relevant to them can make it easier for relevant mail to get
missed.
quoted hunk ↗ jump to hunk
+static bool regmap_printable(struct regmap *map, unsigned int reg)
+{
+	if (regmap_precious(map, reg))
+		return false;
+
+	if (!regmap_readable(map, reg) && !regmap_cached(map, reg))
+		return false;
+
+	return true;
+}
This only has one user...
quoted hunk ↗ jump to hunk
 	for (i = start_reg; i <= to; i += map->reg_stride) {
-		if (!regmap_readable(map, i))
+		if (!regmap_readable(map, i) && !regmap_cached(map, i))
 			continue;
 
...though it could have more.
quoted hunk ↗ jump to hunk
-			ret = regmap_read(map, i, &val);
+			if (regmap_readable(map, i))
+				ret = regmap_read(map, i, &val);
+			else
+				ret = regcache_read(map, i, &val);
+
I don't understand this change, a read will go to cache anyway.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160804/d65aa7b6/attachment.sig>
Thread (15 messages) 15 messages, 5 authors, last reply 2016-08-10
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help