From f858b6f21fc3381cd9f490dd63bf5f519002d3e2 Mon Sep 17 00:00:00 2001 From: Peter De Schrijver Date: Thu, 6 Sep 2012 17:55:28 +0300 Subject: [PATCH 1/3] ARM: tegra: fix return value for debugfs init tegra_powergate_debugfs_init() always returns -ENOMEM. It shouldn't do that when registering the debugfs entry succeeded. Signed-off-by: Peter De Schrijver Signed-off-by: Stephen Warren --- arch/arm/mach-tegra/powergate.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/arm/mach-tegra/powergate.c b/arch/arm/mach-tegra/powergate.c index 15d506501ccc..27aee4ad1ae4 100644 --- a/arch/arm/mach-tegra/powergate.c +++ b/arch/arm/mach-tegra/powergate.c @@ -237,14 +237,13 @@ static const struct file_operations powergate_fops = { int __init tegra_powergate_debugfs_init(void) { struct dentry *d; - int err = -ENOMEM; d = debugfs_create_file("powergate", S_IRUGO, NULL, NULL, &powergate_fops); if (!d) return -ENOMEM; - return err; + return 0; } #endif From b48d6aab37403fb34fe18dd90791cb60f3265f13 Mon Sep 17 00:00:00 2001 From: Peter De Schrijver Date: Thu, 6 Sep 2012 17:55:29 +0300 Subject: [PATCH 2/3] ARM: tegra: fix debugfs entry for Tegra30 Tegra30 has more powerdomains than Tegra20. The debugfs code did not take this into account. Signed-off-by: Peter De Schrijver Signed-off-by: Stephen Warren --- arch/arm/mach-tegra/powergate.c | 40 ++++++++++++++++++++++++++++----- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-tegra/powergate.c b/arch/arm/mach-tegra/powergate.c index 27aee4ad1ae4..de0662de28a0 100644 --- a/arch/arm/mach-tegra/powergate.c +++ b/arch/arm/mach-tegra/powergate.c @@ -199,7 +199,9 @@ int __init tegra_powergate_init(void) #ifdef CONFIG_DEBUG_FS -static const char * const powergate_name[] = { +static const char * const *powergate_name; + +static const char * const powergate_name_t20[] = { [TEGRA_POWERGATE_CPU] = "cpu", [TEGRA_POWERGATE_3D] = "3d", [TEGRA_POWERGATE_VENC] = "venc", @@ -209,6 +211,23 @@ static const char * const powergate_name[] = { [TEGRA_POWERGATE_MPE] = "mpe", }; +static const char * const powergate_name_t30[] = { + [TEGRA_POWERGATE_CPU] = "cpu0", + [TEGRA_POWERGATE_3D] = "3d0", + [TEGRA_POWERGATE_VENC] = "venc", + [TEGRA_POWERGATE_VDEC] = "vdec", + [TEGRA_POWERGATE_PCIE] = "pcie", + [TEGRA_POWERGATE_L2] = "l2", + [TEGRA_POWERGATE_MPE] = "mpe", + [TEGRA_POWERGATE_HEG] = "heg", + [TEGRA_POWERGATE_SATA] = "sata", + [TEGRA_POWERGATE_CPU1] = "cpu1", + [TEGRA_POWERGATE_CPU2] = "cpu2", + [TEGRA_POWERGATE_CPU3] = "cpu3", + [TEGRA_POWERGATE_CELP] = "celp", + [TEGRA_POWERGATE_3D1] = "3d1", +}; + static int powergate_show(struct seq_file *s, void *data) { int i; @@ -238,10 +257,21 @@ int __init tegra_powergate_debugfs_init(void) { struct dentry *d; - d = debugfs_create_file("powergate", S_IRUGO, NULL, NULL, - &powergate_fops); - if (!d) - return -ENOMEM; + switch (tegra_chip_id) { + case TEGRA20: + powergate_name = powergate_name_t20; + break; + case TEGRA30: + powergate_name = powergate_name_t30; + break; + } + + if (powergate_name) { + d = debugfs_create_file("powergate", S_IRUGO, NULL, NULL, + &powergate_fops); + if (!d) + return -ENOMEM; + } return 0; } From 4b1082ca8cd3bec99fc0ce020a8ba1fa3aa8e22a Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Wed, 5 Sep 2012 09:58:27 -0600 Subject: [PATCH 3/3] ARM: enable SUSPEND/ARCH_SUSPEND_POSSIBLE for ARCH_TEGRA Even though system suspend/resume hasn't been validated on Tegra yet, this Kconfig option needs to be enabled so that system shutdown is reliable on an SMP system. Without it, I2C interrupts may be routed to CPU0, whereas shutdown code may be running on CPU1, causing I2C timeouts, preventing communication with the external PMIC. This reverts 3d5e8af "ARM: disable SUSPEND/ARCH_SUSPEND_POSSIBLE for ARCH_TEGRA". Signed-off-by: Stephen Warren --- arch/arm/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index c5f9ae5dbd1a..f134dd88fe88 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -2313,7 +2313,7 @@ menu "Power management options" source "kernel/power/Kconfig" config ARCH_SUSPEND_POSSIBLE - depends on !ARCH_S5PC100 && !ARCH_TEGRA + depends on !ARCH_S5PC100 depends on CPU_ARM920T || CPU_ARM926T || CPU_SA1100 || \ CPU_V6 || CPU_V6K || CPU_V7 || CPU_XSC3 || CPU_XSCALE || CPU_MOHAWK def_bool y