summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-tegra/board_nvodm.c17
-rw-r--r--arch/arm/mach-tegra/include/mach/board.h6
-rw-r--r--arch/arm/mach-tegra/include/mach/pci.h2
-rw-r--r--arch/arm/mach-tegra/pci.c3
4 files changed, 20 insertions, 8 deletions
diff --git a/arch/arm/mach-tegra/board_nvodm.c b/arch/arm/mach-tegra/board_nvodm.c
index 237844085c84..b1404b6ff00f 100644
--- a/arch/arm/mach-tegra/board_nvodm.c
+++ b/arch/arm/mach-tegra/board_nvodm.c
@@ -26,6 +26,7 @@
#include <linux/platform_device.h>
#include <linux/synaptics_i2c_rmi.h>
#include <linux/i2c.h>
+#include <linux/pm.h>
#include <linux/spi/spi.h>
#include <asm/mach-types.h>
@@ -56,7 +57,6 @@
#include "mach/nvrm_linux.h"
#include "nvassert.h"
#include "nvodm_query_discovery.h"
-#include "mach/pci.h"
#include <../../../drivers/staging/android/timed_output.h>
@@ -277,13 +277,13 @@ static void __init NvConfigDebugConsole(
return;
}
-void __init pci_tegra_power(int on)
+void tegra_set_voltage(NvU64 guid, int on)
{
u32 settling_time;
const NvOdmPeripheralConnectivity *con = NULL;
int i;
- con = NvOdmPeripheralGetGuid(NV_VDD_PEX_CLK_ODM_ID);
+ con = NvOdmPeripheralGetGuid(guid);
if (con == NULL)
return;
@@ -311,6 +311,12 @@ extern void __init tegra_clk_init(void);
extern void __init tegra_init_snor_controller(void);
#endif
+
+static void tegra_system_power_off(void)
+{
+ tegra_set_voltage(NV_VDD_SoC_ODM_ID, 0);
+}
+
#if !(defined(CONFIG_ENC28J60) && defined(CONFIG_SPI_TEGRA))
#define register_enc28j60() do {} while (0)
#else
@@ -476,11 +482,12 @@ static void __init tegra_machine_init(void)
#endif
#ifdef CONFIG_TEGRA_PCI
- pci_tegra_power(1);
+ tegra_set_voltage( NV_VDD_PEX_CLK_ODM_ID, 1);
#else
- pci_tegra_power(0);
+ tegra_set_voltage( NV_VDD_PEX_CLK_ODM_ID, 0);
#endif
+ pm_power_off = tegra_system_power_off;
}
MACHINE_START(TEGRA_GENERIC, "Tegra generic")
diff --git a/arch/arm/mach-tegra/include/mach/board.h b/arch/arm/mach-tegra/include/mach/board.h
index 10f0f0232b90..51e85fdb7bb5 100644
--- a/arch/arm/mach-tegra/include/mach/board.h
+++ b/arch/arm/mach-tegra/include/mach/board.h
@@ -22,5 +22,11 @@
#define __MACH_TEGRA_BOARD_H
#include <linux/types.h>
+#include "nvodm_pmu.h"
+#include "mach/nvrm_linux.h"
+#include "nvodm_query_discovery.h"
+
+/* ON/off power rail given the GUID */
+void tegra_set_voltage(NvU64 guid, int on);
#endif
diff --git a/arch/arm/mach-tegra/include/mach/pci.h b/arch/arm/mach-tegra/include/mach/pci.h
index 81f149717d05..e5eac3ad5640 100644
--- a/arch/arm/mach-tegra/include/mach/pci.h
+++ b/arch/arm/mach-tegra/include/mach/pci.h
@@ -320,6 +320,4 @@ static inline void __iomem *pci_tegra_config_addr(u8 bus_number,
void pci_tegra_enumerate(void);
-void __init pci_tegra_power(int on);
-
#endif
diff --git a/arch/arm/mach-tegra/pci.c b/arch/arm/mach-tegra/pci.c
index 11cafe2d85ae..5118692b1b79 100644
--- a/arch/arm/mach-tegra/pci.c
+++ b/arch/arm/mach-tegra/pci.c
@@ -33,6 +33,7 @@
#include <mach/pci.h>
#include <mach/nvrm_linux.h>
+#include <mach/board.h>
#include "nvrm_pmu.h"
#include "nvodm_query_discovery.h"
@@ -362,7 +363,7 @@ static int __init pci_tegra_setup(int nr, struct pci_sys_data *data)
0, NULL);
NvRmPowerModuleClockControl(s_hRmGlobal, NvRmPrivModuleID_Pcie,
pci_tegra_powerid, NV_FALSE);
- pci_tegra_power(0);
+ tegra_set_voltage(NV_VDD_PEX_CLK_ODM_ID, 0);
return 0;
}
pci_tegra_device_attached = true;