[PATCH 33/133] [Jaunty SRU] ARM.imx51 Freescale:ENGR00111028 Fix boot failure on MX51 MC13892 1.1 board with VBAT 4.2v

Brad Figg brad.figg at canonical.com
Thu Jul 9 16:48:23 UTC 2009


From: Lily Zhang <r58066 at freescale.com>

1.When the backlight current is 15ma and VBAT voltage is high(for example 4.2v),
linux boot is failed because MC13892 TO1.1 enters unexpected status and crashes.
The workaround is to change backlight current as 6ma.
2. Support to get PMIC version via I2C connection

Signed-off-by: Lily Zhang <r58066 at freescale.com>
Signed-off-by: Brad Figg <brad.figg at canonical.com>
---
 drivers/mxc/pmic/core/pmic_core_i2c.c    |   12 ++++++++++++
 drivers/video/backlight/mxc_mc13892_bl.c |   10 ++++++++--
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/drivers/mxc/pmic/core/pmic_core_i2c.c b/drivers/mxc/pmic/core/pmic_core_i2c.c
index 921964f..d1c7226 100644
--- a/drivers/mxc/pmic/core/pmic_core_i2c.c
+++ b/drivers/mxc/pmic/core/pmic_core_i2c.c
@@ -228,6 +228,18 @@ static int __devinit pmic_probe(struct i2c_client *client,
 	/* Initialize GPIO for PMIC Interrupt */
 	gpio_pmic_active();
 
+	/* Get the PMIC Version */
+	pmic_get_revision(&mxc_pmic_version);
+	if (mxc_pmic_version.revision < 0) {
+		dev_err((struct device *)client,
+			"PMIC not detected!!! Access Failed\n");
+		return -ENODEV;
+	} else {
+		dev_dbg((struct device *)client,
+			"Detected pmic core IC version number is %d\n",
+			mxc_pmic_version.revision);
+	}
+
 	/* Initialize the PMIC parameters */
 	ret = pmic_init_registers();
 	if (ret != PMIC_SUCCESS)
diff --git a/drivers/video/backlight/mxc_mc13892_bl.c b/drivers/video/backlight/mxc_mc13892_bl.c
index f8d112e..2038859 100644
--- a/drivers/video/backlight/mxc_mc13892_bl.c
+++ b/drivers/video/backlight/mxc_mc13892_bl.c
@@ -20,6 +20,7 @@
 #include <linux/backlight.h>
 
 #include <linux/pmic_light.h>
+#include <linux/pmic_external.h>
 
 /*
 #define MXC_MAX_INTENSITY 	255
@@ -78,6 +79,7 @@ static int __init mxcbl_probe(struct platform_device *pdev)
 	int ret = 0;
 	struct backlight_device *bd;
 	struct mxcbl_dev_data *devdata;
+	pmic_version_t pmic_version;
 
 	pr_debug("mc13892 backlight start probe\n");
 
@@ -98,8 +100,12 @@ static int __init mxcbl_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, bd);
 
 	/* according to LCD spec, current should be 18mA */
-	/* workaround for atlas hot issue, set current 15mA */
-	mc13892_bklit_set_current(LIT_MAIN, LIT_CURR_15);
+	/* workaround for MC13892 TO1.1 crash issue, set current 6mA */
+	pmic_version = pmic_get_version();
+	if (pmic_version.revision < 20)
+		mc13892_bklit_set_current(LIT_MAIN, LIT_CURR_6);
+	else
+		mc13892_bklit_set_current(LIT_MAIN, LIT_CURR_18);
 	bd->props.brightness = MXC_DEFAULT_INTENSITY;
 	bd->props.max_brightness = MXC_MAX_INTENSITY;
 	bd->props.power = FB_BLANK_UNBLANK;
-- 
1.6.0.4





More information about the kernel-team mailing list