diff options
author | Davide Ciminaghi <ciminaghi@gnudd.com> | 2012-10-16 15:56:59 +0200 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-10-17 09:52:02 +0200 |
commit | 0d4529c534c1c664f25088eb5f5b4d7ce0ee2510 (patch) | |
tree | 5b080ef0a319b90fbcb0ab4eb768aae54851915e /drivers/base/regmap/internal.h | |
parent | Linux 3.7-rc1 (diff) | |
download | linux-0d4529c534c1c664f25088eb5f5b4d7ce0ee2510.tar.xz linux-0d4529c534c1c664f25088eb5f5b4d7ce0ee2510.zip |
regmap: make lock/unlock functions customizable
It is sometimes convenient for a regmap user to override the standard
regmap lock/unlock functions with custom functions.
For instance this can be useful in case an already existing spinlock
or mutex has to be used for locking a set of registers instead of the
internal regmap spinlock/mutex.
Note that the fast_io field of struct regmap_bus is ignored in case
custom locking functions are used.
Signed-off-by: Davide Ciminaghi <ciminaghi@gnudd.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 | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/base/regmap/internal.h b/drivers/base/regmap/internal.h index 80f9ab9c3aa4..b1ee824e2a5f 100644 --- a/drivers/base/regmap/internal.h +++ b/drivers/base/regmap/internal.h @@ -31,14 +31,12 @@ struct regmap_format { unsigned int (*parse_val)(void *buf); }; -typedef void (*regmap_lock)(struct regmap *map); -typedef void (*regmap_unlock)(struct regmap *map); - struct regmap { struct mutex mutex; spinlock_t spinlock; regmap_lock lock; regmap_unlock unlock; + void *lock_arg; /* This is passed to lock/unlock functions */ struct device *dev; /* Device we do I/O on */ void *work_buf; /* Scratch buffer used to format I/O */ |