arm: tegra: EDP: Allow T575D sku on TN8
Steve Rogers [Mon, 13 Jan 2014 21:43:53 +0000 (15:43 -0600)]
Bug 1439984

Change-Id: I90b2f351f24d197a6c35d5868df0be80725e5509
Signed-off-by: Steve Rogers <srogers@nvidia.com>
Reviewed-on: http://git-master/r/355218
Reviewed-by: Timo Alho <talho@nvidia.com>
Reviewed-by: Matthew Longnecker <mlongnecker@nvidia.com>
Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>

arch/arm/mach-tegra/board-tn8-sysedp.c

index 4f7ce37..817adbe 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013 NVIDIA Corporation. All rights reserved.
+ * Copyright (c) 2013-2014, NVIDIA Corporation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -22,6 +22,7 @@
 #include <mach/edp.h>
 #include "board.h"
 #include "board-panel.h"
+#include "common.h"
 
 /* --- EDP consumers data --- */
 static unsigned int ov5693_states[] = { 0, 300 };
@@ -83,8 +84,8 @@ void __init tn8_new_sysedp_init(void)
 }
 
 static struct tegra_sysedp_platform_data tn8_sysedp_dynamic_capping_platdata = {
-       .corecap = td570d_sysedp_corecap,
-       .corecap_size = td570d_sysedp_corecap_sz,
+       .corecap = td575d_sysedp_corecap,
+       .corecap_size = td575d_sysedp_corecap_sz,
        .core_gain = 100,
        .init_req_watts = 20000,
 };
@@ -98,6 +99,7 @@ static struct platform_device tn8_sysedp_dynamic_capping = {
 void __init tn8_sysedp_dynamic_capping_init(void)
 {
        int r;
+       int sku_id;
 
        tn8_sysedp_dynamic_capping_platdata.cpufreq_lim = tegra_get_system_edp_entries(
                &tn8_sysedp_dynamic_capping_platdata.cpufreq_lim_size);
@@ -106,6 +108,19 @@ void __init tn8_sysedp_dynamic_capping_init(void)
                return;
        }
 
+       sku_id = tegra_get_sku_id();
+       switch (sku_id) {
+       case 0x1F:
+               break;
+       default:
+               pr_warn("%s: Unknown tn8 sku id, %x!  Assuming td570d.\n",
+                               __func__, sku_id);
+       case 0xF:
+               tn8_sysedp_dynamic_capping_platdata.corecap = td570d_sysedp_corecap;
+               tn8_sysedp_dynamic_capping_platdata.corecap_size = td570d_sysedp_corecap_sz;
+               break;
+       }
+
        r = platform_device_register(&tn8_sysedp_dynamic_capping);
        WARN_ON(r);
 }