summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBibek Basu <bbasu@nvidia.com>2014-06-13 09:46:39 +0530
committerRiham Haidar <rhaidar@nvidia.com>2014-06-16 21:48:54 -0700
commitbf96be80df967de93273eefb04b0d6db75836472 (patch)
treee073c5687a07404bd98c11331788ee0b128bc709 /include
parent854b572cb465fb3ea8a615dcac672a4aa552c6b7 (diff)
mfd: as3722: add oc_pg_ctrl enabling support
Based on DT or pdata for the board used, add support to mask oc_pg_ctrl and oc_pg_ctrl2 signal Bug 1518725 Bug 1419425 Change-Id: Ie69c1de37b9f428e23268dad009dfff36cb1463d Signed-off-by: Bibek Basu <bbasu@nvidia.com> Reviewed-on: http://git-master/r/423036 Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> Tested-by: Laxman Dewangan <ldewangan@nvidia.com> GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'include')
-rw-r--r--include/linux/mfd/as3722-plat.h11
-rw-r--r--include/linux/mfd/as3722.h16
2 files changed, 27 insertions, 0 deletions
diff --git a/include/linux/mfd/as3722-plat.h b/include/linux/mfd/as3722-plat.h
index c0574c1969d7..701757898a6f 100644
--- a/include/linux/mfd/as3722-plat.h
+++ b/include/linux/mfd/as3722-plat.h
@@ -97,6 +97,16 @@ enum as3722_gpio_id {
AS3722_NUM_GPIO,
};
+/* Power Good OC Mask macro */
+#define AS3722_OC_PG_MASK_AC_OK 0x1
+#define AS3722_OC_PG_MASK_GPIO3 0x2
+#define AS3722_OC_PG_MASK_GPIO4 0x4
+#define AS3722_OC_PG_MASK_GPIO5 0x8
+#define AS3722_OC_PG_MASK_PWRGOOD_SD0 0x10
+#define AS3722_OC_PG_MASK_OVCURR_SD0 0x20
+#define AS3722_OC_PG_MASK_POWERGOOD_SD6 0x40
+#define AS3722_OC_PG_MASK_OVCURR_SD6 0x80
+
/*
* struct as3722_pinctrl_platform_data: Pincontrol platform data.
* @pin: name of pin.
@@ -165,6 +175,7 @@ struct as3722_platform_data {
bool battery_backup_enable_bypass;
u32 backup_battery_charge_current;
u32 battery_backup_charge_mode;
+ u32 oc_pg_mask;
};
#endif
diff --git a/include/linux/mfd/as3722.h b/include/linux/mfd/as3722.h
index cd4737999b68..a37e57412da8 100644
--- a/include/linux/mfd/as3722.h
+++ b/include/linux/mfd/as3722.h
@@ -378,6 +378,21 @@
#define AS3722_BBCMODE_ACT_STBY 2
#define AS3722_BBCMODE_ACT_STBY_OFF 3
+#define AS3722_PG_AC_OK_INV_MASK BIT(0)
+#define AS3722_PG_AC_OK_MASK BIT(1)
+#define AS3722_PG_GPIO3_MASK BIT(2)
+#define AS3722_PG_GPIO4_MASK BIT(3)
+#define AS3722_PG_GPIO5_MASK BIT(4)
+#define AS3722_PG_PWRGOOD_SD0_MASK BIT(5)
+#define AS3722_PG_OVCURR_SD0_MASK BIT(6)
+#define AS3722_PG_VRESFALL_MASK BIT(7)
+
+#define AS3722_OC_PG_INVERT_MASK BIT(0)
+#define AS3722_PG_VMASK_TIME_MASK (3 << 1)
+#define AS3722_PG_SD6_OVC_ALARM_MASK (7 << 3)
+#define AS3722_PG_POWERGOOD_SD6_MASK BIT(6)
+#define AS3722_PG_OVCURR_SD6_MASK BIT(7)
+
/* Interrupt IDs */
enum as3722_irq {
AS3722_IRQ_LID,
@@ -435,6 +450,7 @@ struct as3722 {
bool battery_backup_enable_bypass;
u32 backup_battery_charge_current;
u32 battery_backup_charge_mode;
+ u32 oc_pg_mask;
};
static inline int as3722_read(struct as3722 *as3722, u32 reg, u32 *dest)