From: LiGang Date: Wed, 14 Nov 2012 02:12:53 +0000 (+0800) Subject: ENGR00231808: Add epdc pmic shut down feature X-Git-Tag: v3.0.35-fsl~189 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=999053202f95553adb77b400aded2fa1a9002638;p=karo-tx-linux.git ENGR00231808: Add epdc pmic shut down feature 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 Signed-off-by: LiGang (cherry picked from commit ee9ffb4307b2b3d7440fc3468b0faaace3d2829e) --- diff --git a/drivers/video/mxc/mxc_epdc_fb.c b/drivers/video/mxc/mxc_epdc_fb.c index 6787b1ee78fe..3450a65eea60 100644 --- a/drivers/video/mxc/mxc_epdc_fb.c +++ b/drivers/video/mxc/mxc_epdc_fb.c @@ -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,