pmic: 8x41: Add support ldo set voltage API.
Change-Id: Ia35d2f64842ddc1f5bf82d93c81305e099e84151
diff --git a/dev/pmic/pm8x41/include/pm8x41_hw.h b/dev/pmic/pm8x41/include/pm8x41_hw.h
index 4886a8e..01fd07f 100644
--- a/dev/pmic/pm8x41/include/pm8x41_hw.h
+++ b/dev/pmic/pm8x41/include/pm8x41_hw.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, Code Aurora Forum. All rights reserved.
+/* Copyright (c) 2012, The Linux Foundation. All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -9,7 +9,7 @@
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
- * * Neither the name of Code Aurora Forum, Inc. nor the names of its
+ * * Neither the name of The Linux Foundation, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
@@ -29,7 +29,6 @@
#ifndef _PM8x41_HW_H_
#define _PM8x41_HW_H_
-
/* SMBB Registers */
#define SMBB_MISC_BOOT_DONE 0x1642
@@ -76,4 +75,44 @@
#define S2_RESET_TYPE_WARM 0x1
#define PON_RESIN_N_RESET_S2_TIMER_MAX_VALUE 0x7
+/* LDO voltage ranges */
+#define NLDO_UV_MIN 375000
+#define NLDO_UV_MAX 1537500
+#define NLDO_UV_STEP 12500
+#define NLDO_UV_VMIN_LOW 750000
+
+#define PLDO_UV_VMIN_LOW 750000
+#define PLDO_UV_VMIN_MID 1500000
+#define PLDO_UV_VMIN_HIGH 1750000
+
+#define PLDO_UV_MIN 1537500
+#define PDLO_UV_MID 3075000
+#define PLDO_UV_MAX 4900000
+#define PLDO_UV_STEP_LOW 12500
+#define PLDO_UV_STEP_MID 25000
+#define PLDO_UV_STEP_HIGH 50000
+
+#define LDO_RANGE_SEL_BIT 0
+#define LDO_VSET_SEL_BIT 0
+#define LDO_VREG_ENABLE_BIT 7
+#define LDO_NORMAL_PWR_BIT 7
+
+#define LDO_RANGE_CTRL 0x40
+#define LDO_STEP_CTRL 0x41
+#define LDO_POWER_MODE 0x45
+#define LDO_EN_CTL_REG 0x46
+
+#define PLDO_TYPE 0
+#define NLDO_TYPE 1
+
+#define LDO(_name, _type, _base, _range, _step, _enable) \
+{ \
+ .name = _name, \
+ .type = _type, \
+ .base = _base, \
+ .range_reg = _range, \
+ .step_reg = _step, \
+ .enable_reg = _enable, \
+}
+
#endif