@@ -14,6 +14,7 @@
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/err.h>
+#include <linux/delay.h>
#include <linux/platform_device.h>
#include <linux/mfd/ab8500.h>
#include <linux/mfd/abx500.h>
@@ -38,6 +39,7 @@
* @voltage_mask: mask to control regulator voltage
* @voltages: supported voltage table
* @voltages_len: number of supported voltages for the regulator
+ * @delay: startup delay in ms
*/
struct ab8500_regulator_info {
struct device *dev;
@@ -55,6 +57,7 @@ struct ab8500_regulator_info {
u8 voltage_mask;
int const *voltages;
int voltages_len;
+ unsigned int delay;
};
/* voltage tables for the vauxn/vintcore supplies */
@@ -115,6 +118,8 @@ static int ab8500_regulator_enable(struct regulator_dev *rdev)
dev_err(rdev_get_dev(rdev),
"couldn't set enable bits for regulator\n");
+ msleep(info->delay);
+
dev_vdbg(rdev_get_dev(rdev),
"%s-enable (bank, reg, mask, value): 0x%x, 0x%x, 0x%x, 0x%x\n",
info->desc.name, info->update_bank, info->update_reg,
@@ -140,6 +145,8 @@ static int ab8500_regulator_disable(struct regulator_dev *rdev)
dev_err(rdev_get_dev(rdev),
"couldn't set disable bits for regulator\n");
+ msleep(info->delay);
+
dev_vdbg(rdev_get_dev(rdev),
"%s-disable (bank, reg, mask, value): 0x%x, 0x%x, 0x%x, 0x%x\n",
info->desc.name, info->update_bank, info->update_reg,
@@ -281,6 +288,8 @@ static int ab8500_regulator_set_voltage(struct regulator_dev *rdev,
dev_err(rdev_get_dev(rdev),
"couldn't set voltage reg for regulator\n");
+ msleep(info->delay);
+
dev_vdbg(rdev_get_dev(rdev),
"%s-set_voltage (bank, reg, mask, value): 0x%x, 0x%x, 0x%x,"
" 0x%x\n",
@@ -426,6 +435,7 @@ static struct ab8500_regulator_info
.owner = THIS_MODULE,
.n_voltages = 1,
},
+ .delay = 10,
.fixed_uV = 2000000,
.update_bank = 0x03,
.update_reg = 0x80,