arm: tegra: macallan: enable OC4 interrupt
Tony Liu [Mon, 6 May 2013 05:48:54 +0000 (05:48 +0000)]
Following are changes:
-provide base interrupt for soc therm to support OC interrupt
-enable CPU/GPU throttling through OC4 interrupt

Bug 1255452

Change-Id: I19d0194fc411df4da73d2f6dc5abc0c5ab7937a9
Signed-off-by: Tony Liu <tonliu@nvidia.com>
Reviewed-on: http://git-master/r/225550
Reviewed-by: Riham Haidar <rhaidar@nvidia.com>
Tested-by: Riham Haidar <rhaidar@nvidia.com>

arch/arm/mach-tegra/board-macallan-pinmux.c
arch/arm/mach-tegra/board-macallan-power.c
arch/arm/mach-tegra/board-macallan.h

index 41ee6e8..4615994 100644 (file)
@@ -78,7 +78,6 @@ static struct tegra_pingroup_config macallan_sleep_pinmux[] = {
        GPIO_PINMUX(SPDIF_IN, NORMAL, NORMAL, OUTPUT, DISABLE),
        /* VDDIO_GMI*/
        DEFAULT_PINMUX(GMI_AD7,       SPI4,        NORMAL,   NORMAL,   INPUT),
-       DEFAULT_PINMUX(GMI_CS1_N,     SOC,         NORMAL,   NORMAL,   INPUT),
        GPIO_PINMUX(GMI_CS2_N,  NORMAL,   NORMAL,   INPUT,   DISABLE),
        GPIO_PINMUX(GMI_CS7_N,  NORMAL,   NORMAL,   INPUT,   DISABLE),
 };
index 05f2d67..3686c79 100644 (file)
@@ -741,6 +741,8 @@ static struct tegra_tsensor_pmu_data tpdata_palmas = {
 };
 
 static struct soctherm_platform_data macallan_soctherm_data = {
+       .oc_irq_base = TEGRA_SOC_OC_IRQ_BASE,
+       .num_oc_irqs = TEGRA_SOC_OC_NUM_IRQ,
        .therm = {
                [THERM_CPU] = {
                        .zone_enable = true,
@@ -788,6 +790,21 @@ static struct soctherm_platform_data macallan_soctherm_data = {
                                },
                        },
                },
+               [THROTTLE_OC4] = {
+                       .throt_mode = BRIEF,
+                       .polarity = 1,
+                       .intr = true,
+                       .devs = {
+                               [THROTTLE_DEV_CPU] = {
+                                       .enable = true,
+                                       .depth = 50,
+                               },
+                               [THROTTLE_DEV_GPU] = {
+                                       .enable = true,
+                                       .depth = 50,
+                               },
+                       },
+               },
        },
        .tshut_pmu_trip_data = &tpdata_palmas,
 };
index ea643bc..7beb594 100644 (file)
@@ -23,6 +23,9 @@
 #include <mach/gpio.h>
 #include <mach/irqs.h>
 #include "gpio-names.h"
+#include <linux/thermal.h>
+#include <linux/platform_data/thermal_sensors.h>
+#include "tegra11_soctherm.h"
 
 #define PMC_WAKE_STATUS 0x14
 #define PMC_WAKE2_STATUS 0x168
 #define TEGRA_GPIO_INT_MIC_EN          TEGRA_GPIO_PK3
 #define TEGRA_GPIO_EXT_MIC_EN          -1
 
+#define TEGRA_SOC_OC_IRQ_BASE          TEGRA_NR_IRQS
+#define TEGRA_SOC_OC_NUM_IRQ           TEGRA_SOC_OC_IRQ_MAX
+
 /* External peripheral act as interrupt controller */
-#define PALMAS_TEGRA_IRQ_BASE   TEGRA_NR_IRQS
+#define PALMAS_TEGRA_IRQ_BASE  (TEGRA_SOC_OC_IRQ_BASE + TEGRA_SOC_OC_NUM_IRQ)
 #define PALMAS_TEGRA_IRQ_END   (PALMAS_TEGRA_IRQ_BASE + PALMAS_NUM_IRQ)
 
 /* I2C related GPIOs */