diff options
author | Bibek Basu <bbasu@nvidia.com> | 2014-04-30 12:41:52 +0530 |
---|---|---|
committer | Mandar Padmawar <mpadmawar@nvidia.com> | 2014-05-07 01:17:22 -0700 |
commit | 2fed492ff26b82539f1f36bdb86182b9b0c2df2c (patch) | |
tree | 484dd4a4f4c989b311c5e7759d49e93f93741aff /include | |
parent | a575b112924cd4a1151b098b44919de32cb7c224 (diff) |
mfd: as3722: initialize backup battery charging state
Initialize the backup battery charging state based on
device tree or platform provided data
Bug 1508216
Change-Id: I2bc7c0778b466bb61cd984bfeece97cd9c0059e4
Signed-off-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-on: http://git-master/r/403344
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/dt-bindings/mfd/as3722.h | 11 | ||||
-rw-r--r-- | include/linux/mfd/as3722-plat.h | 4 | ||||
-rw-r--r-- | include/linux/mfd/as3722.h | 17 |
3 files changed, 32 insertions, 0 deletions
diff --git a/include/dt-bindings/mfd/as3722.h b/include/dt-bindings/mfd/as3722.h index b7b23c4cbd03..1846e51f58c9 100644 --- a/include/dt-bindings/mfd/as3722.h +++ b/include/dt-bindings/mfd/as3722.h @@ -8,4 +8,15 @@ #define AS3722_EXT_CONTROL_ENABLE1 1 #define AS3722_EXT_CONTROL_ENABLE2 2 +#define AS3722_BBCCUR_50UA 0 +#define AS3722_BBCCUR_200UA 1 +#define AS3722_BBCCUR_100UA 2 +#define AS3722_BBCCUR_400UA 3 +#define AS3722_BBCRESOFF_ENABLE 0 +#define AS3722_BBCRESOFF_BYPASS 1 +#define AS3722_BBCMODE_OFF 0 +#define AS3722_BBCMODE_ACTIVE 1 +#define AS3722_BBCMODE_ACT_STBY 2 +#define AS3722_BBCMODE_ACT_STBY_OFF 3 + #endif diff --git a/include/linux/mfd/as3722-plat.h b/include/linux/mfd/as3722-plat.h index e4e19d6ba733..c0574c1969d7 100644 --- a/include/linux/mfd/as3722-plat.h +++ b/include/linux/mfd/as3722-plat.h @@ -161,6 +161,10 @@ struct as3722_platform_data { u32 major_rev; u32 minor_rev; bool enable_clk32k_out; + bool backup_battery_chargable; + bool battery_backup_enable_bypass; + u32 backup_battery_charge_current; + u32 battery_backup_charge_mode; }; #endif diff --git a/include/linux/mfd/as3722.h b/include/linux/mfd/as3722.h index 58f751ca00b8..cd4737999b68 100644 --- a/include/linux/mfd/as3722.h +++ b/include/linux/mfd/as3722.h @@ -365,6 +365,19 @@ #define AS3722_CTRL_SEQ1_AC_OK_PWR_ON BIT(0) +#define AS3722_BBCCUR_MASK 0x18 +#define AS3722_BBCCUR_VAL(n) ((n) << 3) +#define AS3722_BBCCUR_50UA AS3722_BBCCUR_VAL(0) +#define AS3722_BBCCUR_200UA AS3722_BBCCUR_VAL(1) +#define AS3722_BBCCUR_100UA AS3722_BBCCUR_VAL(2) +#define AS3722_BBCCUR_400UA AS3722_BBCCUR_VAL(3) +#define AS3722_BBCRESOFF_MASK BIT(2) +#define AS3722_BBCMODE_MASK 0x03 +#define AS3722_BBCMODE_OFF 0 +#define AS3722_BBCMODE_ACTIVE 1 +#define AS3722_BBCMODE_ACT_STBY 2 +#define AS3722_BBCMODE_ACT_STBY_OFF 3 + /* Interrupt IDs */ enum as3722_irq { AS3722_IRQ_LID, @@ -418,6 +431,10 @@ struct as3722 { u32 minor_rev; struct mutex mutex_config; bool shutdown; + bool backup_battery_chargable; + bool battery_backup_enable_bypass; + u32 backup_battery_charge_current; + u32 battery_backup_charge_mode; }; static inline int as3722_read(struct as3722 *as3722, u32 reg, u32 *dest) |