summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
8698b93)
Unlike other lock types hwspinlocks are optional and can be built
modular so we can't use them unconditionally in regmap so add a config
option that drivers that want to use hwspinlocks with regmap can select
which will ensure that hwspinlock is built in.
Signed-off-by: Mark Brown <broonie@kernel.org>
config REGMAP
default y if (REGMAP_I2C || REGMAP_SPI || REGMAP_SPMI || REGMAP_W1 || REGMAP_AC97 || REGMAP_MMIO || REGMAP_IRQ)
select IRQ_DOMAIN if REGMAP_IRQ
config REGMAP
default y if (REGMAP_I2C || REGMAP_SPI || REGMAP_SPMI || REGMAP_W1 || REGMAP_AC97 || REGMAP_MMIO || REGMAP_IRQ)
select IRQ_DOMAIN if REGMAP_IRQ
+ select HWSPINLOCK if REGMAP_HWSPINLOCK
bool
config REGCACHE_COMPRESSED
bool
config REGCACHE_COMPRESSED
+
+config REGMAP_HWSPINLOCK
+ bool
+#ifdef REGMAP_HWSPINLOCK
static void regmap_lock_hwlock(void *__map)
{
struct regmap *map = __map;
static void regmap_lock_hwlock(void *__map)
{
struct regmap *map = __map;
hwspin_unlock_irqrestore(map->hwlock, &map->spinlock_flags);
}
hwspin_unlock_irqrestore(map->hwlock, &map->spinlock_flags);
}
static void regmap_lock_mutex(void *__map)
{
static void regmap_lock_mutex(void *__map)
{
map->unlock = config->unlock;
map->lock_arg = config->lock_arg;
} else if (config->hwlock_id) {
map->unlock = config->unlock;
map->lock_arg = config->lock_arg;
} else if (config->hwlock_id) {
+#ifdef REGMAP_HWSPINLOCK
map->hwlock = hwspin_lock_request_specific(config->hwlock_id);
if (!map->hwlock) {
ret = -ENXIO;
map->hwlock = hwspin_lock_request_specific(config->hwlock_id);
if (!map->hwlock) {
ret = -ENXIO;
+#else
+ ret = -EINVAL;
+ goto err;
+#endif
} else {
if ((bus && bus->fast_io) ||
config->fast_io) {
} else {
if ((bus && bus->fast_io) ||
config->fast_io) {