ARM: tegra: fix regulator_get() return value check
[linux-3.10.git] / arch / arm / mach-tegra / board-loki-panel.c
index 65be52f..a2ac263 100644 (file)
 #include "iomap.h"
 #include "tegra12_host1x_devices.h"
 #include "board-panel.h"
+#include "common.h"
 
 struct platform_device * __init loki_host1x_init(void)
 {
        struct platform_device *pdev = NULL;
 
-       pdev = tegra12_register_host1x_devices();
+#ifdef CONFIG_TEGRA_GRHOST
+       if (!of_have_populated_dt())
+               pdev = tegra12_register_host1x_devices();
+       else
+               pdev = to_platform_device(bus_find_device_by_name(
+                       &platform_bus_type, NULL, "host1x"));
 
        if (!pdev) {
                pr_err("host1x devices registration failed\n");
                return NULL;
        }
+#endif
        return pdev;
 }
 
@@ -136,7 +143,7 @@ static int loki_hdmi_enable(struct device *dev)
        int ret;
        if (!loki_hdmi_reg) {
                loki_hdmi_reg = regulator_get(dev, "avdd_hdmi");
-               if (IS_ERR_OR_NULL(loki_hdmi_reg)) {
+               if (IS_ERR(loki_hdmi_reg)) {
                        pr_err("hdmi: couldn't get regulator avdd_hdmi\n");
                        loki_hdmi_reg = NULL;
                        return PTR_ERR(loki_hdmi_reg);
@@ -149,7 +156,7 @@ static int loki_hdmi_enable(struct device *dev)
        }
        if (!loki_hdmi_pll) {
                loki_hdmi_pll = regulator_get(dev, "avdd_hdmi_pll");
-               if (IS_ERR_OR_NULL(loki_hdmi_pll)) {
+               if (IS_ERR(loki_hdmi_pll)) {
                        pr_err("hdmi: couldn't get regulator avdd_hdmi_pll\n");
                        loki_hdmi_pll = NULL;
                        regulator_put(loki_hdmi_reg);
@@ -215,7 +222,7 @@ struct tmds_config loki_tmds_config[] = {
                .pll0 = 0x01003f10,
                .pll1 = 0x10300b00,
                .pe_current = 0x00000000,
-               .drive_current = 0x2e2e2e2e,
+               .drive_current = 0x32323232,
                .peak_current = 0x05050505,
        },
        { /* 1080p / 148.5MHz modes */
@@ -223,7 +230,7 @@ struct tmds_config loki_tmds_config[] = {
                .pll0 = 0x01003f10,
                .pll1 = 0x10300b00,
                .pe_current = 0x00000000,
-               .drive_current = 0x2e2e2e2e,
+               .drive_current = 0x32323232,
                .peak_current = 0x05050505,
        },
        { /* 297MHz modes */
@@ -231,7 +238,7 @@ struct tmds_config loki_tmds_config[] = {
                .pll0 = 0x01003f10,
                .pll1 = 0x13300b00,
                .pe_current = 0x00000000,
-               .drive_current = 0x34343434,
+               .drive_current = 0x36363636,
                .peak_current = 0x07070707,
        },
 };
@@ -472,6 +479,13 @@ int __init loki_panel_init(int board_id)
        loki_carveouts[1].size = tegra_carveout_size;
        loki_carveouts[2].base = tegra_vpr_start;
        loki_carveouts[2].size = tegra_vpr_size;
+#ifdef CONFIG_NVMAP_USE_CMA_FOR_CARVEOUT
+       loki_carveouts[1].cma_dev = &tegra_generic_cma_dev;
+       loki_carveouts[1].resize = false;
+       loki_carveouts[2].cma_dev = &tegra_vpr_cma_dev;
+       loki_carveouts[2].resize = true;
+       loki_carveouts[2].cma_chunk_size = SZ_32M;
+#endif
 
        err = platform_device_register(&loki_nvmap_device);
        if (err) {