summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/exynos/exynos_drm_dsi.c
diff options
context:
space:
mode:
authorHyungwon Hwang <human.hwang@samsung.com>2015-01-27 17:59:45 +0900
committerSeung-Woo Kim <sw0312.kim@samsung.com>2016-12-14 13:41:10 +0900
commit56896e53d581bcf4a5b3c159abf76f45c129bfee (patch)
treeb374b6d3c61fcdac7f6a627ead9f0b9a3b430fbb /drivers/gpu/drm/exynos/exynos_drm_dsi.c
parentb4b4971891dd3bff0653a182c46c72e7d984d0d1 (diff)
drm/exynos: dsi: add support for MIC driver as a bridge
MIC must be initilized by MIPI DSI when it is being bound. Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
Diffstat (limited to 'drivers/gpu/drm/exynos/exynos_drm_dsi.c')
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_dsi.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
index f3fa2513aa1f..1f3683b63d14 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
@@ -20,6 +20,7 @@
#include <linux/irq.h>
#include <linux/of_device.h>
#include <linux/of_gpio.h>
+#include <linux/of_graph.h>
#include <linux/phy/phy.h>
#include <linux/regulator/consumer.h>
#include <linux/component.h>
@@ -282,6 +283,7 @@ struct exynos_dsi {
struct list_head transfer_list;
struct exynos_dsi_driver_data *driver_data;
+ struct device_node *bridge_node;
};
#define host_to_dsi(host) container_of(host, struct exynos_dsi, dsi_host)
@@ -1771,7 +1773,22 @@ static int exynos_dsi_parse_dt(struct exynos_dsi *dsi)
ret = exynos_dsi_of_read_u32(ep, "samsung,esc-clock-frequency",
&dsi->esc_clk_rate);
+ if (ret < 0)
+ goto end;
+
+ of_node_put(ep);
+
+ ep = of_graph_get_next_endpoint(node, NULL);
+ if (!ep) {
+ ret = -ENXIO;
+ goto end;
+ }
+ dsi->bridge_node = of_graph_get_remote_port_parent(ep);
+ if (!dsi->bridge_node) {
+ ret = -ENXIO;
+ goto end;
+ }
end:
of_node_put(ep);
@@ -1784,6 +1801,7 @@ static int exynos_dsi_bind(struct device *dev, struct device *master,
struct exynos_drm_display *display = dev_get_drvdata(dev);
struct exynos_dsi *dsi = display_to_dsi(display);
struct drm_device *drm_dev = data;
+ struct drm_bridge *bridge;
int ret;
ret = exynos_drm_create_enc_conn(drm_dev, display);
@@ -1793,6 +1811,12 @@ static int exynos_dsi_bind(struct device *dev, struct device *master,
return ret;
}
+ bridge = of_drm_find_bridge(dsi->bridge_node);
+ if (bridge) {
+ display->encoder->bridge = bridge;
+ drm_bridge_attach(drm_dev, bridge);
+ }
+
return mipi_dsi_host_register(&dsi->dsi_host);
}