summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack Lee <jack.lee@freescale.com>2012-10-03 13:31:47 +0800
committerJack Lee <jack.lee@freescale.com>2012-10-15 16:01:23 +0800
commit3e61ad06106bb75ba352c1b2d8d6d13fa211b109 (patch)
tree840d7a9903f1b3b2f2919e875b18bdb83e2a6a3b
parenta79d0352f8ad5f778ca70b94da71b06775e76cb6 (diff)
ENGR00223348 EPDC: Unable to enable DISPLAY regulator
In the maxim 17135 driver, the power good is confirmed by the power good GPIO polarity change when comparing the status at the beginning of driver probe and display regulator enabled. However, it is not reliable since the initial value of the GPIO is not constant. Normally, it is 1 but it can be 0 after system reset unexpectedly. Now, it is changed to POK bit checking in FAULT register. Signed-off-by: Jack Lee <jack.lee@freescale.com>
-rw-r--r--drivers/regulator/max17135-regulator.c20
-rw-r--r--include/linux/mfd/max17135.h5
2 files changed, 11 insertions, 14 deletions
diff --git a/drivers/regulator/max17135-regulator.c b/drivers/regulator/max17135-regulator.c
index 45d4501ef7a5..5ea70ef5868f 100644
--- a/drivers/regulator/max17135-regulator.c
+++ b/drivers/regulator/max17135-regulator.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010-2011 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright (C) 2010-2012 Freescale Semiconductor, Inc. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -284,12 +284,14 @@ static int max17135_vcom_is_enabled(struct regulator_dev *reg)
static int max17135_is_power_good(struct max17135 *max17135)
{
- /*
- * XOR of polarity (starting value) and current
- * value yields whether power is good.
- */
- return gpio_get_value(max17135->gpio_pmic_pwrgood) ^
- max17135->pwrgood_polarity;
+ unsigned int reg_val;
+ unsigned int fld_val;
+
+ max17135_reg_read(REG_MAX17135_FAULT, &reg_val);
+ fld_val = (reg_val & BITFMASK(FAULT_POK)) >> FAULT_POK_LSH;
+
+ /* Check the POK bit */
+ return fld_val;
}
static int max17135_wait_power_good(struct max17135 *max17135)
@@ -302,6 +304,7 @@ static int max17135_wait_power_good(struct max17135 *max17135)
msleep(1);
}
+
return -ETIMEDOUT;
}
@@ -622,9 +625,6 @@ int max17135_register_regulator(struct max17135 *max17135, int reg,
*/
max17135_setup_timings(max17135);
- max17135->pwrgood_polarity =
- gpio_get_value(max17135->gpio_pmic_pwrgood);
-
max17135->init_done = true;
}
diff --git a/include/linux/mfd/max17135.h b/include/linux/mfd/max17135.h
index 265b1588c10a..5785ed415a71 100644
--- a/include/linux/mfd/max17135.h
+++ b/include/linux/mfd/max17135.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010-2011 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright (C) 2010-2012 Freescale Semiconductor, Inc. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -167,9 +167,6 @@ struct max17135 {
/* powerup/powerdown wait time */
int max_wait;
-
- /* Dynamically determined polarity for PWRGOOD */
- int pwrgood_polarity;
};
enum {