summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/board-harmony-panel.c
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2010-06-26 22:37:57 -0700
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:34:42 -0800
commita5ce5894b9418484e8cd4f6d0dd809494d68fb72 (patch)
treeb854304cc60245fee2358c42ed52230747de7ab4 /arch/arm/mach-tegra/board-harmony-panel.c
parentebced7a4a2ac474e5d7613993e96275512ca4c7c (diff)
[ARM] tegra: harmony: Add framebuffer platform device
Signed-off-by: Colin Cross <ccross@android.com>
Diffstat (limited to 'arch/arm/mach-tegra/board-harmony-panel.c')
-rw-r--r--arch/arm/mach-tegra/board-harmony-panel.c75
1 files changed, 75 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/board-harmony-panel.c b/arch/arm/mach-tegra/board-harmony-panel.c
new file mode 100644
index 000000000000..9fbdacbcded1
--- /dev/null
+++ b/arch/arm/mach-tegra/board-harmony-panel.c
@@ -0,0 +1,75 @@
+/*
+ * arch/arm/mach-tegra/board-harmony-panel.c
+ *
+ * Copyright (C) 2010 Google, Inc.
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#include <linux/resource.h>
+#include <linux/platform_device.h>
+#include <asm/mach-types.h>
+#include <mach/irqs.h>
+#include <mach/iomap.h>
+#include <mach/tegra_fb.h>
+
+/* Framebuffer */
+static struct resource fb_resource[] = {
+ [0] = {
+ .start = INT_DISPLAY_GENERAL,
+ .end = INT_DISPLAY_GENERAL,
+ .flags = IORESOURCE_IRQ,
+ },
+ [1] = {
+ .start = TEGRA_DISPLAY_BASE,
+ .end = TEGRA_DISPLAY_BASE + TEGRA_DISPLAY_SIZE-1,
+ .flags = IORESOURCE_MEM,
+ },
+ [2] = {
+ .start = 0x1c012000,
+ .end = 0x1c012000 + 0x500000 - 1,
+ .flags = IORESOURCE_MEM,
+ },
+};
+
+static struct tegra_fb_lcd_data tegra_fb_lcd_platform_data = {
+ .lcd_xres = 1024,
+ .lcd_yres = 600,
+ .fb_xres = 1024,
+ .fb_yres = 600,
+ .bits_per_pixel = 16,
+};
+
+static struct platform_device tegra_fb_device = {
+ .name = "tegrafb",
+ .id = 0,
+ .resource = fb_resource,
+ .num_resources = ARRAY_SIZE(fb_resource),
+ .dev = {
+ .platform_data = &tegra_fb_lcd_platform_data,
+ },
+};
+
+static int __init harmony_init_panel(void) {
+ int ret;
+
+ if (!machine_is_harmony())
+ return 0;
+
+ ret = platform_device_register(&tegra_fb_device);
+ if (ret != 0)
+ return ret;
+
+ return 0;
+}
+
+device_initcall(harmony_init_panel);
+