arm: tegra: xmm: add shutdown handler to off cp
Seongho Joo [Wed, 7 Mar 2012 03:32:46 +0000 (12:32 +0900)]
add shutdown handler to turn off CP when power off
and disable irq for ap wake.

Bug 942968

Signed-off-by: Seongho Joo <sjoo@nvidia.com>
Reviewed-on: http://git-master/r/88188
(cherry picked from commit d37a1900afb9982115f18989b0114bad8f2602bd)

Change-Id: I1541453e21b46149bba08eafb0eadf9a598aa182
Reviewed-on: http://git-master/r/96455
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>

arch/arm/mach-tegra/baseband-xmm-power.c

index 21f62a0..0e642d8 100644 (file)
@@ -1131,9 +1131,24 @@ static const struct dev_pm_ops baseband_xmm_power_dev_pm_ops = {
 };
 #endif
 
+static int baseband_xmm_power_driver_shutdown(struct platform_device *device)
+{
+       struct baseband_power_platform_data *data =
+               (struct baseband_power_platform_data *)
+                       device->dev.platform_data;
+
+       pr_debug("%s\n", __func__);
+       disable_irq(gpio_to_irq(data->modem.xmm.ipc_ap_wake));
+       /* bb_on is already down, to make sure set 0 again */
+       gpio_set_value(data->modem.xmm.bb_on, 0);
+       gpio_set_value(data->modem.xmm.bb_rst, 0);
+       return 0;
+}
+
 static struct platform_driver baseband_power_driver = {
        .probe = baseband_xmm_power_driver_probe,
        .remove = baseband_xmm_power_driver_remove,
+       .shutdown = baseband_xmm_power_driver_shutdown,
        .driver = {
                .name = "baseband_xmm_power",
 #ifdef CONFIG_PM