From: sumit.semwal@ti.com (Sumit Semwal)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v10 07/18] OMAP2, 3: DSS2: Create new file display.c for central dss driver registration.
Date: Mon, 24 Jan 2011 11:51:54 +0530 [thread overview]
Message-ID: <1295850125-21405-8-git-send-email-sumit.semwal@ti.com> (raw)
In-Reply-To: <1295850125-21405-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-24 6:21 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-24 6:21 [PATCH v10 00/18] OMAP2,3: hwmod DSS Adaptation Sumit Semwal
2011-01-24 6:21 ` [PATCH v10 01/18] OMAP2, 3: DSS2: remove forced clk-disable from omap_dss_remove Sumit Semwal
2011-01-24 6:21 ` [PATCH v10 02/18] OMAP2420: hwmod data: add DSS DISPC RFBI VENC Sumit Semwal
2011-01-24 6:21 ` [PATCH v10 03/18] OMAP2430: " Sumit Semwal
2011-01-24 6:21 ` [PATCH v10 04/18] OMAP3: hwmod data: add DSS DISPC RFBI DSI VENC Sumit Semwal
2011-01-24 6:21 ` [PATCH v10 05/18] OMAP2,3 DSS2 Change driver name to omap_display Sumit Semwal
2011-02-24 9:27 ` Tomi Valkeinen
2011-02-28 6:53 ` Tomi Valkeinen
2011-02-28 7:09 ` [PATCH v10 05/18] OMAP2, 3 " archit taneja
2011-02-28 7:19 ` [PATCH v10 05/18] OMAP2,3 " Tomi Valkeinen
2011-02-28 7:27 ` [PATCH v10 05/18] OMAP2, 3 " archit taneja
2011-02-28 8:16 ` Semwal, Sumit
2011-02-28 8:29 ` [PATCH v10 05/18] OMAP2,3 " Tomi Valkeinen
2011-02-28 11:36 ` [PATCH v10 05/18] OMAP2, 3 " Cousson, Benoit
2011-02-28 12:10 ` [PATCH v10 05/18] OMAP2,3 " Tomi Valkeinen
2011-02-28 12:13 ` Russell King - ARM Linux
2011-02-28 13:38 ` [PATCH v10 05/18] OMAP2, 3 " Cousson, Benoit
2011-02-28 14:06 ` [PATCH v10 05/18] OMAP2,3 " Russell King - ARM Linux
2011-02-28 14:55 ` [PATCH v10 05/18] OMAP2, 3 " Cousson, Benoit
2011-02-28 14:00 ` Cousson, Benoit
2011-02-28 14:57 ` [PATCH v10 05/18] OMAP2,3 " Tomi Valkeinen
2011-03-01 10:18 ` [PATCH v10 05/18] OMAP2, 3 " Cousson, Benoit
2011-01-24 6:21 ` [PATCH v10 06/18] OMAP2,3 DSS2 Use Regulator init with driver name Sumit Semwal
2011-01-24 6:21 ` Sumit Semwal [this message]
2011-01-24 6:21 ` [PATCH v10 08/18] OMAP2, 3: DSS2: board files: replace platform_device_register with omap_display_init() Sumit Semwal
2011-01-24 6:21 ` [PATCH v10 09/18] OMAP2,3: DSS2: Build omap_device for each DSS HWIP Sumit Semwal
2011-01-24 6:21 ` [PATCH v10 10/18] OMAP2, 3: DSS2: DSS: create platform_driver, move init, exit to driver Sumit Semwal
2011-01-24 6:21 ` [PATCH v10 11/18] OMAP2, 3: DSS2: Move clocks from core driver to dss driver Sumit Semwal
2011-01-24 6:21 ` [PATCH v10 12/18] OMAP2, 3: DSS2: RFBI: create platform_driver, move init, exit to driver Sumit Semwal
2011-01-24 6:22 ` [PATCH v10 13/18] OMAP2, 3: DSS2: DISPC: " Sumit Semwal
2011-01-24 6:22 ` [PATCH v10 14/18] OMAP2, 3: DSS2: VENC: " Sumit Semwal
2011-01-24 6:22 ` [PATCH v10 15/18] OMAP2, 3: DSS2: DSI: " Sumit Semwal
2011-01-24 6:22 ` [PATCH v10 16/18] OMAP2,3: DSS2: replace printk with dev_dbg in init Sumit Semwal
2011-01-24 6:22 ` [PATCH v10 17/18] OMAP2,3: DSS2: Use platform device to get baseaddr Sumit Semwal
2011-01-24 6:22 ` [PATCH v10 18/18] OMAP2,3: DSS2: Get DSS IRQ from platform device Sumit Semwal
2011-01-27 12:49 ` [PATCH v10 18/18] OMAP2, 3: " Raghuveer Murthy
2011-01-27 12:59 ` Russell King - ARM Linux
2011-01-27 13:04 ` Raghuveer Murthy
2011-01-27 15:23 ` Semwal, Sumit
2011-02-14 14:09 ` [PATCH v10 18/18] OMAP2,3: " Tomi Valkeinen
2011-02-14 18:35 ` [PATCH v10 18/18] OMAP2, 3: " Semwal, Sumit
2011-01-24 21:57 ` [PATCH v10 00/18] OMAP2,3: hwmod DSS Adaptation Kevin Hilman
2011-01-25 17:03 ` Tony Lindgren
2011-01-28 12:01 ` Tomi Valkeinen
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=1295850125-21405-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).