From 7e27437bad7355e6bfa9ed39bfd6e834acb48452 Mon Sep 17 00:00:00 2001 From: James Wylder Date: Wed, 16 Jun 2010 11:21:42 -0500 Subject: [PATCH] [ARM] tegra: stingray: boardfile - handle power-off failure (factory cable). With a factory cable plugged in, the power-off mechanisms are disabled. This reproduces the behavior in sholes of spinning at power-off if the factory cable is plugged in. Signed-off-by: James Wylder --- arch/arm/mach-tegra/board-stingray.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-tegra/board-stingray.c b/arch/arm/mach-tegra/board-stingray.c index 1ea0f76e5f26..fa3985e15c35 100644 --- a/arch/arm/mach-tegra/board-stingray.c +++ b/arch/arm/mach-tegra/board-stingray.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -396,15 +397,24 @@ static void __init tegra_stingray_fixup(struct machine_desc *desc, struct tag *t static void stingray_power_off(void) { + printk(KERN_INFO "stingray_pm_power_off...\n"); + + local_irq_disable(); + + /* signal WDI gpio to shutdown CPCAP, which will + cascade to all of the regulators. */ gpio_direction_output(TEGRA_GPIO_PV7, 0); + + do {} while (1); + + local_irq_enable(); } static void __init stingray_power_off_init(void) { tegra_gpio_enable(TEGRA_GPIO_PV7); - if (!gpio_request(TEGRA_GPIO_PV7, "wdi")) { + if (!gpio_request(TEGRA_GPIO_PV7, "wdi")) pm_power_off = stingray_power_off; - } } static int stingray_board_revision = STINGRAY_REVISION_UNKNOWN; -- 2.34.1