]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00231808: Add epdc pmic shut down feature
authorLiGang <b41990@freescale.com>
Wed, 14 Nov 2012 02:12:53 +0000 (10:12 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:35:48 +0000 (08:35 +0200)
For some cases, system maybe restart with epdc pmic on.
If epdc pmic on for sometime(2~3s), the current epdc pmic consume will increase
obviously, then the total current of board maybe exceed to the current limit,
which will pull down the input voltage to lead to the system pmic reset,
an un-expected POR reset occurs.
So it is necessary to close epdc pmic before system restart.

This patch is added by Robby Cai<r63905@freescale.com>

Signed-off-by: LiGang <b41990@freescale.com>
(cherry picked from commit ee9ffb4307b2b3d7440fc3468b0faaace3d2829e)

drivers/video/mxc/mxc_epdc_fb.c

index 6787b1ee78fe98c08716473e1f393558e2dc31c9..3450a65eea60bf7149b054f620bf2e8caa4b118e 100644 (file)
@@ -5025,9 +5025,33 @@ static int mxc_epdc_fb_resume(struct platform_device *pdev)
 
        return 0;
 }
+
+static int mxc_epdc_fb_shutdown(struct platform_device *pdev)
+{
+       struct mxc_epdc_fb_data *fb_data = platform_get_drvdata(pdev);
+
+       /* Disable power to the EPD panel */
+       regulator_disable(fb_data->vcom_regulator);
+       regulator_disable(fb_data->display_regulator);
+
+       /* Disable clocks to EPDC */
+       __raw_writel(EPDC_CTRL_CLKGATE, EPDC_CTRL_SET);
+       clk_disable(fb_data->epdc_clk_pix);
+       clk_disable(fb_data->epdc_clk_axi);
+
+       /* Disable pins used by EPDC (to prevent leakage current) */
+       if (fb_data->pdata->disable_pins)
+               fb_data->pdata->disable_pins();
+
+       /* turn off the V3p3 */
+       regulator_disable(fb_data->v3p3_regulator);
+
+       return 0;
+}
 #else
 #define mxc_epdc_fb_suspend    NULL
 #define mxc_epdc_fb_resume     NULL
+#define mxc_epdc_fb_shutdown   NULL
 #endif
 
 static struct platform_driver mxc_epdc_fb_driver = {
@@ -5035,6 +5059,7 @@ static struct platform_driver mxc_epdc_fb_driver = {
        .remove = mxc_epdc_fb_remove,
        .suspend = mxc_epdc_fb_suspend,
        .resume = mxc_epdc_fb_resume,
+       .shutdown = mxc_epdc_fb_shutdown,
        .driver = {
                   .name = "imx_epdc_fb",
                   .owner = THIS_MODULE,