arm: tegra: cardhu: AVP driver selection
Gajanan Bhat [Wed, 22 Jun 2011 02:02:19 +0000 (19:02 -0700)]
Enable RPC based AVP driver or channel based AVP
driver based on kernel config setting.

Original-Change-Id: I64c21724b55004fa4d7aaf801b47e57b6587b91e
Reviewed-on: http://git-master/r/37769
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>

Rebase-Id: Rd00f3fb6f0d75dd2b279b203cb25bee3dfdae112

arch/arm/mach-tegra/board-cardhu-panel.c
arch/arm/mach-tegra/board-cardhu.c

index 3e31f84..bfea805 100644 (file)
@@ -920,6 +920,25 @@ static struct platform_device cardhu_nvmap_device = {
        },
 };
 
+
+#if defined(CONFIG_TEGRA_NVAVP)
+static struct resource tegra_nvavp_resources[] = {
+       [0] = {
+               .start  = INT_SHR_SEM_INBOX_IBF,
+               .end    = INT_SHR_SEM_INBOX_IBF,
+               .flags  = IORESOURCE_IRQ,
+               .name   = "mbox_from_avp_pending",
+       },
+};
+
+static struct nvhost_device cardhu_nvavp_device = {
+       .name           = "tegra-avp",
+       .id             = -1,
+       .resource       = tegra_nvavp_resources,
+       .num_resources  = ARRAY_SIZE(tegra_nvavp_resources),
+};
+#endif
+
 static struct platform_device *cardhu_gfx_devices[] __initdata = {
        &cardhu_nvmap_device,
        &tegra_grhost_device,
@@ -967,5 +986,10 @@ int __init cardhu_panel_init(void)
        res->end = tegra_fb2_start + tegra_fb2_size - 1;
        if (!err)
                err = nvhost_device_register(&cardhu_disp2_device);
+
+#if defined(CONFIG_TEGRA_NVAVP)
+       if (!err)
+               err = nvhost_device_register(&cardhu_nvavp_device);
+#endif
        return err;
 }
index 924a94a..b026b5a 100644 (file)
@@ -385,7 +385,9 @@ static struct platform_device *cardhu_devices[] __initdata = {
        &tegra_smmu_device,
 #endif
        &tegra_wdt_device,
+#if defined(CONFIG_TEGRA_AVP)
        &tegra_avp_device,
+#endif
        &tegra_camera,
        &tegra_spi_device4,
 #if defined(CONFIG_CRYPTO_DEV_TEGRA_SE)