diff options
author | Bharat Nihalani <bnihalani@nvidia.com> | 2011-09-26 19:21:08 +0530 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:49:04 -0800 |
commit | 67fec61dd0438d2e666ee3ecf84ffd6d04a3580e (patch) | |
tree | 4642aee485866f9d633d1c956e0836bb0b40fb07 /arch | |
parent | 844e97f6902ce5970f5231d033d067e124cc7abb (diff) |
ARM: tegra: nvavp: registering new nvavp driver
Also re-arranged tegra_nvavp code so that it is common accross boards
Bug 880623
Change-Id: I7d634a718e07e07e945fb512466b3a0672aea7e2
Reviewed-on: http://git-master/r/54487
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>
Rebase-Id: R78e4af97d967003560e80efce79d6b22d6d66c4f
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-tegra/board-cardhu-panel.c | 20 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-enterprise-panel.c | 8 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-enterprise.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-tegra/devices.c | 17 | ||||
-rw-r--r-- | arch/arm/mach-tegra/devices.h | 1 |
5 files changed, 28 insertions, 20 deletions
diff --git a/arch/arm/mach-tegra/board-cardhu-panel.c b/arch/arm/mach-tegra/board-cardhu-panel.c index 910a0c1aef26..0cd01cc3ec89 100644 --- a/arch/arm/mach-tegra/board-cardhu-panel.c +++ b/arch/arm/mach-tegra/board-cardhu-panel.c @@ -949,24 +949,6 @@ 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, @@ -1031,7 +1013,7 @@ int __init cardhu_panel_init(void) #if defined(CONFIG_TEGRA_NVAVP) if (!err) - err = nvhost_device_register(&cardhu_nvavp_device); + err = nvhost_device_register(&nvavp_device); #endif return err; } diff --git a/arch/arm/mach-tegra/board-enterprise-panel.c b/arch/arm/mach-tegra/board-enterprise-panel.c index 81b40744ff32..9ea904c447da 100644 --- a/arch/arm/mach-tegra/board-enterprise-panel.c +++ b/arch/arm/mach-tegra/board-enterprise-panel.c @@ -737,7 +737,13 @@ int __init enterprise_panel_init(void) if (!err) err = nvhost_device_register(&enterprise_disp2_device); - err = platform_add_devices(enterprise_bl_devices, +#if defined(CONFIG_TEGRA_NVAVP) + if (!err) + err = nvhost_device_register(&nvavp_device); +#endif + + if (!err) + err = platform_add_devices(enterprise_bl_devices, ARRAY_SIZE(enterprise_bl_devices)); return err; } diff --git a/arch/arm/mach-tegra/board-enterprise.c b/arch/arm/mach-tegra/board-enterprise.c index 7b128f45c8fc..f01fdc9cf573 100644 --- a/arch/arm/mach-tegra/board-enterprise.c +++ b/arch/arm/mach-tegra/board-enterprise.c @@ -482,7 +482,9 @@ static struct platform_device *enterprise_devices[] __initdata = { &tegra_smmu_device, #endif &tegra_wdt_device, +#if defined(CONFIG_TEGRA_AVP) &tegra_avp_device, +#endif &tegra_camera, &tegra_ahub_device, &tegra_i2s_device0, diff --git a/arch/arm/mach-tegra/devices.c b/arch/arm/mach-tegra/devices.c index 6f5da486aeec..b956d018f429 100644 --- a/arch/arm/mach-tegra/devices.c +++ b/arch/arm/mach-tegra/devices.c @@ -27,6 +27,7 @@ #include <linux/i2c-tegra.h> #include <linux/platform_data/tegra_usb.h> #include <linux/tegra_avp.h> +#include <linux/nvhost.h> #include <asm/pmu.h> #include <mach/irqs.h> #include <mach/iomap.h> @@ -1414,6 +1415,22 @@ static struct tegra_avp_platform_data tegra_avp_pdata = { #endif }; +struct resource tegra_nvavp_resources[] = { + [0] = { + .start = INT_SHR_SEM_INBOX_IBF, + .end = INT_SHR_SEM_INBOX_IBF, + .flags = IORESOURCE_IRQ, + .name = "mbox_from_nvavp_pending", + }, +}; + +struct nvhost_device nvavp_device = { + .name = "nvavp", + .id = -1, + .resource = tegra_nvavp_resources, + .num_resources = ARRAY_SIZE(tegra_nvavp_resources), +}; + static struct resource tegra_avp_resources[] = { [0] = { .start = INT_SHR_SEM_INBOX_IBF, diff --git a/arch/arm/mach-tegra/devices.h b/arch/arm/mach-tegra/devices.h index c6c9ce92c422..079174b3e940 100644 --- a/arch/arm/mach-tegra/devices.h +++ b/arch/arm/mach-tegra/devices.h @@ -101,6 +101,7 @@ extern struct platform_device tegra_uartd_device; extern struct platform_device tegra_uarte_device; extern struct platform_device tegra_grhost_device; extern struct platform_device tegra_avp_device; +extern struct nvhost_device nvavp_device; extern struct platform_device tegra_aes_device; #if !defined(CONFIG_ARCH_TEGRA_2x_SOC) extern struct platform_device tegra_tsensor_device; |