summaryrefslogtreecommitdiff
path: root/include/linux/mfd
diff options
context:
space:
mode:
authorLaxman Dewangan <ldewangan@nvidia.com>2014-03-11 13:57:38 +0530
committerLaxman Dewangan <ldewangan@nvidia.com>2014-03-12 02:11:47 -0700
commitb1311d8afd840f5c66d51f27e3b56e72a34ebefc (patch)
tree5f6336005f1805b2e3a5450157ee0c035efb99c9 /include/linux/mfd
parent6c45828760df11fbfa2d178f8359551b20b45268 (diff)
regulator: as3722: set minimum voltage based on device version
Support the AS3722 otp version 1V2 and later. Set the SD0 minimum voltage based on OTP version as 610mV for 1V0 and 1V1 else 410mV. bug 1435338 Change-Id: Ieb9c21cb5b6f0126ac27325a5b14403445c94ccb Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/379902 Reviewed-by: Bibek Basu <bbasu@nvidia.com> Tested-by: Bibek Basu <bbasu@nvidia.com>
Diffstat (limited to 'include/linux/mfd')
-rw-r--r--include/linux/mfd/as3722.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/include/linux/mfd/as3722.h b/include/linux/mfd/as3722.h
index b75d17084c22..0cf40a0e3ef1 100644
--- a/include/linux/mfd/as3722.h
+++ b/include/linux/mfd/as3722.h
@@ -460,11 +460,31 @@ static inline int as3722_irq_get_virq(struct as3722 *as3722, int irq)
static inline bool as3722_device_rev(struct as3722 *as3722, u32 major_rev,
u32 minor_rev)
{
-
if ((as3722->major_rev == major_rev) &&
(as3722->minor_rev == minor_rev))
return true;
else
return false;
}
+
+static inline bool as3722_device_rev_eq_later(struct as3722 *as3722,
+ u32 major_rev, u32 minor_rev)
+{
+ u32 minor;
+
+ if (as3722->major_rev < major_rev)
+ return false;
+
+ if (as3722->major_rev > major_rev)
+ return true;
+
+ minor = as3722->minor_rev;
+ if (as3722->minor_rev >= 10)
+ minor = as3722->minor_rev / 10;
+
+ if (minor < minor_rev)
+ return false;
+
+ return true;
+}
#endif