Loading drivers/base/regmap/Kconfig +3 −0 Original line number Diff line number Diff line Loading @@ -13,3 +13,6 @@ config REGMAP_I2C config REGMAP_SPI tristate config REGMAP_IRQ bool drivers/base/regmap/Makefile +1 −0 Original line number Diff line number Diff line Loading @@ -3,3 +3,4 @@ obj-$(CONFIG_REGMAP) += regcache-rbtree.o regcache-lzo.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 drivers/base/regmap/internal.h +1 −0 Original line number Diff line number Diff line Loading @@ -74,6 +74,7 @@ struct regmap { struct reg_default *reg_defaults; const void *reg_defaults_raw; void *cache; bool cache_dirty; }; struct regcache_ops { Loading drivers/base/regmap/regcache-lzo.c +1 −1 Original line number Diff line number Diff line Loading @@ -354,7 +354,7 @@ static int regcache_lzo_sync(struct regmap *map) } struct regcache_ops regcache_lzo_ops = { .type = REGCACHE_LZO, .type = REGCACHE_COMPRESSED, .name = "lzo", .init = regcache_lzo_init, .exit = regcache_lzo_exit, Loading drivers/base/regmap/regcache.c +19 −0 Original line number Diff line number Diff line Loading @@ -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 { Loading Loading @@ -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 * Loading Loading
drivers/base/regmap/Kconfig +3 −0 Original line number Diff line number Diff line Loading @@ -13,3 +13,6 @@ config REGMAP_I2C config REGMAP_SPI tristate config REGMAP_IRQ bool
drivers/base/regmap/Makefile +1 −0 Original line number Diff line number Diff line Loading @@ -3,3 +3,4 @@ obj-$(CONFIG_REGMAP) += regcache-rbtree.o regcache-lzo.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
drivers/base/regmap/internal.h +1 −0 Original line number Diff line number Diff line Loading @@ -74,6 +74,7 @@ struct regmap { struct reg_default *reg_defaults; const void *reg_defaults_raw; void *cache; bool cache_dirty; }; struct regcache_ops { Loading
drivers/base/regmap/regcache-lzo.c +1 −1 Original line number Diff line number Diff line Loading @@ -354,7 +354,7 @@ static int regcache_lzo_sync(struct regmap *map) } struct regcache_ops regcache_lzo_ops = { .type = REGCACHE_LZO, .type = REGCACHE_COMPRESSED, .name = "lzo", .init = regcache_lzo_init, .exit = regcache_lzo_exit, Loading
drivers/base/regmap/regcache.c +19 −0 Original line number Diff line number Diff line Loading @@ -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 { Loading Loading @@ -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 * Loading