aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNishanth Menon <nm@ti.com>2012-02-29 18:29:44 -0500
committerKevin Hilman <khilman@ti.com>2012-03-05 14:29:26 -0500
commit1f55bc1852e42f0d06d9eb66b3d3c15b01b62abe (patch)
treea4c2078b4aa89273b7d90992836a5a4b1ca26f90
parentad54c3ddb472410f05083dbcf03fcec67ab7b2a5 (diff)
ARM: OMAP3+: SmartReflex: Add a shutdown hook
SmartReflex fix for erratum ID i724. Since OMAP's VP and PRM modules do not get reset by warm reset, we should ensure that proper shutdown procedure is followed prior to allowing the kernel to reboot back up. Without this, Smartreflex module might be left active or system might be caught in an indeterminate sequence when software controlled reboot is triggered, leaving the next reboot behavior to be unpredictable. In the case of hardware controlled warm reset such as that by watchdog timer, prevention of this scenario is not possible. Signed-off-by: Nishanth Menon <nm@ti.com> Signed-off-by: Jean Pihet <j-pihet@ti.com> Reviewed-by: Kevin Hilman <khilman@ti.com> Signed-off-by: Kevin Hilman <khilman@ti.com>
-rw-r--r--arch/arm/mach-omap2/smartreflex.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
index 4b39c6489f6b..24ba80b70bd3 100644
--- a/arch/arm/mach-omap2/smartreflex.c
+++ b/arch/arm/mach-omap2/smartreflex.c
@@ -1055,8 +1055,32 @@ static int __devexit omap_sr_remove(struct platform_device *pdev)
1055 return 0; 1055 return 0;
1056} 1056}
1057 1057
1058static void __devexit omap_sr_shutdown(struct platform_device *pdev)
1059{
1060 struct omap_sr_data *pdata = pdev->dev.platform_data;
1061 struct omap_sr *sr_info;
1062
1063 if (!pdata) {
1064 dev_err(&pdev->dev, "%s: platform data missing\n", __func__);
1065 return;
1066 }
1067
1068 sr_info = _sr_lookup(pdata->voltdm);
1069 if (IS_ERR(sr_info)) {
1070 dev_warn(&pdev->dev, "%s: omap_sr struct not found\n",
1071 __func__);
1072 return;
1073 }
1074
1075 if (sr_info->autocomp_active)
1076 sr_stop_vddautocomp(sr_info);
1077
1078 return;
1079}
1080
1058static struct platform_driver smartreflex_driver = { 1081static struct platform_driver smartreflex_driver = {
1059 .remove = __devexit_p(omap_sr_remove), 1082 .remove = __devexit_p(omap_sr_remove),
1083 .shutdown = __devexit_p(omap_sr_shutdown),
1060 .driver = { 1084 .driver = {
1061 .name = "smartreflex", 1085 .name = "smartreflex",
1062 }, 1086 },