From: sumit.semwal@ti.com (Sumit Semwal)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v9 07/18] OMAP2, 3: DSS2: Create new file display.c for central dss driver registration.
Date: Sat, 22 Jan 2011 15:35:47 +0530 [thread overview]
Message-ID: <1295690758-5845-8-git-send-email-sumit.semwal@ti.com> (raw)
In-Reply-To: <1295690758-5845-1-git-send-email-sumit.semwal@ti.com>
A new file display.c is introduced for display driver init, which adds a function
omap_display_init to do the DSS driver registration. This is the first step in moving
away registration of DSS from board files into a common place.
Reviewed-by: Kevin Hilman <khilman@ti.com>
Tested-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Senthilvadivu Guruswamy <svadivu@ti.com>
Signed-off-by: Sumit Semwal <sumit.semwal@ti.com>
---
arch/arm/mach-omap2/Makefile | 3 ++
arch/arm/mach-omap2/display.c | 46 +++++++++++++++++++++++++++++
arch/arm/plat-omap/include/plat/display.h | 11 +++++++
3 files changed, 60 insertions(+), 0 deletions(-)
create mode 100644 arch/arm/mach-omap2/display.c
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 1c0c2b0..2e81173 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -242,3 +242,6 @@ obj-y += $(smc91x-m) $(smc91x-y)
smsc911x-$(CONFIG_SMSC911X) := gpmc-smsc911x.o
obj-y += $(smsc911x-m) $(smsc911x-y)
+
+disp-$(CONFIG_OMAP2_DSS) := display.o
+obj-y += $(disp-m) $(disp-y)
diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
new file mode 100644
index 0000000..6e21cb8
--- /dev/null
+++ b/arch/arm/mach-omap2/display.c
@@ -0,0 +1,46 @@
+/*
+ * OMAP2plus display device setup / initialization.
+ *
+ * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
+ * Senthilvadivu Guruswamy
+ * Sumit Semwal
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/io.h>
+#include <linux/clk.h>
+#include <linux/err.h>
+
+#include <plat/display.h>
+
+static struct platform_device omap_display_device = {
+ .name = "omap_display",
+ .id = -1,
+ .dev = {
+ .platform_data = NULL,
+ },
+};
+
+int __init omap_display_init(struct omap_dss_board_info
+ *board_data)
+{
+ int r = 0;
+ omap_display_device.dev.platform_data = board_data;
+
+ r = platform_device_register(&omap_display_device);
+ if (r < 0)
+ printk(KERN_ERR "Unable to register OMAP-Display device\n");
+
+ return r;
+}
diff --git a/arch/arm/plat-omap/include/plat/display.h b/arch/arm/plat-omap/include/plat/display.h
index 537f4e4..0f140ec 100644
--- a/arch/arm/plat-omap/include/plat/display.h
+++ b/arch/arm/plat-omap/include/plat/display.h
@@ -23,6 +23,7 @@
#include <linux/list.h>
#include <linux/kobject.h>
#include <linux/device.h>
+#include <linux/platform_device.h>
#include <asm/atomic.h>
#define DISPC_IRQ_FRAMEDONE (1 << 0)
@@ -226,6 +227,16 @@ struct omap_dss_board_info {
struct omap_dss_device *default_device;
};
+#if defined(CONFIG_OMAP2_DSS_MODULE) || defined(CONFIG_OMAP2_DSS)
+/* Init with the board info */
+extern int omap_display_init(struct omap_dss_board_info *board_data);
+#else
+static inline int omap_display_init(struct omap_dss_board_info *board_data)
+{
+ return 0;
+}
+#endif
+
struct omap_video_timings {
/* Unit: pixels */
u16 x_res;
--
1.7.1
next prev parent reply other threads:[~2011-01-22 10:05 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-22 10:05 [PATCH v9 00/18] OMAP2,3: hwmod DSS Adaptation Sumit Semwal
2011-01-22 10:05 ` [PATCH v9 01/18] OMAP2, 3: DSS2: remove forced clk-disable from omap_dss_remove Sumit Semwal
2011-01-22 10:05 ` [PATCH v9 02/18] OMAP2420: hwmod data: add DSS DISPC RFBI VENC Sumit Semwal
2011-01-22 10:05 ` [PATCH v9 03/18] OMAP2430: " Sumit Semwal
2011-01-22 10:05 ` [PATCH v9 04/18] OMAP3: hwmod data: add DSS DISPC RFBI DSI VENC Sumit Semwal
2011-01-22 10:05 ` [PATCH v9 05/18] OMAP2,3 DSS2 Change driver name to omap_display Sumit Semwal
2011-01-22 10:05 ` [PATCH v9 06/18] OMAP2,3 DSS2 Use Regulator init with driver name Sumit Semwal
2011-01-22 10:05 ` Sumit Semwal [this message]
2011-01-22 10:05 ` [PATCH v9 08/18] OMAP2, 3: DSS2: board files: replace platform_device_register with omap_display_init() Sumit Semwal
2011-01-22 10:05 ` [PATCH v9 09/18] OMAP2,3: DSS2: Build omap_device for each DSS HWIP Sumit Semwal
2011-01-22 10:05 ` [PATCH v9 10/18] OMAP2, 3: DSS2: DSS: create platform_driver, move init, exit to driver Sumit Semwal
2011-01-22 10:05 ` [PATCH v9 11/18] OMAP2, 3: DSS2: Move clocks from core driver to dss driver Sumit Semwal
2011-01-22 10:05 ` [PATCH v9 12/18] OMAP2, 3: DSS2: RFBI: create platform_driver, move init, exit to driver Sumit Semwal
2011-01-22 10:05 ` [PATCH v9 13/18] OMAP2, 3: DSS2: DISPC: " Sumit Semwal
2011-01-22 10:05 ` [PATCH v9 14/18] OMAP2, 3: DSS2: VENC: " Sumit Semwal
2011-01-22 10:05 ` [PATCH v9 15/18] OMAP2, 3: DSS2: DSI: " Sumit Semwal
2011-01-22 10:05 ` [PATCH v9 16/18] OMAP2,3: DSS2: replace printk with dev_dbg in init Sumit Semwal
2011-01-22 10:05 ` [PATCH v9 17/18] OMAP2,3: DSS2: Use platform device to get baseaddr Sumit Semwal
2011-01-22 10:05 ` [PATCH v9 18/18] OMAP2,3: DSS2: Get DSS IRQ from platform device Sumit Semwal
2011-01-23 12:39 ` Sergei Shtylyov
2011-01-23 12:52 ` Russell King - ARM Linux
2011-01-24 5:50 ` Semwal, Sumit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1295690758-5845-8-git-send-email-sumit.semwal@ti.com \
--to=sumit.semwal@ti.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).