summaryrefslogtreecommitdiffstats
path: root/include/linux/regmap.h
diff options
context:
space:
mode:
authorStephen Warren2012-04-04 23:48:28 +0200
committerMark Brown2012-04-06 11:47:34 +0200
commitbacdbe077342ecc9e7b3e374cc5a41995116706a (patch)
treeb5cf9547a0ab4a7fba287a3d654d132869057afa /include/linux/regmap.h
parentregmap: introduce explicit bus_context for bus callbacks (diff)
downloadkernel-qcow2-linux-bacdbe077342ecc9e7b3e374cc5a41995116706a.tar.gz
kernel-qcow2-linux-bacdbe077342ecc9e7b3e374cc5a41995116706a.tar.xz
kernel-qcow2-linux-bacdbe077342ecc9e7b3e374cc5a41995116706a.zip
regmap: introduce fast_io busses, and use a spinlock for them
Some bus types have very fast IO. For these, acquiring a mutex for every IO operation is a significant overhead. Allow busses to indicate their IO is fast, and enhance regmap to use a spinlock for those busses. [Currently limited to native endian registers -- broonie] Signed-off-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'include/linux/regmap.h')
-rw-r--r--include/linux/regmap.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index 8fd341e613d6..f14588a96eaf 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -110,6 +110,8 @@ typedef void (*regmap_hw_free_context)(void *context);
/**
* Description of a hardware bus for the register map infrastructure.
*
+ * @fast_io: Register IO is fast. Use a spinlock instead of a mutex
+ * to perform locking.
* @write: Write operation.
* @gather_write: Write operation with split register/value, return -ENOTSUPP
* if not implemented on a given device.
@@ -119,6 +121,7 @@ typedef void (*regmap_hw_free_context)(void *context);
* a read.
*/
struct regmap_bus {
+ bool fast_io;
regmap_hw_write write;
regmap_hw_gather_write gather_write;
regmap_hw_read read;