llist-return-whether-list-is-empty-before-adding-in-llist_add-fix
[pandora-kernel.git] / include / linux / regmap.h
index 18d4afa..3daac2d 100644 (file)
 struct i2c_client;
 struct spi_device;
 
+/* An enum of all the supported cache types */
+enum regcache_type {
+       REGCACHE_NONE,
+       REGCACHE_INDEXED,
+       REGCACHE_RBTREE,
+       REGCACHE_LZO
+};
+
 /**
  * Default value for a register.  We use an array of structs rather
  * than a simple array as many modern devices have very sparse
@@ -59,6 +67,11 @@ struct reg_default {
  * @write_flag_mask: Mask to be set in the top byte of the register when doing
  *                   a write. If both read_flag_mask and write_flag_mask are
  *                   empty the regmap_bus default masks are used.
+ *
+ * @cache_type: The actual cache type.
+ * @reg_defaults_raw: Power on reset values for registers (for use with
+ *                    register cache support).
+ * @num_reg_defaults_raw: Number of elements in reg_defaults_raw.
  */
 struct regmap_config {
        int reg_bits;
@@ -71,7 +84,10 @@ struct regmap_config {
 
        unsigned int max_register;
        struct reg_default *reg_defaults;
-       int num_reg_defaults;
+       unsigned int num_reg_defaults;
+       enum regcache_type cache_type;
+       const void *reg_defaults_raw;
+       unsigned int num_reg_defaults_raw;
 
        u8 read_flag_mask;
        u8 write_flag_mask;
@@ -124,4 +140,8 @@ int regmap_bulk_read(struct regmap *map, unsigned int reg, void *val,
 int regmap_update_bits(struct regmap *map, unsigned int reg,
                       unsigned int mask, unsigned int val);
 
+int regcache_sync(struct regmap *map);
+void regcache_cache_only(struct regmap *map, bool enable);
+void regcache_cache_bypass(struct regmap *map, bool enable);
+
 #endif