ARM: tegra12: set CPU rate to 2.2GHz for sku 0x87
[linux-3.10.git] / arch / arm / mach-tegra / board-macallan-panel.c
index f87de68..4db92d8 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * arch/arm/mach-tegra/board-macallan-panel.c
  *
- * Copyright (c) 2013, NVIDIA Corporation.
+ * Copyright (c) 2013, 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 as published by
@@ -150,7 +150,7 @@ static int macallan_hdmi_enable(struct device *dev)
        int ret;
        if (!macallan_hdmi_reg) {
                macallan_hdmi_reg = regulator_get(dev, "avdd_hdmi");
-               if (IS_ERR_OR_NULL(macallan_hdmi_reg)) {
+               if (IS_ERR(macallan_hdmi_reg)) {
                        pr_err("hdmi: couldn't get regulator avdd_hdmi\n");
                        macallan_hdmi_reg = NULL;
                        return PTR_ERR(macallan_hdmi_reg);
@@ -163,7 +163,7 @@ static int macallan_hdmi_enable(struct device *dev)
        }
        if (!macallan_hdmi_pll) {
                macallan_hdmi_pll = regulator_get(dev, "avdd_hdmi_pll");
-               if (IS_ERR_OR_NULL(macallan_hdmi_pll)) {
+               if (IS_ERR(macallan_hdmi_pll)) {
                        pr_err("hdmi: couldn't get regulator avdd_hdmi_pll\n");
                        macallan_hdmi_pll = NULL;
                        regulator_put(macallan_hdmi_reg);
@@ -208,19 +208,22 @@ static int macallan_hdmi_postsuspend(void)
 
 static int macallan_hdmi_hotplug_init(struct device *dev)
 {
+       int e = 0;
+
        if (!macallan_hdmi_vddio) {
                macallan_hdmi_vddio = regulator_get(dev, "vdd_hdmi_5v0");
                if (WARN_ON(IS_ERR(macallan_hdmi_vddio))) {
-                       pr_err("%s: couldn't get regulator vdd_hdmi_5v0: %ld\n",
-                               __func__, PTR_ERR(macallan_hdmi_vddio));
-                               macallan_hdmi_vddio = NULL;
+                       e = PTR_ERR(macallan_hdmi_vddio);
+                       pr_err("%s: couldn't get regulator vdd_hdmi_5v0: %d\n",
+                               __func__, e);
+                       macallan_hdmi_vddio = NULL;
                } else {
-                       regulator_enable(macallan_hdmi_vddio);
+                       e = regulator_enable(macallan_hdmi_vddio);
                        mdelay(5);
                }
        }
 
-       return 0;
+       return e;
 }
 
 static struct tegra_dc_out macallan_disp2_out = {
@@ -271,6 +274,9 @@ static struct tegra_dc_platform_data macallan_disp2_pdata = {
        .default_out    = &macallan_disp2_out,
        .fb             = &macallan_disp2_fb_data,
        .emc_clk_rate   = 300000000,
+#ifdef CONFIG_TEGRA_DC_CMU
+       .cmu_enable     = 1,
+#endif
 };
 
 static struct platform_device macallan_disp2_device = {
@@ -321,7 +327,7 @@ static struct nvmap_platform_data macallan_nvmap_data = {
        .carveouts      = macallan_carveouts,
        .nr_carveouts   = ARRAY_SIZE(macallan_carveouts),
 };
-static struct platform_device macallan_nvmap_device __initdata = {
+static struct platform_device macallan_nvmap_device = {
        .name   = "tegra-nvmap",
        .id     = -1,
        .dev    = {
@@ -329,67 +335,20 @@ static struct platform_device macallan_nvmap_device __initdata = {
        },
 };
 
-static struct tegra_dc_sd_settings macallan_sd_settings = {
-       .enable = 1, /* enabled by default. */
-       .use_auto_pwm = false,
-       .hw_update_delay = 0,
-       .bin_width = -1,
-       .aggressiveness = 5,
-       .use_vid_luma = false,
-       .phase_in_adjustments = 0,
-       .k_limit_enable = true,
-       .k_limit = 200,
-       .sd_window_enable = false,
-       .soft_clipping_enable = true,
-       /* Low soft clipping threshold to compensate for aggressive k_limit */
-       .soft_clipping_threshold = 128,
-       .smooth_k_enable = true,
-       .smooth_k_incr = 4,
-       /* Default video coefficients */
-       .coeff = {5, 9, 2},
-       .fc = {0, 0},
-       /* Immediate backlight changes */
-       .blp = {1024, 255},
-       /* Gammas: R: 2.2 G: 2.2 B: 2.2 */
-       /* Default BL TF */
-       .bltf = {
-                       {
-                               {57, 65, 73, 82},
-                               {92, 103, 114, 125},
-                               {138, 150, 164, 178},
-                               {193, 208, 224, 241},
-                       },
-               },
-       /* Default LUT */
-       .lut = {
-                       {
-                               {255, 255, 255},
-                               {199, 199, 199},
-                               {153, 153, 153},
-                               {116, 116, 116},
-                               {85, 85, 85},
-                               {59, 59, 59},
-                               {36, 36, 36},
-                               {17, 17, 17},
-                               {0, 0, 0},
-                       },
-               },
-       .sd_brightness = &sd_brightness,
-       .use_vpulse2 = true,
-};
-
 static void macallan_panel_select(void)
 {
        struct tegra_panel *panel = NULL;
        struct board_info board;
-       u8 dsi_instance;
+       u8 dsi_instance = DSI_INSTANCE_0;
 
        tegra_get_display_board_info(&board);
 
        switch (board.board_id) {
+       case BOARD_E1639:
+               panel = &dsi_s_wqxga_10_1;
+               break;
        default:
                panel = &dsi_p_wuxga_10_1;
-               dsi_instance = DSI_INSTANCE_0;
                break;
        }
        if (panel) {
@@ -431,8 +390,6 @@ int __init macallan_panel_init(void)
        struct resource __maybe_unused *res;
        struct platform_device *phost1x = NULL;
 
-       sd_settings = macallan_sd_settings;
-
        macallan_panel_select();
 
 #ifdef CONFIG_TEGRA_NVMAP
@@ -464,11 +421,6 @@ int __init macallan_panel_init(void)
                tegra_fb_start, tegra_bootloader_fb_start,
                        min(tegra_fb_size, tegra_bootloader_fb_size));
 
-       res = platform_get_resource_byname(&macallan_disp2_device,
-               IORESOURCE_MEM, "fbmem");
-       res->start = tegra_fb2_start;
-       res->end = tegra_fb2_start + tegra_fb2_size - 1;
-
        macallan_disp1_device.dev.parent = &phost1x->dev;
        err = platform_device_register(&macallan_disp1_device);
        if (err) {
@@ -476,12 +428,9 @@ int __init macallan_panel_init(void)
                return err;
        }
 
-       macallan_disp2_device.dev.parent = &phost1x->dev;
-       err = platform_device_register(&macallan_disp2_device);
-       if (err) {
-               pr_err("disp2 device registration failed\n");
+       err = tegra_init_hdmi(&macallan_disp2_device, phost1x);
+       if (err)
                return err;
-       }
 
 #ifdef CONFIG_TEGRA_NVAVP
        nvavp_device.dev.parent = &phost1x->dev;