aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mach-omap2
diff options
context:
space:
mode:
authorRob Clark <rob@ti.com>2011-03-18 20:39:46 -0500
committerAndy Doan <doanac@gmail.com>2011-04-13 15:32:45 -0700
commitba369f27666546f6a88da75bb39eeadbdc36f51d (patch)
tree74c7a268a9679d95c54fe6eb605388756a58f0f4 /arch/arm/mach-omap2
parent3b32fb03d55c885a64315c1a6c67f9a1d03f2bd7 (diff)
omap2+: fix number of omap_vout resources
Depending on whether kernel is built with omapfb or omapgpu, it needs to consider CONFIG_FB_OMAP2_NUM_FBS or CONFIG_DRM_OMAP_NUM_CRTCS to know how many DSS pipes are used for framebuffers. Signed-off-by: Rob Clark <rob@ti.com> Signed-off-by: Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r--arch/arm/mach-omap2/devices.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index db764b41e71..30cfe14510b 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -637,13 +637,21 @@ static inline void omap_hdq_init(void) {}
#if defined(CONFIG_VIDEO_OMAP2_VOUT) || \
defined(CONFIG_VIDEO_OMAP2_VOUT_MODULE)
#if defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE)
-static struct resource omap_vout_resource[3 - CONFIG_FB_OMAP2_NUM_FBS] = {
-};
+#define NUM_FB CONFIG_FB_OMAP2_NUM_FBS
+#elif defined(CONFIG_DRM_OMAP) || defined(CONFIG_DRM_OMAP_MODULE)
+#define NUM_FB CONFIG_DRM_OMAP_NUM_CRTCS
#else
-static struct resource omap_vout_resource[2] = {
-};
+#define NUM_FB 1 /* we don't want gfx pipe */
+#endif
+#ifdef CONFIG_ARCH_OMAP4
+#define NUM_PIPES 4
+#else
+#define NUM_PIPES 3
#endif
+static struct resource omap_vout_resource[NUM_PIPES - NUM_FB] = {
+};
+
static struct platform_device omap_vout_device = {
.name = "omap_vout",
.num_resources = ARRAY_SIZE(omap_vout_resource),