]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
ARM: tegra: dalmore: support disabling GRHOST
authorJon Mayo <jmayo@nvidia.com>
Wed, 19 Sep 2012 22:05:13 +0000 (15:05 -0700)
committerDan Willemsen <dwillemsen@nvidia.com>
Sat, 14 Sep 2013 19:39:47 +0000 (12:39 -0700)
Fixes build to work if CONFIG_TEGRA_GRHOST is disabled.

Change-Id: I388a520895587d78d4cda5b5e04ec05aee708c0f
Signed-off-by: Jon Mayo <jmayo@nvidia.com>
Reviewed-on: http://git-master/r/133895
(cherry picked from commit 70fe20172dc36eb766bb8657bf7b64a5aa865b8e)
Signed-off-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-on: http://git-master/r/145992
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>
Rebase-Id: R3eb90482dbd8688d145b13623a6ee32aac4cf93c

arch/arm/mach-tegra/board-dalmore-panel.c
arch/arm/mach-tegra/include/mach/hdmi-audio.h

index 6120adfa296dee7867721fe1d37944a7f6ea30f8..eb405af8d25f10f6b5e049a123cb2ac850166f6a 100644 (file)
 #include "board.h"
 #include "devices.h"
 #include "gpio-names.h"
-#ifdef CONFIG_ARCH_TEGRA_3x_SOC
-#include "tegra3_host1x_devices.h"
-#else
 #include "tegra11_host1x_devices.h"
-#endif
 
-#define TEGRA_PANEL_ENABLE     1
+int __init dalmore_host1x_init(void)
+{
+       int err = -EINVAL;
+
+#ifdef CONFIG_TEGRA_GRHOST
+       err = tegra11_register_host1x_devices();
+       if (err) {
+               pr_err("host1x devices registration failed\n");
+               return err;
+       }
+#endif
+       return err;
+}
 
-#if TEGRA_PANEL_ENABLE
+#ifdef CONFIG_TEGRA_DC
 
 #define TEGRA_DSI_GANGED_MODE  0
 #define IS_EXTERNAL_PWM                1
@@ -81,11 +89,9 @@ static struct regulator *vdd_ds_1v8;
 #define en_vdd_bl      TEGRA_GPIO_PG0
 #define lvds_en                TEGRA_GPIO_PG3
 
-#ifdef CONFIG_TEGRA_DC
 static struct regulator *dalmore_hdmi_reg;
 static struct regulator *dalmore_hdmi_pll;
 static struct regulator *dalmore_hdmi_vddio;
-#endif
 
 static struct resource dalmore_disp1_resources[] = {
        {
@@ -920,21 +926,13 @@ int __init dalmore_panel_init(void)
        }
 #endif
 
+       err = dalmore_host1x_init();
+       if (err)
+               return err;
+
        gpio_request(dalmore_hdmi_hpd, "hdmi_hpd");
        gpio_direction_input(dalmore_hdmi_hpd);
 
-#ifdef CONFIG_TEGRA_GRHOST
-#ifdef CONFIG_ARCH_TEGRA_3x_SOC
-       err = tegra3_register_host1x_devices();
-#else
-       err = tegra11_register_host1x_devices();
-#endif
-       if (err) {
-               pr_err("host1x devices registration failed\n");
-               return err;
-       }
-
-#ifdef CONFIG_TEGRA_DC
        res = nvhost_get_resource_byname(&dalmore_disp1_device,
                                         IORESOURCE_MEM, "fbmem");
        res->start = tegra_fb_start;
@@ -972,7 +970,6 @@ int __init dalmore_panel_init(void)
 #if PANEL_11_6_AUO_1920_1080
        i2c_register_board_info(0, &dalmore_tc358770_dsi2edp_board_info, 1);
 #endif
-#endif
 
 #ifdef CONFIG_TEGRA_NVAVP
        err = nvhost_device_register(&nvavp_device);
@@ -980,13 +977,12 @@ int __init dalmore_panel_init(void)
                pr_err("nvavp device registration failed\n");
                return err;
        }
-#endif
 #endif
        return err;
 }
 #else
 int __init dalmore_panel_init(void)
 {
-       return -ENODEV;
+       return dalmore_host1x_init();
 }
 #endif
index 35555504037a3d9bf722eb4f1b6e9afebf607035..ff49d1e4f90970ce9a973b81d8b163fc63516236 100644 (file)
@@ -41,7 +41,11 @@ enum {
 };
 
 int tegra_hdmi_setup_audio_freq_source(unsigned audio_freq, unsigned audio_source);
+#ifdef CONFIG_TEGRA_DC
 int tegra_hdmi_setup_hda_presence(void);
+#else
+static inline int tegra_hdmi_setup_hda_presence(void) { return -ENODEV; }
+#endif
 int tegra_hdmi_audio_null_sample_inject(bool on);
 
 #endif /* __MACH_TEGRA_HDMI_AUDIO_H */