summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b6f8266)
raw | patch | inline | side by side (parent: b6f8266)
author | Archit Taneja <archit@ti.com> | |
Mon, 18 Mar 2013 08:50:08 +0000 (14:20 +0530) | ||
committer | Archit Taneja <archit@ti.com> | |
Thu, 30 May 2013 14:32:17 +0000 (20:02 +0530) |
This allows panel drivers to be independent of the underlying DPI IP, i.e,
whether it's OMAP DPI or DRA DPI.
Signed-off-by: Archit Taneja <archit@ti.com>
whether it's OMAP DPI or DRA DPI.
Signed-off-by: Archit Taneja <archit@ti.com>
drivers/video/omap2/dss/Makefile | patch | blob | history | |
drivers/video/omap2/dss/core.c | patch | blob | history | |
drivers/video/omap2/dss/dpi.c | patch | blob | history | |
drivers/video/omap2/dss/dpi_common.c | [new file with mode: 0644] | patch | blob |
drivers/video/omap2/dss/dss.h | patch | blob | history |
index b4b42b13efa1d5949a39512c0bafa3f682b7a5d4..524c4ed7f8c347dbb1851ad391a5557d1151d124 100644 (file)
# DSS compat layer files
omapdss-y += manager.o manager-sysfs.o overlay.o overlay-sysfs.o apply.o \
dispc-compat.o display-sysfs.o
-omapdss-$(CONFIG_OMAP2_DSS_DPI) += dpi.o
+omapdss-$(CONFIG_OMAP2_DSS_DPI) += dpi.o dpi_common.o
omapdss-$(CONFIG_OMAP2_DSS_RFBI) += rfbi.o
omapdss-$(CONFIG_OMAP2_DSS_VENC) += venc.o venc_panel.o
omapdss-$(CONFIG_OMAP2_DSS_SDI) += sdi.o
index 0ddaae61a0e48d3cbe139e025e6f4426af063de7..4b02efabe1e726d864aff7d7bc287812f68b6511 100644 (file)
dsi_init_platform_driver,
#endif
#ifdef CONFIG_OMAP2_DSS_DPI
- dpi_init_platform_driver,
+ omap_dpi_init_platform_driver,
#endif
#ifdef CONFIG_OMAP2_DSS_SDI
sdi_init_platform_driver,
dsi_uninit_platform_driver,
#endif
#ifdef CONFIG_OMAP2_DSS_DPI
- dpi_uninit_platform_driver,
+ omap_dpi_uninit_platform_driver,
#endif
#ifdef CONFIG_OMAP2_DSS_SDI
sdi_uninit_platform_driver,
index 3464af064da69421c9b192ab4c38d88a41deab3a..5e63e210226fbbe6acdbb704d3899c2f4a4bcde3 100644 (file)
dss_mgr_set_lcd_config(mgr, &dpi.mgr_config);
}
-int omapdss_dpi_display_enable(struct omap_dss_device *dssdev)
+static int omap_dpi_display_enable(struct omap_dss_device *dssdev)
{
struct omap_dss_output *out = dssdev->output;
int r;
mutex_unlock(&dpi.lock);
return r;
}
-EXPORT_SYMBOL(omapdss_dpi_display_enable);
-void omapdss_dpi_display_disable(struct omap_dss_device *dssdev)
+static void omap_dpi_display_disable(struct omap_dss_device *dssdev)
{
struct omap_overlay_manager *mgr = dssdev->output->manager;
mutex_unlock(&dpi.lock);
}
-EXPORT_SYMBOL(omapdss_dpi_display_disable);
-void omapdss_dpi_set_timings(struct omap_dss_device *dssdev,
+static void omap_dpi_set_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings)
{
DSSDBG("dpi_set_timings\n");
mutex_unlock(&dpi.lock);
}
-EXPORT_SYMBOL(omapdss_dpi_set_timings);
-int dpi_check_timings(struct omap_dss_device *dssdev,
+static int omap_dpi_check_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings)
{
int r;
return 0;
}
-EXPORT_SYMBOL(dpi_check_timings);
-void omapdss_dpi_set_data_lines(struct omap_dss_device *dssdev, int data_lines)
+static void omap_dpi_set_data_lines(struct omap_dss_device *dssdev, int data_lines)
{
mutex_lock(&dpi.lock);
mutex_unlock(&dpi.lock);
}
-EXPORT_SYMBOL(omapdss_dpi_set_data_lines);
static int __init dpi_verify_dsi_pll(struct platform_device *dsidev)
{
dss_unregister_output(out);
}
+static struct dpi_common_ops ops = {
+ .enable = omap_dpi_display_enable,
+ .disable = omap_dpi_display_disable,
+ .set_timings = omap_dpi_set_timings,
+ .check_timings = omap_dpi_check_timings,
+ .set_data_lines = omap_dpi_set_data_lines,
+};
+
static int __init omap_dpi_probe(struct platform_device *pdev)
{
mutex_init(&dpi.lock);
+ dpi_common_set_ops(&ops);
+
dpi_init_output(pdev);
if (pdev->dev.of_node)
},
};
-int __init dpi_init_platform_driver(void)
+int __init omap_dpi_init_platform_driver(void)
{
return platform_driver_probe(&omap_dpi_driver, omap_dpi_probe);
}
-void __exit dpi_uninit_platform_driver(void)
+void __exit omap_dpi_uninit_platform_driver(void)
{
platform_driver_unregister(&omap_dpi_driver);
}
diff --git a/drivers/video/omap2/dss/dpi_common.c b/drivers/video/omap2/dss/dpi_common.c
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2013 Texas Instruments Ltd.
+ *
+ * Some code and ideas taken from drivers/video/omap/ driver
+ * by Imre Deak.
+ *
+ * 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 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.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <linux/kernel.h>
+#include <linux/export.h>
+
+#include <video/omapdss.h>
+
+#include "dss.h"
+#include "dss_features.h"
+
+static struct dpi_common_ops dpi_ops;
+
+int omapdss_dpi_display_enable(struct omap_dss_device *dssdev)
+{
+ return dpi_ops.enable(dssdev);
+}
+EXPORT_SYMBOL(omapdss_dpi_display_enable);
+
+void omapdss_dpi_display_disable(struct omap_dss_device *dssdev)
+{
+ dpi_ops.disable(dssdev);
+}
+EXPORT_SYMBOL(omapdss_dpi_display_disable);
+
+void omapdss_dpi_set_timings(struct omap_dss_device *dssdev,
+ struct omap_video_timings *timings)
+{
+ dpi_ops.set_timings(dssdev, timings);
+}
+EXPORT_SYMBOL(omapdss_dpi_set_timings);
+
+int dpi_check_timings(struct omap_dss_device *dssdev,
+ struct omap_video_timings *timings)
+{
+ return dpi_ops.check_timings(dssdev, timings);
+}
+EXPORT_SYMBOL(dpi_check_timings);
+
+void omapdss_dpi_set_data_lines(struct omap_dss_device *dssdev, int data_lines)
+{
+ dpi_ops.set_data_lines(dssdev, data_lines);
+}
+EXPORT_SYMBOL(omapdss_dpi_set_data_lines);
+
+void dpi_common_set_ops(struct dpi_common_ops *ops)
+{
+ dpi_ops = *ops;
+}
+
index 098982674471c45a2de689f810acbe7c060c9d1f..fc3c5cd9fb9289632a0c809a2d19efc4b12d2042 100644 (file)
int lcden_sig_polarity;
};
+struct dpi_common_ops {
+ int (*enable) (struct omap_dss_device *dssdev);
+ void (*disable) (struct omap_dss_device *dssdev);
+ void (*set_timings) (struct omap_dss_device *dssdev,
+ struct omap_video_timings *timings);
+ int (*check_timings) (struct omap_dss_device *dssdev,
+ struct omap_video_timings *timings);
+ void (*set_data_lines) (struct omap_dss_device *dssdev,
+ int data_lines);
+};
+
struct seq_file;
struct platform_device;
#endif
/* DPI */
-int dpi_init_platform_driver(void) __init;
-void dpi_uninit_platform_driver(void) __exit;
+void dpi_common_set_ops(struct dpi_common_ops *ops);
+int omap_dpi_init_platform_driver(void) __init;
+void omap_dpi_uninit_platform_driver(void) __exit;
+
/* DISPC */
int dispc_init_platform_driver(void) __init;