aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/mfd/twl-core.c21
-rw-r--r--include/linux/i2c/twl.h3
2 files changed, 24 insertions, 0 deletions
diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c
index c91cb4367b9b..f0abca79ff34 100644
--- a/drivers/mfd/twl-core.c
+++ b/drivers/mfd/twl-core.c
@@ -383,6 +383,27 @@ int twl_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes)
383} 383}
384EXPORT_SYMBOL(twl_i2c_read); 384EXPORT_SYMBOL(twl_i2c_read);
385 385
386/**
387 * twl_regcache_bypass - Configure the regcache bypass for the regmap associated
388 * with the module
389 * @mod_no: module number
390 * @enable: Regcache bypass state
391 *
392 * Returns 0 else failure.
393 */
394int twl_set_regcache_bypass(u8 mod_no, bool enable)
395{
396 struct regmap *regmap = twl_get_regmap(mod_no);
397
398 if (!regmap)
399 return -EPERM;
400
401 regcache_cache_bypass(regmap, enable);
402
403 return 0;
404}
405EXPORT_SYMBOL(twl_set_regcache_bypass);
406
386/*----------------------------------------------------------------------*/ 407/*----------------------------------------------------------------------*/
387 408
388/** 409/**
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h
index 673a3ce67f31..a09da0910339 100644
--- a/include/linux/i2c/twl.h
+++ b/include/linux/i2c/twl.h
@@ -175,6 +175,9 @@ static inline int twl_class_is_ ##class(void) \
175TWL_CLASS_IS(4030, TWL4030_CLASS_ID) 175TWL_CLASS_IS(4030, TWL4030_CLASS_ID)
176TWL_CLASS_IS(6030, TWL6030_CLASS_ID) 176TWL_CLASS_IS(6030, TWL6030_CLASS_ID)
177 177
178/* Set the regcache bypass for the regmap associated with the nodule */
179int twl_set_regcache_bypass(u8 mod_no, bool enable);
180
178/* 181/*
179 * Read and write several 8-bit registers at once. 182 * Read and write several 8-bit registers at once.
180 */ 183 */