summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorPer Persson <per.xb.persson@stericsson.com>2011-06-09 13:26:31 +0200
committersaid m bagheri <ebgheri@steludxu2848.(none)>2011-06-29 10:30:36 +0200
commit3c77dae8809db143932e463728cf064aecedec06 (patch)
tree3871e3ca883442c927086ebc9e417753ba952608 /drivers
parent598e659900716591df76883299995cdd3581d58e (diff)
video: mcde: Add Fictive display
The possibility to use a fictive display that is not using HW, is added. Depends-On: I1ba92f35528518c9a9e2c805973dac8033a17f39 ST-Ericsson ID: 344358 ST-Ericsson Linux next: Not tested, ER 282779 ST-Ericsson FOSS-OUT ID: Trivial Change-Id: I8ddc6069e037d879582c810f9298273b3d75cc15 Signed-off-by: Per Persson <per.xb.persson@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/24716 Reviewed-by: QATOOLS Reviewed-by: QATEST Reviewed-by: Marcel TUNNISSEN <marcel.tuennissen@stericsson.com> Reviewed-by: Linus WALLEIJ <linus.walleij@stericsson.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/mcde/Makefile1
-rw-r--r--drivers/video/mcde/display-fictive.c64
-rw-r--r--drivers/video/mcde/mcde_fb.c45
3 files changed, 94 insertions, 16 deletions
diff --git a/drivers/video/mcde/Makefile b/drivers/video/mcde/Makefile
index 93097f8961e..7c9324ded3a 100644
--- a/drivers/video/mcde/Makefile
+++ b/drivers/video/mcde/Makefile
@@ -7,6 +7,7 @@ obj-$(CONFIG_MCDE_DISPLAY_SONY_SY35560_DSI) += display-sony_sy35560_dsi.o
obj-$(CONFIG_MCDE_DISPLAY_VUIB500_DPI) += display-vuib500-dpi.o
obj-$(CONFIG_MCDE_DISPLAY_AB8500_DENC) += display-ab8500.o
obj-$(CONFIG_MCDE_DISPLAY_AV8100) += display-av8100.o
+obj-$(CONFIG_DISPLAY_FICTIVE) += display-fictive.o
ifdef CONFIG_FB_MCDE_DEBUG
EXTRA_CFLAGS += -DDEBUG
diff --git a/drivers/video/mcde/display-fictive.c b/drivers/video/mcde/display-fictive.c
new file mode 100644
index 00000000000..8389357a693
--- /dev/null
+++ b/drivers/video/mcde/display-fictive.c
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) ST-Ericsson SA 2011
+ *
+ * ST-Ericsson MCDE fictive display driver
+ *
+ * Author: Per Persson <per.xb.persson@stericsson.com>
+ * for ST-Ericsson.
+ *
+ * License terms: GNU General Public License (GPL), version 2.
+ */
+
+#include <linux/kernel.h>
+#include <linux/device.h>
+#include <linux/delay.h>
+#include <linux/gpio.h>
+#include <linux/err.h>
+
+#include <video/mcde_display.h>
+
+static int __devinit fictive_probe(struct mcde_display_device *dev)
+{
+ dev->prepare_for_update = NULL;
+ dev->platform_enable = NULL,
+ dev->platform_disable = NULL,
+ dev->set_power_mode = NULL;
+
+ dev_info(&dev->dev, "Fictive display probed\n");
+
+ return 0;
+}
+
+static int __devexit fictive_remove(struct mcde_display_device *dev)
+{
+ return 0;
+}
+
+static struct mcde_display_driver fictive_driver = {
+ .probe = fictive_probe,
+ .remove = fictive_remove,
+ .driver = {
+ .name = "mcde_disp_fictive",
+ },
+};
+
+/* Module init */
+static int __init mcde_display_fictive_init(void)
+{
+ pr_info("%s\n", __func__);
+
+ return mcde_display_driver_register(&fictive_driver);
+}
+module_init(mcde_display_fictive_init);
+
+static void __exit mcde_display_fictive_exit(void)
+{
+ pr_info("%s\n", __func__);
+
+ mcde_display_driver_unregister(&fictive_driver);
+}
+module_exit(mcde_display_fictive_exit);
+
+MODULE_AUTHOR("Per Persson <per.xb.persson@stericsson.com>");
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("ST-Ericsson MCDE fictive display driver");
diff --git a/drivers/video/mcde/mcde_fb.c b/drivers/video/mcde/mcde_fb.c
index cd7dd70101d..3b464cd8024 100644
--- a/drivers/video/mcde/mcde_fb.c
+++ b/drivers/video/mcde/mcde_fb.c
@@ -490,6 +490,9 @@ static int apply_var(struct fb_info *fbi, struct mcde_display_device *ddev)
}
fbi->fix.line_length = line_len;
+ if (ddev->fictive)
+ goto apply_var_end;
+
if (ddev) {
/* Apply pixel format */
fmt = var_to_pix_fmt_info(var);
@@ -520,6 +523,7 @@ static int apply_var(struct fb_info *fbi, struct mcde_display_device *ddev)
mcde_dss_update_overlay(ovly, num_buffers == 3);
}
+apply_var_end:
return 0;
}
@@ -638,13 +642,15 @@ struct fb_info *mcde_fb_create(struct mcde_display_device *ddev,
init_fb(fbi);
mfb = to_mcde_fb(fbi);
- ret = mcde_dss_open_channel(ddev);
- if (ret)
- goto channel_open_failed;
+ if (ddev->fictive == false) {
+ ret = mcde_dss_open_channel(ddev);
+ if (ret)
+ goto channel_open_failed;
- ret = mcde_dss_enable_display(ddev);
- if (ret)
- goto display_enable_failed;
+ ret = mcde_dss_enable_display(ddev);
+ if (ret)
+ goto display_enable_failed;
+ }
/* Prepare var and allocate frame buffer memory */
init_var_fmt(&fbi->var, w, h, vw, vh, pix_fmt, rotate);
@@ -653,7 +659,8 @@ struct fb_info *mcde_fb_create(struct mcde_display_device *ddev,
if (ret)
goto apply_var_failed;
- mcde_dss_set_pixel_format(ddev, ddev->port->pixel_format);
+ if (ddev->fictive == false)
+ mcde_dss_set_pixel_format(ddev, ddev->port->pixel_format);
/* Setup overlay */
get_ovly_info(fbi, NULL, &ovly_info);
@@ -665,9 +672,11 @@ struct fb_info *mcde_fb_create(struct mcde_display_device *ddev,
mfb->ovlys[0] = ovly;
mfb->num_ovlys = 1;
- ret = mcde_dss_enable_overlay(ovly);
- if (ret)
- goto ovly_enable_failed;
+ if (ddev->fictive == false) {
+ ret = mcde_dss_enable_overlay(ovly);
+ if (ret)
+ goto ovly_enable_failed;
+ }
mfb->id = ddev->id;
@@ -679,11 +688,13 @@ struct fb_info *mcde_fb_create(struct mcde_display_device *ddev,
ddev->fbi = fbi;
#ifdef CONFIG_HAS_EARLYSUSPEND
- mfb->early_suspend.level =
+ if (ddev->fictive == false) {
+ mfb->early_suspend.level =
EARLY_SUSPEND_LEVEL_DISABLE_FB;
- mfb->early_suspend.suspend = early_suspend;
- mfb->early_suspend.resume = late_resume;
- register_early_suspend(&mfb->early_suspend);
+ mfb->early_suspend.suspend = early_suspend;
+ mfb->early_suspend.resume = late_resume;
+ register_early_suspend(&mfb->early_suspend);
+ }
#endif
goto out;
@@ -719,8 +730,10 @@ void mcde_fb_destroy(struct mcde_display_device *dev)
dev_vdbg(&dev->dev, "%s\n", __func__);
- mcde_dss_disable_display(dev);
- mcde_dss_close_channel(dev);
+ if (dev->fictive == false) {
+ mcde_dss_disable_display(dev);
+ mcde_dss_close_channel(dev);
+ }
mfb = to_mcde_fb(dev->fbi);
for (i = 0; i < mfb->num_ovlys; i++) {