diff options
author | Stephen Warren <swarren@nvidia.com> | 2012-04-04 17:48:28 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-04-06 05:47:34 -0400 |
commit | bacdbe077342ecc9e7b3e374cc5a41995116706a (patch) | |
tree | b5cf9547a0ab4a7fba287a3d654d132869057afa /drivers/base/regmap/internal.h | |
parent | 0135bbcc7a0cc056f0203ff839466236b8e3dc19 (diff) |
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 'drivers/base/regmap/internal.h')
-rw-r--r-- | drivers/base/regmap/internal.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/base/regmap/internal.h b/drivers/base/regmap/internal.h index b95fd1f25295..e46c279f8280 100644 --- a/drivers/base/regmap/internal.h +++ b/drivers/base/regmap/internal.h | |||
@@ -31,8 +31,14 @@ struct regmap_format { | |||
31 | unsigned int (*parse_val)(void *buf); | 31 | unsigned int (*parse_val)(void *buf); |
32 | }; | 32 | }; |
33 | 33 | ||
34 | typedef void (*regmap_lock)(struct regmap *map); | ||
35 | typedef void (*regmap_unlock)(struct regmap *map); | ||
36 | |||
34 | struct regmap { | 37 | struct regmap { |
35 | struct mutex lock; | 38 | struct mutex mutex; |
39 | spinlock_t spinlock; | ||
40 | regmap_lock lock; | ||
41 | regmap_unlock unlock; | ||
36 | 42 | ||
37 | struct device *dev; /* Device we do I/O on */ | 43 | struct device *dev; /* Device we do I/O on */ |
38 | void *work_buf; /* Scratch buffer used to format I/O */ | 44 | void *work_buf; /* Scratch buffer used to format I/O */ |