Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 280532
b: refs/heads/master
c: 8ae0d7e
h: refs/heads/master
v: v3
  • Loading branch information
Mark Brown committed Nov 8, 2011
1 parent 7b5afcc commit 35b37b5
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 337 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f8beab2bb611d735767871e0e1a12dc6a0def7b1
refs/heads/master: 8ae0d7e8a918e9603748abe9b31984fc5d96abb3
3 changes: 0 additions & 3 deletions trunk/drivers/base/regmap/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,3 @@ config REGMAP_I2C

config REGMAP_SPI
tristate

config REGMAP_IRQ
bool
1 change: 0 additions & 1 deletion trunk/drivers/base/regmap/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ obj-$(CONFIG_REGMAP) += regmap.o regcache.o regcache-indexed.o regcache-rbtree.o
obj-$(CONFIG_DEBUG_FS) += regmap-debugfs.o
obj-$(CONFIG_REGMAP_I2C) += regmap-i2c.o
obj-$(CONFIG_REGMAP_SPI) += regmap-spi.o
obj-$(CONFIG_REGMAP_IRQ) += regmap-irq.o
1 change: 1 addition & 0 deletions trunk/drivers/base/regmap/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ struct regmap {
struct reg_default *reg_defaults;
const void *reg_defaults_raw;
void *cache;
bool cache_dirty;
};

struct regcache_ops {
Expand Down
19 changes: 19 additions & 0 deletions trunk/drivers/base/regmap/regcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ int regcache_sync(struct regmap *map)
map->cache_ops->name);
name = map->cache_ops->name;
trace_regcache_sync(map->dev, name, "start");
if (!map->cache_dirty)
goto out;
if (map->cache_ops->sync) {
ret = map->cache_ops->sync(map);
} else {
Expand Down Expand Up @@ -290,6 +292,23 @@ void regcache_cache_only(struct regmap *map, bool enable)
}
EXPORT_SYMBOL_GPL(regcache_cache_only);

/**
* regcache_mark_dirty: Mark the register cache as dirty
*
* @map: map to mark
*
* Mark the register cache as dirty, for example due to the device
* having been powered down for suspend. If the cache is not marked
* as dirty then the cache sync will be suppressed.
*/
void regcache_mark_dirty(struct regmap *map)
{
mutex_lock(&map->lock);
map->cache_dirty = true;
mutex_unlock(&map->lock);
}
EXPORT_SYMBOL_GPL(regcache_mark_dirty);

/**
* regcache_cache_bypass: Put a register map into cache bypass mode
*
Expand Down
284 changes: 0 additions & 284 deletions trunk/drivers/base/regmap/regmap-irq.c

This file was deleted.

4 changes: 3 additions & 1 deletion trunk/drivers/base/regmap/regmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,10 @@ int _regmap_write(struct regmap *map, unsigned int reg,
ret = regcache_write(map, reg, val);
if (ret != 0)
return ret;
if (map->cache_only)
if (map->cache_only) {
map->cache_dirty = true;
return 0;
}
}

trace_regmap_reg_write(map->dev, reg, val);
Expand Down
Loading

0 comments on commit 35b37b5

Please sign in to comment.