Arm: tegra: roth: Fix build errors
Vikram Kanigiri [Tue, 20 Nov 2012 07:33:54 +0000 (23:33 -0800)]
1. Remove DT code when DT not supported
2. Remove touch initialisation

Change-Id: I51e75244a098199d1a8f4db9aff347d10509e576
Signed-off-by: Vikram Kanigiri <vkanigiri@nvidia.com>
Reviewed-on: http://git-master/r/165181
Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>

arch/arm/mach-tegra/board-roth-power.c
arch/arm/mach-tegra/board-roth-sensors.c
arch/arm/mach-tegra/board-roth.c

index 64a3eb7..82e2a62 100644 (file)
@@ -695,8 +695,6 @@ static struct soctherm_platform_data roth_soctherm_data = {
        .sensor_data = {
                [TSENSE_CPU0] = {
                        .enable = true,
-                       .therm_a = 570,
-                       .therm_b = -744,
                        .tall = 16300,
                        .tiddq = 1,
                        .ten_count = 1,
@@ -705,8 +703,6 @@ static struct soctherm_platform_data roth_soctherm_data = {
                },
                [TSENSE_CPU1] = {
                        .enable = true,
-                       .therm_a = 570,
-                       .therm_b = -744,
                        .tall = 16300,
                        .tiddq = 1,
                        .ten_count = 1,
@@ -715,8 +711,6 @@ static struct soctherm_platform_data roth_soctherm_data = {
                },
                [TSENSE_CPU2] = {
                        .enable = true,
-                       .therm_a = 570,
-                       .therm_b = -744,
                        .tall = 16300,
                        .tiddq = 1,
                        .ten_count = 1,
@@ -725,8 +719,6 @@ static struct soctherm_platform_data roth_soctherm_data = {
                },
                [TSENSE_CPU3] = {
                        .enable = true,
-                       .therm_a = 570,
-                       .therm_b = -744,
                        .tall = 16300,
                        .tiddq = 1,
                        .ten_count = 1,
@@ -735,8 +727,6 @@ static struct soctherm_platform_data roth_soctherm_data = {
                },
                [TSENSE_MEM0] = {
                        .enable = true,
-                       .therm_a = 570,
-                       .therm_b = -744,
                        .tall = 16300,
                        .tiddq = 1,
                        .ten_count = 1,
@@ -745,8 +735,6 @@ static struct soctherm_platform_data roth_soctherm_data = {
                },
                [TSENSE_MEM1] = {
                        .enable = true,
-                       .therm_a = 570,
-                       .therm_b = -744,
                        .tall = 16300,
                        .tiddq = 1,
                        .ten_count = 1,
@@ -755,8 +743,6 @@ static struct soctherm_platform_data roth_soctherm_data = {
                },
                [TSENSE_GPU] = {
                        .enable = true,
-                       .therm_a = 570,
-                       .therm_b = -744,
                        .tall = 16300,
                        .tiddq = 1,
                        .ten_count = 1,
@@ -765,8 +751,6 @@ static struct soctherm_platform_data roth_soctherm_data = {
                },
                [TSENSE_PLLX] = {
                        .enable = true,
-                       .therm_a = 570,
-                       .therm_b = -744,
                        .tall = 16300,
                        .tiddq = 1,
                        .ten_count = 1,
index a73a8ed..586e430 100644 (file)
@@ -180,26 +180,27 @@ static int roth_nct1008_init(void)
        int ret = 0;
 
 #ifdef CONFIG_TEGRA_EDP_LIMITS
-       const struct tegra_edp_limits *cpu_edp_limits;
-       int cpu_edp_limits_size;
-       int i;
-
-       /* edp capping */
-       tegra_get_cpu_edp_limits(&cpu_edp_limits, &cpu_edp_limits_size);
-
-       if (cpu_edp_limits_size > MAX_THROT_TABLE_SIZE)
-               BUG();
-
-       for (i = 0; i < cpu_edp_limits_size-1; i++) {
-               roth_nct1008_pdata.active[i].create_cdev =
-                       (struct thermal_cooling_device *(*)(void *))
-                               edp_cooling_device_create;
-               roth_nct1008_pdata.active[i].cdev_data = (void *)i;
-               roth_nct1008_pdata.active[i].trip_temp =
-                       cpu_edp_limits[i].temperature * 1000;
-               roth_nct1008_pdata.active[i].hysteresis = 1000;
-       }
-       roth_nct1008_pdata.active[i].create_cdev = NULL;
+               const struct tegra_edp_limits *cpu_edp_limits;
+               struct nct1008_cdev *active_cdev;
+               int cpu_edp_limits_size;
+               int i;
+
+               /* edp capping */
+               tegra_get_cpu_edp_limits(&cpu_edp_limits, &cpu_edp_limits_size);
+
+               if ((cpu_edp_limits_size > MAX_THROT_TABLE_SIZE) ||
+                       (cpu_edp_limits_size > MAX_ACTIVE_TEMP_STATE))
+                       BUG();
+
+               active_cdev = &roth_nct1008_pdata.active;
+               active_cdev->create_cdev = edp_cooling_device_create;
+               active_cdev->hysteresis = 1000;
+
+               for (i = 0; i < cpu_edp_limits_size-1; i++) {
+                       active_cdev->states[i].trip_temp =
+                               cpu_edp_limits[i].temperature * 1000;
+                       active_cdev->states[i].state = i + 1;
+               }
 #endif
 
        roth_i2c4_nct1008_board_info[0].irq = gpio_to_irq(nct1008_port);
index f13107a..2901e47 100644 (file)
@@ -474,7 +474,6 @@ static void __init tegra_roth_init(void)
        roth_suspend_init();
        roth_emc_init();
        roth_edp_init();
-       roth_touch_init();
        roth_panel_init();
        roth_kbc_init();
        roth_setup_bluesleep();
@@ -497,8 +496,10 @@ static void __init tegra_roth_dt_init(void)
 {
        tegra_roth_init();
 
+#ifdef CONFIG_USE_OF
        of_platform_populate(NULL,
                of_default_bus_match_table, NULL, NULL);
+#endif
 }
 
 static void __init tegra_roth_reserve(void)