diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2011-10-06 10:55:04 +0300 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:49:26 -0800 |
commit | 753cdc02611cd5792dcee1b805b470aceae9f28d (patch) | |
tree | c015062fd187c3be3f41ee72990758c6daa6e6d1 | |
parent | d229bde19ad403fb74c72ff8fb253f87c91cf714 (diff) |
arm: tegra: Make kernel buildable without nvhost
Cuts dependencies to nvhost by adding a Kconfig dependency from DC to
GRHOST and from HD Audio to DC. Configure out calls to nvhost in board
panel files if GRHOST is not present.
Bug 870898
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Change-Id: If7830528e321e951bcadc2a10515e6cab58a6cdf
Reviewed-on: http://git-master/r/56370
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: Antti Miettinen <amiettinen@nvidia.com>
Tested-by: Antti Miettinen <amiettinen@nvidia.com>
Reviewed-by: Scott Williams <scwilliams@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
Reviewed-by: Chris Dragan <kdragan@nvidia.com>
Rebase-Id: R16d9286d67235b0697c914476e7d6462eec7f3ac
-rw-r--r-- | arch/arm/mach-tegra/board-aruba-panel.c | 10 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-cardhu-panel.c | 26 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-enterprise-panel.c | 21 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-ventana-panel.c | 19 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-whistler-panel.c | 12 | ||||
-rw-r--r-- | drivers/media/video/tegra/nvavp/Kconfig | 2 | ||||
-rw-r--r-- | drivers/video/tegra/Kconfig | 2 | ||||
-rw-r--r-- | sound/soc/tegra/Kconfig | 10 |
8 files changed, 84 insertions, 18 deletions
diff --git a/arch/arm/mach-tegra/board-aruba-panel.c b/arch/arm/mach-tegra/board-aruba-panel.c index a0adfca052e1..e4953bde46c3 100644 --- a/arch/arm/mach-tegra/board-aruba-panel.c +++ b/arch/arm/mach-tegra/board-aruba-panel.c @@ -85,6 +85,7 @@ static struct platform_device aruba_backlight_device = { }, }; +#ifdef CONFIG_TEGRA_DC static int aruba_panel_enable(void) { static struct regulator *reg = NULL; @@ -180,6 +181,7 @@ static struct nvhost_device aruba_disp1_device = { .platform_data = &aruba_disp1_pdata, }, }; +#endif static struct nvmap_platform_carveout aruba_carveouts[] = { [0] = NVMAP_HEAP_CARVEOUT_IRAM_INIT, @@ -207,7 +209,9 @@ static struct platform_device aruba_nvmap_device = { static struct platform_device *aruba_gfx_devices[] __initdata = { &aruba_nvmap_device, +#ifdef CONFIG_TEGRA_GRHOST &tegra_grhost_device, +#endif &tegra_pwfm2_device, &aruba_backlight_device, }; @@ -215,7 +219,7 @@ static struct platform_device *aruba_gfx_devices[] __initdata = { int __init aruba_panel_init(void) { int err; - struct resource *res; + struct resource __maybe_unused *res; aruba_carveouts[1].base = tegra_carveout_start; aruba_carveouts[1].size = tegra_carveout_size; @@ -223,17 +227,21 @@ int __init aruba_panel_init(void) err = platform_add_devices(aruba_gfx_devices, ARRAY_SIZE(aruba_gfx_devices)); +#if defined(CONFIG_TEGRA_GRHOST) && defined(CONFIG_TEGRA_DC) res = nvhost_get_resource_byname(&aruba_disp1_device, IORESOURCE_MEM, "fbmem"); res->start = tegra_fb_start; res->end = tegra_fb_start + tegra_fb_size - 1; +#endif /* Copy the bootloader fb to the fb. */ tegra_move_framebuffer(tegra_fb_start, tegra_bootloader_fb_start, min(tegra_fb_size, tegra_bootloader_fb_size)); +#if defined(CONFIG_TEGRA_GRHOST) && defined(CONFIG_TEGRA_DC) if (!err) err = nvhost_device_register(&aruba_disp1_device); +#endif return err; } diff --git a/arch/arm/mach-tegra/board-cardhu-panel.c b/arch/arm/mach-tegra/board-cardhu-panel.c index 57076cbb7bae..1bea26d26411 100644 --- a/arch/arm/mach-tegra/board-cardhu-panel.c +++ b/arch/arm/mach-tegra/board-cardhu-panel.c @@ -56,9 +56,11 @@ #define cardhu_dsi_panel_reset TEGRA_GPIO_PD2 #endif +#ifdef CONFIG_TEGRA_DC static struct regulator *cardhu_hdmi_reg = NULL; static struct regulator *cardhu_hdmi_pll = NULL; static struct regulator *cardhu_hdmi_vddio = NULL; +#endif static atomic_t sd_brightness = ATOMIC_INIT(255); @@ -300,6 +302,7 @@ static int cardhu_panel_disable(void) } #endif +#ifdef CONFIG_TEGRA_DC static int cardhu_hdmi_vddio_enable(void) { int ret; @@ -377,6 +380,7 @@ static int cardhu_hdmi_disable(void) cardhu_hdmi_pll = NULL; return 0; } + static struct resource cardhu_disp1_resources[] = { { .name = "irq", @@ -439,6 +443,7 @@ static struct resource cardhu_disp2_resources[] = { .flags = IORESOURCE_MEM, }, }; +#endif #ifndef CONFIG_TEGRA_CARDHU_DSI static struct tegra_dc_mode cardhu_panel_modes[] = { @@ -567,6 +572,7 @@ static struct tegra_dc_sd_settings cardhu_sd_settings = { .bl_device = &cardhu_backlight_device, }; +#ifdef CONFIG_TEGRA_DC #ifndef CONFIG_TEGRA_CARDHU_DSI static struct tegra_fb_data cardhu_fb_data = { .win = 0, @@ -610,6 +616,7 @@ static struct tegra_dc_platform_data cardhu_disp2_pdata = { .fb = &cardhu_hdmi_fb_data, .emc_clk_rate = 300000000, }; +#endif #ifdef CONFIG_TEGRA_CARDHU_DSI static int cardhu_dsi_panel_enable(void) @@ -893,6 +900,8 @@ static struct tegra_dc_out cardhu_disp1_out = { .postsuspend = cardhu_dsi_panel_postsuspend, #endif }; + +#ifdef CONFIG_TEGRA_DC static struct tegra_dc_platform_data cardhu_disp1_pdata = { .flags = TEGRA_DC_FLAG_ENABLED, .default_out = &cardhu_disp1_out, @@ -903,6 +912,7 @@ static struct tegra_dc_platform_data cardhu_disp1_pdata = { .fb = &cardhu_dsi_fb_data, #endif }; + static struct nvhost_device cardhu_disp1_device = { .name = "tegradc", .id = 0, @@ -927,6 +937,12 @@ static struct nvhost_device cardhu_disp2_device = { .platform_data = &cardhu_disp2_pdata, }, }; +#else +static int cardhu_disp1_check_fb(struct device *dev, struct fb_info *info) +{ + return 0; +} +#endif static struct nvmap_platform_carveout cardhu_carveouts[] = { [0] = NVMAP_HEAP_CARVEOUT_IRAM_INIT, @@ -955,7 +971,9 @@ static struct platform_device cardhu_nvmap_device = { static struct platform_device *cardhu_gfx_devices[] __initdata = { &cardhu_nvmap_device, +#ifdef CONFIG_TEGRA_GRHOST &tegra_grhost_device, +#endif &tegra_pwfm0_device, &cardhu_backlight_device, }; @@ -964,7 +982,7 @@ static struct platform_device *cardhu_gfx_devices[] __initdata = { int __init cardhu_panel_init(void) { int err; - struct resource *res; + struct resource __maybe_unused *res; tegra_get_board_info(&board_info); @@ -998,15 +1016,18 @@ int __init cardhu_panel_init(void) err = platform_add_devices(cardhu_gfx_devices, ARRAY_SIZE(cardhu_gfx_devices)); +#if defined(CONFIG_TEGRA_GRHOST) && defined(CONFIG_TEGRA_DC) res = nvhost_get_resource_byname(&cardhu_disp1_device, IORESOURCE_MEM, "fbmem"); res->start = tegra_fb_start; res->end = tegra_fb_start + tegra_fb_size - 1; +#endif /* Copy the bootloader fb to the fb. */ tegra_move_framebuffer(tegra_fb_start, tegra_bootloader_fb_start, min(tegra_fb_size, tegra_bootloader_fb_size)); +#if defined(CONFIG_TEGRA_GRHOST) && defined(CONFIG_TEGRA_DC) if (!err) err = nvhost_device_register(&cardhu_disp1_device); @@ -1016,8 +1037,9 @@ int __init cardhu_panel_init(void) res->end = tegra_fb2_start + tegra_fb2_size - 1; if (!err) err = nvhost_device_register(&cardhu_disp2_device); +#endif -#if defined(CONFIG_TEGRA_NVAVP) +#if defined(CONFIG_TEGRA_GRHOST) && defined(CONFIG_TEGRA_NVAVP) if (!err) err = nvhost_device_register(&nvavp_device); #endif diff --git a/arch/arm/mach-tegra/board-enterprise-panel.c b/arch/arm/mach-tegra/board-enterprise-panel.c index 9ea904c447da..f95c2a579e5d 100644 --- a/arch/arm/mach-tegra/board-enterprise-panel.c +++ b/arch/arm/mach-tegra/board-enterprise-panel.c @@ -60,11 +60,13 @@ #define enterprise_lcd_te TEGRA_GPIO_PJ1 +#ifdef CONFIG_TEGRA_DC static struct regulator *enterprise_dsi_reg = NULL; static struct regulator *enterprise_hdmi_reg; static struct regulator *enterprise_hdmi_pll; static struct regulator *enterprise_hdmi_vddio; +#endif static atomic_t sd_brightness = ATOMIC_INIT(255); @@ -153,6 +155,7 @@ static struct platform_device enterprise_disp1_backlight_device = { }, }; +#ifdef CONFIG_TEGRA_DC static int enterprise_hdmi_vddio_enable(void) { int ret; @@ -459,6 +462,7 @@ static int enterprise_dsi_panel_disable(void) #endif return 0; } +#endif static void enterprise_stereo_set_mode(int mode) { @@ -484,6 +488,7 @@ static void enterprise_stereo_set_orientation(int mode) } } +#ifdef CONFIG_TEGRA_DC static int enterprise_dsi_panel_postsuspend(void) { int err = 0; @@ -499,6 +504,7 @@ static int enterprise_dsi_panel_postsuspend(void) return err; } +#endif static struct tegra_dsi_cmd dsi_init_cmd[]= { DSI_CMD_SHORT(0x05, 0x11, 0x00), @@ -571,6 +577,7 @@ static struct tegra_stereo_out enterprise_stereo = { .set_orientation = &enterprise_stereo_set_orientation, }; +#ifdef CONFIG_TEGRA_DC static struct tegra_dc_mode enterprise_dsi_modes[] = { { .pclk = 10000000, @@ -587,7 +594,6 @@ static struct tegra_dc_mode enterprise_dsi_modes[] = { }, }; - static struct tegra_fb_data enterprise_dsi_fb_data = { .win = 0, .xres = 540, @@ -596,7 +602,6 @@ static struct tegra_fb_data enterprise_dsi_fb_data = { .flags = TEGRA_FB_FLIP_ON_PROBE, }; - static struct tegra_dc_out enterprise_disp1_out = { .align = TEGRA_DC_ALIGN_MSB, .order = TEGRA_DC_ORDER_RED_BLUE, @@ -625,6 +630,7 @@ static struct tegra_dc_platform_data enterprise_disp1_pdata = { .emc_clk_rate = 204000000, .fb = &enterprise_dsi_fb_data, }; + static struct nvhost_device enterprise_disp1_device = { .name = "tegradc", .id = 0, @@ -644,6 +650,7 @@ static struct nvhost_device enterprise_disp2_device = { .platform_data = &enterprise_disp2_pdata, }, }; +#endif static struct nvmap_platform_carveout enterprise_carveouts[] = { [0] = NVMAP_HEAP_CARVEOUT_IRAM_INIT, @@ -671,7 +678,9 @@ static struct platform_device enterprise_nvmap_device = { static struct platform_device *enterprise_gfx_devices[] __initdata = { &enterprise_nvmap_device, +#ifdef CONFIG_TEGRA_GRHOST &tegra_grhost_device, +#endif &tegra_pwfm0_device, }; @@ -682,7 +691,7 @@ static struct platform_device *enterprise_bl_devices[] = { int __init enterprise_panel_init(void) { int err; - struct resource *res; + struct resource __maybe_unused *res; bl_output = enterprise_bl_output_measured; @@ -718,15 +727,18 @@ int __init enterprise_panel_init(void) err = platform_add_devices(enterprise_gfx_devices, ARRAY_SIZE(enterprise_gfx_devices)); +#if defined(CONFIG_TEGRA_GRHOST) && defined(CONFIG_TEGRA_DC) res = nvhost_get_resource_byname(&enterprise_disp1_device, IORESOURCE_MEM, "fbmem"); res->start = tegra_fb_start; res->end = tegra_fb_start + tegra_fb_size - 1; +#endif /* Copy the bootloader fb to the fb. */ tegra_move_framebuffer(tegra_fb_start, tegra_bootloader_fb_start, min(tegra_fb_size, tegra_bootloader_fb_size)); +#if defined(CONFIG_TEGRA_GRHOST) && defined(CONFIG_TEGRA_DC) if (!err) err = nvhost_device_register(&enterprise_disp1_device); @@ -736,8 +748,9 @@ int __init enterprise_panel_init(void) res->end = tegra_fb2_start + tegra_fb2_size - 1; if (!err) err = nvhost_device_register(&enterprise_disp2_device); +#endif -#if defined(CONFIG_TEGRA_NVAVP) +#if defined(CONFIG_TEGRA_GRHOST) && defined(CONFIG_TEGRA_NVAVP) if (!err) err = nvhost_device_register(&nvavp_device); #endif diff --git a/arch/arm/mach-tegra/board-ventana-panel.c b/arch/arm/mach-tegra/board-ventana-panel.c index 6a091203f4d5..042fcba830a0 100644 --- a/arch/arm/mach-tegra/board-ventana-panel.c +++ b/arch/arm/mach-tegra/board-ventana-panel.c @@ -46,9 +46,10 @@ #define ventana_pnl_to_lvds_ms 0 #define ventana_lvds_to_bl_ms 200 +#ifdef CONFIG_TEGRA_DC static struct regulator *ventana_hdmi_reg = NULL; static struct regulator *ventana_hdmi_pll = NULL; - +#endif static int ventana_backlight_init(struct device *dev) { int ret; @@ -100,6 +101,7 @@ static struct platform_device ventana_backlight_device = { }, }; +#ifdef CONFIG_TEGRA_DC static int ventana_panel_enable(void) { struct regulator *reg = regulator_get(NULL, "vdd_ldo4"); @@ -299,6 +301,12 @@ static struct nvhost_device ventana_disp2_device = { .platform_data = &ventana_disp2_pdata, }, }; +#else +static int ventana_disp1_check_fb(struct device *dev, struct fb_info *info) +{ + return 0; +} +#endif static struct nvmap_platform_carveout ventana_carveouts[] = { [0] = NVMAP_HEAP_CARVEOUT_IRAM_INIT, @@ -324,7 +332,9 @@ static struct platform_device ventana_nvmap_device = { static struct platform_device *ventana_gfx_devices[] __initdata = { &ventana_nvmap_device, +#ifdef CONFIG_TEGRA_GRHOST &tegra_grhost_device, +#endif &tegra_pwfm2_device, &ventana_backlight_device, }; @@ -332,7 +342,7 @@ static struct platform_device *ventana_gfx_devices[] __initdata = { int __init ventana_panel_init(void) { int err; - struct resource *res; + struct resource __maybe_unused *res; gpio_request(ventana_pnl_pwr_enb, "pnl_pwr_enb"); gpio_direction_output(ventana_pnl_pwr_enb, 1); @@ -356,7 +366,7 @@ int __init ventana_panel_init(void) err = platform_add_devices(ventana_gfx_devices, ARRAY_SIZE(ventana_gfx_devices)); - +#if defined(CONFIG_TEGRA_GRHOST) && defined(CONFIG_TEGRA_DC) res = nvhost_get_resource_byname(&ventana_disp1_device, IORESOURCE_MEM, "fbmem"); res->start = tegra_fb_start; @@ -366,16 +376,19 @@ int __init ventana_panel_init(void) IORESOURCE_MEM, "fbmem"); res->start = tegra_fb2_start; res->end = tegra_fb2_start + tegra_fb2_size - 1; +#endif /* Copy the bootloader fb to the fb. */ tegra_move_framebuffer(tegra_fb_start, tegra_bootloader_fb_start, min(tegra_fb_size, tegra_bootloader_fb_size)); +#if defined(CONFIG_TEGRA_GRHOST) && defined(CONFIG_TEGRA_DC) if (!err) err = nvhost_device_register(&ventana_disp1_device); if (!err) err = nvhost_device_register(&ventana_disp2_device); +#endif return err; } diff --git a/arch/arm/mach-tegra/board-whistler-panel.c b/arch/arm/mach-tegra/board-whistler-panel.c index 9b548faf8fdd..41bf154deb86 100644 --- a/arch/arm/mach-tegra/board-whistler-panel.c +++ b/arch/arm/mach-tegra/board-whistler-panel.c @@ -39,8 +39,10 @@ #define whistler_hdmi_hpd TEGRA_GPIO_PN7 +#ifdef CONFIG_TEGRA_DC static struct regulator *whistler_hdmi_reg = NULL; static struct regulator *whistler_hdmi_pll = NULL; +#endif /* * In case which_pwm is TEGRA_PWM_PM0, @@ -68,6 +70,7 @@ static struct platform_device whistler_disp1_backlight_device = { }, }; +#ifdef CONFIG_TEGRA_DC static int whistler_hdmi_enable(void) { if (!whistler_hdmi_reg) { @@ -260,6 +263,7 @@ static struct nvhost_device whistler_disp2_device = { .platform_data = &whistler_disp2_pdata, }, }; +#endif static struct nvmap_platform_carveout whistler_carveouts[] = { [0] = NVMAP_HEAP_CARVEOUT_IRAM_INIT, @@ -287,14 +291,16 @@ static struct platform_device whistler_nvmap_device = { static struct platform_device *whistler_gfx_devices[] __initdata = { &whistler_nvmap_device, +#ifdef CONFIG_TEGRA_GRHOST &tegra_grhost_device, +#endif &whistler_disp1_backlight_device, }; int __init whistler_panel_init(void) { int err; - struct resource *res; + struct resource __maybe_unused *res; tegra_gpio_enable(whistler_hdmi_hpd); gpio_request(whistler_hdmi_hpd, "hdmi_hpd"); @@ -306,15 +312,18 @@ int __init whistler_panel_init(void) err = platform_add_devices(whistler_gfx_devices, ARRAY_SIZE(whistler_gfx_devices)); +#if defined(CONFIG_TEGRA_GRHOST) && defined(CONFIG_TEGRA_DC) res = nvhost_get_resource_byname(&whistler_disp1_device, IORESOURCE_MEM, "fbmem"); res->start = tegra_fb_start; res->end = tegra_fb_start + tegra_fb_size - 1; +#endif /* Copy the bootloader fb to the fb. */ tegra_move_framebuffer(tegra_fb_start, tegra_bootloader_fb_start, min(tegra_fb_size, tegra_bootloader_fb_size)); +#if defined(CONFIG_TEGRA_GRHOST) && defined(CONFIG_TEGRA_DC) res = nvhost_get_resource_byname(&whistler_disp2_device, IORESOURCE_MEM, "fbmem"); res->start = tegra_fb2_start; @@ -325,6 +334,7 @@ int __init whistler_panel_init(void) if (!err) err = nvhost_device_register(&whistler_disp2_device); +#endif return err; } diff --git a/drivers/media/video/tegra/nvavp/Kconfig b/drivers/media/video/tegra/nvavp/Kconfig index 66d7c860cdcf..2d3af3f79fb3 100644 --- a/drivers/media/video/tegra/nvavp/Kconfig +++ b/drivers/media/video/tegra/nvavp/Kconfig @@ -1,6 +1,6 @@ config TEGRA_NVAVP bool "Enable support for Tegra NVAVP driver" - depends on ARCH_TEGRA + depends on ARCH_TEGRA && TEGRA_GRHOST default n help Enables support for the push-buffer mechanism based driver for the Tegra diff --git a/drivers/video/tegra/Kconfig b/drivers/video/tegra/Kconfig index 16c5c605bf94..dcfac3bd8835 100644 --- a/drivers/video/tegra/Kconfig +++ b/drivers/video/tegra/Kconfig @@ -10,7 +10,7 @@ config TEGRA_GRHOST config TEGRA_DC tristate "Tegra Display Contoller" - depends on ARCH_TEGRA + depends on ARCH_TEGRA && TEGRA_GRHOST select FB_MODE_HELPERS select I2C help diff --git a/sound/soc/tegra/Kconfig b/sound/soc/tegra/Kconfig index c69f058f625c..122b515efb8b 100644 --- a/sound/soc/tegra/Kconfig +++ b/sound/soc/tegra/Kconfig @@ -33,7 +33,7 @@ config SND_SOC_TEGRA30_I2S config SND_SOC_TEGRA20_SPDIF tristate - depends on SND_SOC_TEGRA && ARCH_TEGRA_2x_SOC + depends on SND_SOC_TEGRA && ARCH_TEGRA_2x_SOC && TEGRA_DC default m help Say Y or M if you want to add support for the TEGRA20 SPDIF interface. @@ -42,7 +42,7 @@ config SND_SOC_TEGRA20_SPDIF config SND_SOC_TEGRA30_SPDIF tristate - depends on SND_SOC_TEGRA && ARCH_TEGRA_3x_SOC + depends on SND_SOC_TEGRA && ARCH_TEGRA_3x_SOC && TEGRA_DC select SND_SOC_TEGRA30_AHUB help Say Y or M if you want to add support for the TEGRA30 SPDIF interface. @@ -58,7 +58,7 @@ config MACH_HAS_SND_SOC_TEGRA_WM8903 config SND_SOC_TEGRA_WM8903 tristate "SoC Audio support for Tegra boards using a WM8903 codec" - depends on SND_SOC_TEGRA && I2C + depends on SND_SOC_TEGRA && I2C && TEGRA_DC depends on MACH_HAS_SND_SOC_TEGRA_WM8903 select SND_SOC_TEGRA20_I2S if ARCH_TEGRA_2x_SOC select SND_SOC_TEGRA30_I2S if ARCH_TEGRA_3x_SOC @@ -89,7 +89,7 @@ config MACH_HAS_SND_SOC_TEGRA_WM8753 config SND_SOC_TEGRA_WM8753 tristate "SoC Audio support for Tegra boards using a WM8753 codec" - depends on SND_SOC_TEGRA && I2C + depends on SND_SOC_TEGRA && I2C && TEGRA_DC depends on MACH_HAS_SND_SOC_TEGRA_WM8753 select SND_SOC_TEGRA20_I2S if ARCH_TEGRA_2x_SOC select SND_SOC_TEGRA30_I2S if ARCH_TEGRA_3x_SOC @@ -111,7 +111,7 @@ config MACH_HAS_SND_SOC_TEGRA_MAX98088 config SND_SOC_TEGRA_MAX98088 tristate "SoC Audio support for Tegra boards using a MAX98088 codec" - depends on SND_SOC_TEGRA && I2C + depends on SND_SOC_TEGRA && I2C && TEGRA_DC depends on MACH_HAS_SND_SOC_TEGRA_MAX98088 select SND_SOC_TEGRA20_I2S if ARCH_TEGRA_2x_SOC select SND_SOC_TEGRA30_I2S if ARCH_TEGRA_3x_SOC |