From 5274484b821bb2cf34a697624ef14084c31b16ce Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Mon, 10 Sep 2012 13:58:29 +0300 Subject: [PATCH] OMAPDSS: alloc dssdevs dynamically We currently create omap_dss_devices statically in board files, and use those devices directly in the omapdss driver. This model prevents us from having the platform data (which the dssdevs in board files practically are) as read-only, and it's also different than what we will use with device tree. This patch changes the model to be in line with DT model: we allocate the dssdevs dynamically, and initialize them according to the data in the board file's dssdev (basically we memcopy the dssdev fields). The allocation and registration is done in the following steps in the output drivers: - Use dss_alloc_and_init_device to allocate and initialize the device. The function uses kalloc and device_initialize to accomplish this. - Call dss_copy_device_pdata to copy the data from the board file's dssdev - Use dss_add_device to register the device. Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/dss/core.c | 72 +++++++++++++++++----------------- drivers/video/omap2/dss/dpi.c | 17 ++++++-- drivers/video/omap2/dss/dsi.c | 15 +++++-- drivers/video/omap2/dss/dss.h | 11 ++++-- drivers/video/omap2/dss/hdmi.c | 15 +++++-- drivers/video/omap2/dss/rfbi.c | 17 ++++++-- drivers/video/omap2/dss/sdi.c | 17 ++++++-- drivers/video/omap2/dss/venc.c | 17 ++++++-- 8 files changed, 119 insertions(+), 62 deletions(-) diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c index c4fd7687f3a3..b2af72dc20bd 100644 --- a/drivers/video/omap2/dss/core.c +++ b/drivers/video/omap2/dss/core.c @@ -33,6 +33,7 @@ #include #include #include +#include #include