summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Williams <scwilliams@nvidia.com>2011-06-28 13:09:18 -0700
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:42:49 -0800
commit150a0bd861b0032f0272d982a00b2e980b94d417 (patch)
tree145dd3437aae337505cb2a775ff7bc247b68cae3
parentda45a94d0064aacb55a609fc060fa50abde0c418 (diff)
ARM: tegra: power: Use CONFIG_PM_SLEEP instead of CONFIG_PM
For Linux 2.6.39, CONFIG_PM_SLEEP is the proper kernel configuration parameter to use on Tegra for power management, and not CONFIG_PM. CONFIG_PM does not have the required dependency on CONFIG_SUSPEND necessary to pull in the CPU suspend/resume functionality used by Tegra. Also fixes compilation errors when CONFIG_PM and by implication CONFIG_PM_SLEEP are not configured. Change-Id: I8bb380ae7c6b22759bfbc223febc28f585111aad Reviewed-on: http://git-master/r/40458 Tested-by: Daniel Willemsen <dwillemsen@nvidia.com> Reviewed-by: Scott Williams <scwilliams@nvidia.com> Reviewed-by: Daniel Willemsen <dwillemsen@nvidia.com> Rebase-Id: R61d656cd67439aa9f466c381845d7a4685fc8648
-rw-r--r--arch/arm/mach-tegra/board-seaboard-pinmux.c1
-rw-r--r--arch/arm/mach-tegra/dma.c2
-rw-r--r--arch/arm/mach-tegra/headsmp.S4
-rw-r--r--arch/arm/mach-tegra/include/mach/pinmux-t2.h2
-rw-r--r--arch/arm/mach-tegra/include/mach/pinmux-t3.h2
-rw-r--r--arch/arm/mach-tegra/include/mach/pinmux.h5
-rw-r--r--arch/arm/mach-tegra/irq.c4
-rw-r--r--arch/arm/mach-tegra/pinmux-t2-tables.c2
-rw-r--r--arch/arm/mach-tegra/pinmux-t3-tables.c2
-rw-r--r--arch/arm/mach-tegra/pm-irq.h2
-rw-r--r--arch/arm/mach-tegra/pm.c8
-rw-r--r--arch/arm/mach-tegra/spi_tegra_slave.c4
-rw-r--r--arch/arm/mach-tegra/sysfs-cluster.c16
-rw-r--r--arch/arm/mach-tegra/tegra2_clocks.c2
-rw-r--r--arch/arm/mach-tegra/tegra3_clocks.c2
-rw-r--r--arch/arm/mach-tegra/tegra_i2s_audio.c6
-rw-r--r--arch/arm/mach-tegra/tegra_spdif_audio.c6
-rw-r--r--drivers/gpio/gpio-tegra.c4
18 files changed, 36 insertions, 38 deletions
diff --git a/arch/arm/mach-tegra/board-seaboard-pinmux.c b/arch/arm/mach-tegra/board-seaboard-pinmux.c
index 0bda495e9742..56dc2c279289 100644
--- a/arch/arm/mach-tegra/board-seaboard-pinmux.c
+++ b/arch/arm/mach-tegra/board-seaboard-pinmux.c
@@ -17,7 +17,6 @@
#include <linux/gpio.h>
#include <mach/pinmux.h>
-#include <mach/pinmux-t2.h>
#include "gpio-names.h"
#include "board-seaboard.h"
diff --git a/arch/arm/mach-tegra/dma.c b/arch/arm/mach-tegra/dma.c
index 480397be3fe2..7a31a5da274d 100644
--- a/arch/arm/mach-tegra/dma.c
+++ b/arch/arm/mach-tegra/dma.c
@@ -979,7 +979,7 @@ fail:
}
postcore_initcall(tegra_dma_init);
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
static u32 apb_dma[5*TEGRA_SYSTEM_DMA_CH_NR + 3];
diff --git a/arch/arm/mach-tegra/headsmp.S b/arch/arm/mach-tegra/headsmp.S
index 34e521b412df..e746423b543b 100644
--- a/arch/arm/mach-tegra/headsmp.S
+++ b/arch/arm/mach-tegra/headsmp.S
@@ -42,7 +42,7 @@ ENTRY(tegra_secondary_startup)
ENDPROC(tegra_secondary_startup)
#endif
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
/*
* tegra_secondary_resume
*
@@ -56,7 +56,7 @@ ENDPROC(tegra_secondary_resume)
#endif
#endif
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
/*
* tegra_resume
*
diff --git a/arch/arm/mach-tegra/include/mach/pinmux-t2.h b/arch/arm/mach-tegra/include/mach/pinmux-t2.h
index c953775ac919..4c2626347263 100644
--- a/arch/arm/mach-tegra/include/mach/pinmux-t2.h
+++ b/arch/arm/mach-tegra/include/mach/pinmux-t2.h
@@ -17,8 +17,6 @@
#ifndef __MACH_TEGRA_PINMUX_T2_H
#define __MACH_TEGRA_PINMUX_T2_H
-void tegra_init_pinmux(void);
-
enum tegra_pingroup {
TEGRA_PINGROUP_ATA = 0,
TEGRA_PINGROUP_ATB,
diff --git a/arch/arm/mach-tegra/include/mach/pinmux-t3.h b/arch/arm/mach-tegra/include/mach/pinmux-t3.h
index af07614358a3..1f80fd18ed91 100644
--- a/arch/arm/mach-tegra/include/mach/pinmux-t3.h
+++ b/arch/arm/mach-tegra/include/mach/pinmux-t3.h
@@ -17,8 +17,6 @@
#ifndef __MACH_TEGRA_PINMUX_T3_H
#define __MACH_TEGRA_PINMUX_T3_H
-void tegra_init_pinmux(void);
-
#define TEGRA_PINMUX_HAS_IO_DIRECTION 1
enum tegra_pingroup {
diff --git a/arch/arm/mach-tegra/include/mach/pinmux.h b/arch/arm/mach-tegra/include/mach/pinmux.h
index 09af077d9f3d..894a1cbbeb99 100644
--- a/arch/arm/mach-tegra/include/mach/pinmux.h
+++ b/arch/arm/mach-tegra/include/mach/pinmux.h
@@ -331,6 +331,9 @@ void tegra_pinmux_config_tristate_table(const struct tegra_pingroup_config *conf
void tegra_pinmux_config_pullupdown_table(const struct tegra_pingroup_config *config,
int len, enum tegra_pullupdown pupd);
+#ifdef CONFIG_PM_SLEEP
void tegra_init_pinmux(void);
+#else
+static inline void tegra_init_pinmux(void) {}
+#endif
#endif
-
diff --git a/arch/arm/mach-tegra/irq.c b/arch/arm/mach-tegra/irq.c
index 5c99112d9ccb..59472fb39430 100644
--- a/arch/arm/mach-tegra/irq.c
+++ b/arch/arm/mach-tegra/irq.c
@@ -62,7 +62,7 @@ static void __iomem *ictlr_reg_base[] = {
#endif
};
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
static u32 cop_ier[NUM_ICTLRS];
static u32 cpu_ier[NUM_ICTLRS];
static u32 cpu_iep[NUM_ICTLRS];
@@ -130,7 +130,7 @@ static int tegra_set_type(struct irq_data *d, unsigned int flow_type)
}
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
static int tegra_set_wake(struct irq_data *d, unsigned int enable)
{
return tegra_pm_irq_set_wake(d->irq, enable);
diff --git a/arch/arm/mach-tegra/pinmux-t2-tables.c b/arch/arm/mach-tegra/pinmux-t2-tables.c
index b1bf7450f458..20f441994113 100644
--- a/arch/arm/mach-tegra/pinmux-t2-tables.c
+++ b/arch/arm/mach-tegra/pinmux-t2-tables.c
@@ -222,7 +222,7 @@ const struct tegra_pingroup_desc tegra_soc_pingroups[TEGRA_MAX_PINGROUP] = {
PINGROUP(XM2D, DDR, RSVD, RSVD, RSVD, RSVD, RSVD, -1, -1, -1, -1, 0xA8, 28),
};
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
#define TRISTATE_REG_A 0x14
#define TRISTATE_REG_NUM 4
#define PIN_MUX_CTL_REG_A 0x80
diff --git a/arch/arm/mach-tegra/pinmux-t3-tables.c b/arch/arm/mach-tegra/pinmux-t3-tables.c
index e607c6d94b0a..7b8979cba6e0 100644
--- a/arch/arm/mach-tegra/pinmux-t3-tables.c
+++ b/arch/arm/mach-tegra/pinmux-t3-tables.c
@@ -358,7 +358,7 @@ const struct tegra_pingroup_desc tegra_soc_pingroups[TEGRA_MAX_PINGROUP] = {
PINGROUP(HDMI_CEC, SYS, CEC, RSVD1, RSVD2, RSVD3, RSVD, INPUT, 0x33e0),
};
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
static u32 pinmux_reg[TEGRA_MAX_PINGROUP +
ARRAY_SIZE(tegra_soc_drive_pingroups)];
diff --git a/arch/arm/mach-tegra/pm-irq.h b/arch/arm/mach-tegra/pm-irq.h
index 8242b9202f80..8e87b4bba246 100644
--- a/arch/arm/mach-tegra/pm-irq.h
+++ b/arch/arm/mach-tegra/pm-irq.h
@@ -18,7 +18,7 @@
#ifndef _MACH_TERA_PM_IRQ_H_
#define _MACH_TERA_PM_IRQ_H_
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
int tegra_pm_irq_set_wake(int irq, int enable);
int tegra_pm_irq_set_wake_type(int irq, int flow_type);
bool tegra_pm_irq_lp0_allowed(void);
diff --git a/arch/arm/mach-tegra/pm.c b/arch/arm/mach-tegra/pm.c
index 7d7bf9de9121..85adea53d7b4 100644
--- a/arch/arm/mach-tegra/pm.c
+++ b/arch/arm/mach-tegra/pm.c
@@ -87,7 +87,7 @@ struct suspend_context tegra_sctx;
static void __iomem *iram_code = IO_ADDRESS(TEGRA_IRAM_CODE_AREA);
static void __iomem *pmc = IO_ADDRESS(TEGRA_PMC_BASE);
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
static void __iomem *clk_rst = IO_ADDRESS(TEGRA_CLK_RESET_BASE);
static void __iomem *evp_reset =
IO_ADDRESS(TEGRA_EXCEPTION_VECTORS_BASE) + 0x100;
@@ -220,7 +220,7 @@ static void tegra_suspend_check_pwr_stats(void)
(1 << TEGRA_POWERGATE_PCIE) |
(1 << TEGRA_POWERGATE_VDEC) |
(1 << TEGRA_POWERGATE_MPE);
-
+
int partid;
for (partid = 0; partid < TEGRA_NUM_POWERGATE; partid++)
@@ -343,7 +343,7 @@ static void tegra_wake_reset_cpu(int cpu)
flowctrl_writel(0, FLOW_CTRL_HALT_CPU(1));
}
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
/*
* restore_cpu_complex
*
@@ -864,7 +864,7 @@ void __init tegra_init_suspend(struct tegra_suspend_platform_data *plat)
create_suspend_pgtable();
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
if ((tegra_get_chipid() == TEGRA_CHIPID_TEGRA3) &&
(tegra_get_revision() == TEGRA_REVISION_A01) &&
diff --git a/arch/arm/mach-tegra/spi_tegra_slave.c b/arch/arm/mach-tegra/spi_tegra_slave.c
index a25813241c42..692bfe4b1a34 100644
--- a/arch/arm/mach-tegra/spi_tegra_slave.c
+++ b/arch/arm/mach-tegra/spi_tegra_slave.c
@@ -892,7 +892,7 @@ void spi_tegra_abort_transfer(struct spi_device *spi)
}
EXPORT_SYMBOL(spi_tegra_abort_transfer);
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
static int spi_tegra_suspend(struct platform_device *pdev, pm_message_t state)
{
struct spi_master *master;
@@ -944,7 +944,7 @@ static struct platform_driver spi_tegra_driver = {
.owner = THIS_MODULE,
},
.remove = __devexit_p(spi_tegra_remove),
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
.suspend = spi_tegra_suspend,
.resume = spi_tegra_resume,
#endif
diff --git a/arch/arm/mach-tegra/sysfs-cluster.c b/arch/arm/mach-tegra/sysfs-cluster.c
index e6c06fcabce5..4fcaffd9ff3d 100644
--- a/arch/arm/mach-tegra/sysfs-cluster.c
+++ b/arch/arm/mach-tegra/sysfs-cluster.c
@@ -133,7 +133,7 @@ static struct kobj_attribute cluster_force_attr =
static struct kobj_attribute cluster_wake_ms_attr =
__ATTR(wake_ms, 0640, sysfscluster_show, sysfscluster_store);
-#if defined(CONFIG_PM) && SYSFS_CLUSTER_POWER_MODE
+#if defined(CONFIG_PM_SLEEP) && SYSFS_CLUSTER_POWER_MODE
/* LPx power mode to use when switching CPUs: 1=LP1, 2=LP2 */
static unsigned int power_mode = 2;
static struct kobj_attribute cluster_powermode_attr =
@@ -153,7 +153,7 @@ typedef enum
ClusterAttr_Immediate,
ClusterAttr_Force,
ClusterAttr_WakeMs,
-#if defined(CONFIG_PM) && SYSFS_CLUSTER_POWER_MODE
+#if defined(CONFIG_PM_SLEEP) && SYSFS_CLUSTER_POWER_MODE
ClusterAttr_PowerMode,
#endif
#if DEBUG_CLUSTER_SWITCH
@@ -171,7 +171,7 @@ static ClusterAttr GetClusterAttr(const char *name)
return ClusterAttr_Force;
if (!strcmp(name, "wake_ms"))
return ClusterAttr_WakeMs;
-#if defined(CONFIG_PM) && SYSFS_CLUSTER_POWER_MODE
+#if defined(CONFIG_PM_SLEEP) && SYSFS_CLUSTER_POWER_MODE
if (!strcmp(name, "power_mode"))
return ClusterAttr_PowerMode;
#endif
@@ -211,7 +211,7 @@ static ssize_t sysfscluster_show(struct kobject *kobj,
len = sprintf(buf, "%d\n", wake_ms);
break;
-#if defined(CONFIG_PM) && SYSFS_CLUSTER_POWER_MODE
+#if defined(CONFIG_PM_SLEEP) && SYSFS_CLUSTER_POWER_MODE
case ClusterAttr_PowerMode:
len = sprintf(buf, "%d\n", power_mode);
break;
@@ -288,7 +288,7 @@ static ssize_t sysfscluster_store(struct kobject *kobj,
(flags & TEGRA_POWER_CLUSTER_G) ? "G" : "LP"));
request = flags;
-#if defined(CONFIG_PM) && SYSFS_CLUSTER_POWER_MODE
+#if defined(CONFIG_PM_SLEEP) && SYSFS_CLUSTER_POWER_MODE
if (power_mode == 1) {
request |= TEGRA_POWER_SDRAM_SELFREFRESH;
}
@@ -341,7 +341,7 @@ static ssize_t sysfscluster_store(struct kobject *kobj,
PRINT_CLUSTER(("cluster/wake_ms -> %d\n", wake_ms));
break;
-#if defined(CONFIG_PM) && SYSFS_CLUSTER_POWER_MODE
+#if defined(CONFIG_PM_SLEEP) && SYSFS_CLUSTER_POWER_MODE
case ClusterAttr_PowerMode:
if ((count == 1) && (*buf == '2'))
power_mode = 2;
@@ -416,7 +416,7 @@ static int __init sysfscluster_init(void)
CREATE_FILE(immediate);
CREATE_FILE(force);
CREATE_FILE(wake_ms);
-#if defined(CONFIG_PM) && SYSFS_CLUSTER_POWER_MODE
+#if defined(CONFIG_PM_SLEEP) && SYSFS_CLUSTER_POWER_MODE
CREATE_FILE(powermode);
#endif
#if DEBUG_CLUSTER_SWITCH
@@ -444,7 +444,7 @@ static void __exit sysfscluster_exit(void)
#if DEBUG_CLUSTER_SWITCH
REMOVE_FILE(debug);
#endif
-#if defined(CONFIG_PM) && SYSFS_CLUSTER_POWER_MODE
+#if defined(CONFIG_PM_SLEEP) && SYSFS_CLUSTER_POWER_MODE
REMOVE_FILE(powermode);
#endif
REMOVE_FILE(wake_ms);
diff --git a/arch/arm/mach-tegra/tegra2_clocks.c b/arch/arm/mach-tegra/tegra2_clocks.c
index 3952578f43b7..e76b6f4dd741 100644
--- a/arch/arm/mach-tegra/tegra2_clocks.c
+++ b/arch/arm/mach-tegra/tegra2_clocks.c
@@ -2611,7 +2611,7 @@ unsigned long tegra_emc_to_cpu_ratio(unsigned long cpu_rate)
}
#endif
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
static u32 clk_rst_suspend[RST_DEVICES_NUM + CLK_OUT_ENB_NUM +
PERIPH_CLK_SOURCE_NUM + 22];
diff --git a/arch/arm/mach-tegra/tegra3_clocks.c b/arch/arm/mach-tegra/tegra3_clocks.c
index 025a04ffcae8..5e78aecc432d 100644
--- a/arch/arm/mach-tegra/tegra3_clocks.c
+++ b/arch/arm/mach-tegra/tegra3_clocks.c
@@ -3878,7 +3878,7 @@ unsigned long tegra_emc_to_cpu_ratio(unsigned long cpu_rate)
}
#endif
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
static u32 clk_rst_suspend[RST_DEVICES_NUM + CLK_OUT_ENB_NUM +
PERIPH_CLK_SOURCE_NUM + 18];
diff --git a/arch/arm/mach-tegra/tegra_i2s_audio.c b/arch/arm/mach-tegra/tegra_i2s_audio.c
index b37617e5d5a4..b701d13e1f17 100644
--- a/arch/arm/mach-tegra/tegra_i2s_audio.c
+++ b/arch/arm/mach-tegra/tegra_i2s_audio.c
@@ -1912,7 +1912,7 @@ static int tegra_audio_probe(struct platform_device *pdev)
return 0;
}
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
static int tegra_audio_suspend(struct platform_device *pdev, pm_message_t mesg)
{
/* dev_info(&pdev->dev, "%s\n", __func__); */
@@ -1923,7 +1923,7 @@ static int tegra_audio_resume(struct platform_device *pdev)
{
return i2s_configure(pdev);
}
-#endif /* CONFIG_PM */
+#endif /* CONFIG_PM_SLEEP */
static struct platform_driver tegra_audio_driver = {
.driver = {
@@ -1931,7 +1931,7 @@ static struct platform_driver tegra_audio_driver = {
.owner = THIS_MODULE,
},
.probe = tegra_audio_probe,
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
.suspend = tegra_audio_suspend,
.resume = tegra_audio_resume,
#endif
diff --git a/arch/arm/mach-tegra/tegra_spdif_audio.c b/arch/arm/mach-tegra/tegra_spdif_audio.c
index 64a85c28efaa..81b84de34255 100644
--- a/arch/arm/mach-tegra/tegra_spdif_audio.c
+++ b/arch/arm/mach-tegra/tegra_spdif_audio.c
@@ -1143,7 +1143,7 @@ static int tegra_spdif_probe(struct platform_device *pdev)
return 0;
}
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
static int tegra_spdif_suspend(struct platform_device *pdev, pm_message_t mesg)
{
/* dev_info(&pdev->dev, "%s\n", __func__); */
@@ -1154,7 +1154,7 @@ static int tegra_spdif_resume(struct platform_device *pdev)
{
return spdif_configure(pdev);
}
-#endif /* CONFIG_PM */
+#endif /* CONFIG_PM_SLEEP */
static struct platform_driver tegra_spdif_driver = {
.driver = {
@@ -1162,7 +1162,7 @@ static struct platform_driver tegra_spdif_driver = {
.owner = THIS_MODULE,
},
.probe = tegra_spdif_probe,
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
.suspend = tegra_spdif_suspend,
.resume = tegra_spdif_resume,
#endif
diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c
index a5688905cfed..e42ebe0be017 100644
--- a/drivers/gpio/gpio-tegra.c
+++ b/drivers/gpio/gpio-tegra.c
@@ -83,7 +83,7 @@ struct tegra_gpio_bank {
int bank;
int irq;
spinlock_t lvl_lock[4];
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
u32 cnf[4];
u32 out[4];
u32 oe[4];
@@ -274,7 +274,7 @@ static void tegra_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
}
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
static void tegra_gpio_resume(void)
{
unsigned long flags;