summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPadmanabhan Komanduru <pkomandu@codeaurora.org>2015-04-21 12:43:01 -0700
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 20:42:12 -0700
commit50fd1860673ca4d3c5af2a5c05f467da0dd0064a (patch)
tree589d0ad87a8e261b548c9cc53cc408a03047b171
parent5a2e3355e8b4a0eaf265cfa714da4e07593098c3 (diff)
ARM: dts: msm: move the DSI lane map settings from panel dtsi
The DSI lane settings are dependent on the board h/w settings and not dependent on the panel. Currently this setting is part of the panel dtsi. Add change to move this from the panel dtsi to the board specific dtsi files. Add corresponding driver changes to parse the DT property correctly. Change-Id: Ic2008eb7b0668945b0ed938dba87f94b203733eb Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org> [cip@codeaurora.org: Removed .dtsi file updates] Signed-off-by: Clarence Ip <cip@codeaurora.org>
-rw-r--r--Documentation/devicetree/bindings/fb/mdss-dsi-ctrl.txt10
-rw-r--r--Documentation/devicetree/bindings/fb/mdss-dsi-panel.txt10
-rw-r--r--drivers/video/fbdev/msm/dsi_host_v2.c39
-rw-r--r--drivers/video/fbdev/msm/mdss_dsi.c27
-rw-r--r--drivers/video/fbdev/msm/mdss_dsi.h1
-rw-r--r--drivers/video/fbdev/msm/mdss_dsi_host.c2
-rw-r--r--drivers/video/fbdev/msm/mdss_dsi_panel.c26
-rw-r--r--drivers/video/fbdev/msm/mdss_panel.h1
8 files changed, 75 insertions, 41 deletions
diff --git a/Documentation/devicetree/bindings/fb/mdss-dsi-ctrl.txt b/Documentation/devicetree/bindings/fb/mdss-dsi-ctrl.txt
index 5d04ee748ac8..51d92fae781d 100644
--- a/Documentation/devicetree/bindings/fb/mdss-dsi-ctrl.txt
+++ b/Documentation/devicetree/bindings/fb/mdss-dsi-ctrl.txt
@@ -68,6 +68,15 @@ Optional properties:
- qcom,dsi-irq-line: Boolean specifies if DSI has a different irq line than mdp.
- qcom,timing-db-mode: Boolean specifies dsi timing mode registers are supported or not.
- qcom,dsi-clk-ln-recovery: Boolean which enables the clk lane recovery
+- qcom,lane-map: Specifies the data lane swap configuration.
+ "lane_map_0123" = <0 1 2 3> (default value)
+ "lane_map_3012" = <3 0 1 2>
+ "lane_map_2301" = <2 3 0 1>
+ "lane_map_1230" = <1 2 3 0>
+ "lane_map_0321" = <0 3 2 1>
+ "lane_map_1032" = <1 0 3 2>
+ "lane_map_2103" = <2 1 0 3>
+ "lane_map_3210" = <3 2 1 0>
Example:
mdss_dsi0: qcom,mdss_dsi@fd922800 {
@@ -108,6 +117,7 @@ Example:
qcom,dsi-irq-line;
qcom,timing-db-mode;
qcom,dsi-clk-ln-recovery;
+ qcom,lane-map = "lane_map_3012";
qcom,core-supply-entries {
#address-cells = <1>;
diff --git a/Documentation/devicetree/bindings/fb/mdss-dsi-panel.txt b/Documentation/devicetree/bindings/fb/mdss-dsi-panel.txt
index bf825b4cc19f..a3d4601dcf03 100644
--- a/Documentation/devicetree/bindings/fb/mdss-dsi-panel.txt
+++ b/Documentation/devicetree/bindings/fb/mdss-dsi-panel.txt
@@ -234,15 +234,6 @@ Optional properties:
- qcom,mdss-dsi-lane-1-state: Boolean that specifies whether data lane 1 is enabled.
- qcom,mdss-dsi-lane-2-state: Boolean that specifies whether data lane 2 is enabled.
- qcom,mdss-dsi-lane-3-state: Boolean that specifies whether data lane 3 is enabled.
-- qcom,mdss-dsi-lane-map: Specifies the data lane swap configuration.
- "lane_map_0123" = <0 1 2 3> (default value)
- "lane_map_3012" = <3 0 1 2>
- "lane_map_2301" = <2 3 0 1>
- "lane_map_1230" = <1 2 3 0>
- "lane_map_0321" = <0 3 2 1>
- "lane_map_1032" = <1 0 3 2>
- "lane_map_2103" = <2 1 0 3>
- "lane_map_3210" = <3 2 1 0>
- qcom,mdss-dsi-t-clk-post: Specifies the byte clock cycles after mode switch.
0x03 = default value.
- qcom,mdss-dsi-t-clk-pre: Specifies the byte clock cycles before mode switch.
@@ -495,7 +486,6 @@ Example:
qcom,mdss-dsi-lane-1-state;
qcom,mdss-dsi-lane-2-state;
qcom,mdss-dsi-lane-3-state;
- qcom,mdss-dsi-lane-map = <0>;
qcom,mdss-dsi-t-clk-post = <0x20>;
qcom,mdss-dsi-t-clk-pre = <0x2c>;
qcom,mdss-dsi-stream = <0>;
diff --git a/drivers/video/fbdev/msm/dsi_host_v2.c b/drivers/video/fbdev/msm/dsi_host_v2.c
index 5d6fb8569716..9b4afb265b00 100644
--- a/drivers/video/fbdev/msm/dsi_host_v2.c
+++ b/drivers/video/fbdev/msm/dsi_host_v2.c
@@ -393,13 +393,20 @@ static int msm_dsi_wait4video_eng_busy(struct mdss_dsi_ctrl_pdata *ctrl)
return rc;
}
-void msm_dsi_host_init(struct mipi_panel_info *pinfo)
+void msm_dsi_host_init(struct mdss_panel_data *pdata)
{
u32 dsi_ctrl, data;
unsigned char *ctrl_base = dsi_host_private->dsi_base;
+ struct mdss_dsi_ctrl_pdata *ctrl_pdata = NULL;
+ struct mipi_panel_info *pinfo;
pr_debug("msm_dsi_host_init\n");
+ ctrl_pdata = container_of(pdata, struct mdss_dsi_ctrl_pdata,
+ panel_data);
+ pinfo = &pdata->panel_info.mipi;
+
+
if (pinfo->mode == DSI_VIDEO_MODE) {
data = 0;
if (pinfo->pulse_mode_hsa_he)
@@ -480,7 +487,7 @@ void msm_dsi_host_init(struct mipi_panel_info *pinfo)
MIPI_OUTP(ctrl_base + DSI_TRIG_CTRL, data);
/* DSI_LAN_SWAP_CTRL */
- MIPI_OUTP(ctrl_base + DSI_LANE_SWAP_CTRL, pinfo->dlane_swap);
+ MIPI_OUTP(ctrl_base + DSI_LANE_SWAP_CTRL, ctrl_pdata->dlane_swap);
/* clock out ctrl */
data = pinfo->t_clk_post & 0x3f; /* 6 bits */
@@ -1186,7 +1193,7 @@ static int msm_dsi_on(struct mdss_panel_data *pdata)
}
msm_dsi_sw_reset();
- msm_dsi_host_init(mipi);
+ msm_dsi_host_init(pdata);
if (mipi->force_clk_lane_hs) {
u32 tmp;
@@ -1621,6 +1628,30 @@ void msm_dsi_ctrl_init(struct mdss_dsi_ctrl_pdata *ctrl)
}
}
+static void msm_dsi_parse_lane_swap(struct device_node *np, char *dlane_swap)
+{
+ const char *data;
+
+ *dlane_swap = DSI_LANE_MAP_0123;
+ data = of_get_property(np, "qcom,lane-map", NULL);
+ if (data) {
+ if (!strcmp(data, "lane_map_3012"))
+ *dlane_swap = DSI_LANE_MAP_3012;
+ else if (!strcmp(data, "lane_map_2301"))
+ *dlane_swap = DSI_LANE_MAP_2301;
+ else if (!strcmp(data, "lane_map_1230"))
+ *dlane_swap = DSI_LANE_MAP_1230;
+ else if (!strcmp(data, "lane_map_0321"))
+ *dlane_swap = DSI_LANE_MAP_0321;
+ else if (!strcmp(data, "lane_map_1032"))
+ *dlane_swap = DSI_LANE_MAP_1032;
+ else if (!strcmp(data, "lane_map_2103"))
+ *dlane_swap = DSI_LANE_MAP_2103;
+ else if (!strcmp(data, "lane_map_3210"))
+ *dlane_swap = DSI_LANE_MAP_3210;
+ }
+}
+
static int msm_dsi_probe(struct platform_device *pdev)
{
struct dsi_interface intf;
@@ -1726,6 +1757,8 @@ static int msm_dsi_probe(struct platform_device *pdev)
goto error_pan_node;
}
+ msm_dsi_parse_lane_swap(pdev->dev.of_node, &(ctrl_pdata->dlane_swap));
+
for (i = 0; i < DSI_MAX_PM; i++) {
rc = msm_dsi_io_init(pdev, &(ctrl_pdata->power_data[i]));
if (rc) {
diff --git a/drivers/video/fbdev/msm/mdss_dsi.c b/drivers/video/fbdev/msm/mdss_dsi.c
index ba7c76d6bf33..64c28dd39718 100644
--- a/drivers/video/fbdev/msm/mdss_dsi.c
+++ b/drivers/video/fbdev/msm/mdss_dsi.c
@@ -2297,6 +2297,30 @@ static int mdss_dsi_irq_init(struct device *dev, int irq_no,
return ret;
}
+static void mdss_dsi_parse_lane_swap(struct device_node *np, char *dlane_swap)
+{
+ const char *data;
+
+ *dlane_swap = DSI_LANE_MAP_0123;
+ data = of_get_property(np, "qcom,lane-map", NULL);
+ if (data) {
+ if (!strcmp(data, "lane_map_3012"))
+ *dlane_swap = DSI_LANE_MAP_3012;
+ else if (!strcmp(data, "lane_map_2301"))
+ *dlane_swap = DSI_LANE_MAP_2301;
+ else if (!strcmp(data, "lane_map_1230"))
+ *dlane_swap = DSI_LANE_MAP_1230;
+ else if (!strcmp(data, "lane_map_0321"))
+ *dlane_swap = DSI_LANE_MAP_0321;
+ else if (!strcmp(data, "lane_map_1032"))
+ *dlane_swap = DSI_LANE_MAP_1032;
+ else if (!strcmp(data, "lane_map_2103"))
+ *dlane_swap = DSI_LANE_MAP_2103;
+ else if (!strcmp(data, "lane_map_3210"))
+ *dlane_swap = DSI_LANE_MAP_3210;
+ }
+}
+
int dsi_panel_device_register(struct device_node *pan_node,
struct mdss_dsi_ctrl_pdata *ctrl_pdata)
{
@@ -2465,6 +2489,9 @@ int dsi_panel_device_register(struct device_node *pan_node,
ctrl_pdata->mode_gpio = -EINVAL;
}
+ mdss_dsi_parse_lane_swap(ctrl_pdev->dev.of_node,
+ &(ctrl_pdata->dlane_swap));
+
ctrl_pdata->timing_db_mode = of_property_read_bool(
ctrl_pdev->dev.of_node, "qcom,timing-db-mode");
diff --git a/drivers/video/fbdev/msm/mdss_dsi.h b/drivers/video/fbdev/msm/mdss_dsi.h
index 8bdf547966d8..5a403d542528 100644
--- a/drivers/video/fbdev/msm/mdss_dsi.h
+++ b/drivers/video/fbdev/msm/mdss_dsi.h
@@ -411,6 +411,7 @@ struct mdss_dsi_ctrl_pdata {
bool core_power;
bool mmss_clamp;
bool timing_db_mode;
+ char dlane_swap; /* data lane swap */
struct dsi_buf tx_buf;
struct dsi_buf rx_buf;
diff --git a/drivers/video/fbdev/msm/mdss_dsi_host.c b/drivers/video/fbdev/msm/mdss_dsi_host.c
index c6e251d8e2d4..530d69d03a81 100644
--- a/drivers/video/fbdev/msm/mdss_dsi_host.c
+++ b/drivers/video/fbdev/msm/mdss_dsi_host.c
@@ -371,7 +371,7 @@ void mdss_dsi_host_init(struct mdss_panel_data *pdata)
data); /* DSI_TRIG_CTRL */
/* DSI_LAN_SWAP_CTRL */
- MIPI_OUTP((ctrl_pdata->ctrl_base) + 0x00b0, pinfo->dlane_swap);
+ MIPI_OUTP((ctrl_pdata->ctrl_base) + 0x00b0, ctrl_pdata->dlane_swap);
/* clock out ctrl */
data = pinfo->t_clk_post & 0x3f; /* 6 bits */
diff --git a/drivers/video/fbdev/msm/mdss_dsi_panel.c b/drivers/video/fbdev/msm/mdss_dsi_panel.c
index e79e9398d817..8feaf5188a11 100644
--- a/drivers/video/fbdev/msm/mdss_dsi_panel.c
+++ b/drivers/video/fbdev/msm/mdss_dsi_panel.c
@@ -770,30 +770,6 @@ static int mdss_dsi_panel_low_power_config(struct mdss_panel_data *pdata,
return 0;
}
-static void mdss_dsi_parse_lane_swap(struct device_node *np, char *dlane_swap)
-{
- const char *data;
-
- *dlane_swap = DSI_LANE_MAP_0123;
- data = of_get_property(np, "qcom,mdss-dsi-lane-map", NULL);
- if (data) {
- if (!strcmp(data, "lane_map_3012"))
- *dlane_swap = DSI_LANE_MAP_3012;
- else if (!strcmp(data, "lane_map_2301"))
- *dlane_swap = DSI_LANE_MAP_2301;
- else if (!strcmp(data, "lane_map_1230"))
- *dlane_swap = DSI_LANE_MAP_1230;
- else if (!strcmp(data, "lane_map_0321"))
- *dlane_swap = DSI_LANE_MAP_0321;
- else if (!strcmp(data, "lane_map_1032"))
- *dlane_swap = DSI_LANE_MAP_1032;
- else if (!strcmp(data, "lane_map_2103"))
- *dlane_swap = DSI_LANE_MAP_2103;
- else if (!strcmp(data, "lane_map_3210"))
- *dlane_swap = DSI_LANE_MAP_3210;
- }
-}
-
static void mdss_dsi_parse_trigger(struct device_node *np, char *trigger,
char *trigger_key)
{
@@ -2101,8 +2077,6 @@ static int mdss_panel_parse_dt(struct device_node *np,
mdss_dsi_parse_trigger(np, &(pinfo->mipi.dma_trigger),
"qcom,mdss-dsi-dma-trigger");
- mdss_dsi_parse_lane_swap(np, &(pinfo->mipi.dlane_swap));
-
mdss_dsi_parse_compression_params(np, pinfo);
mdss_panel_parse_te_params(np, pinfo);
diff --git a/drivers/video/fbdev/msm/mdss_panel.h b/drivers/video/fbdev/msm/mdss_panel.h
index 01e0871efc4a..cc2ecd6e82ce 100644
--- a/drivers/video/fbdev/msm/mdss_panel.h
+++ b/drivers/video/fbdev/msm/mdss_panel.h
@@ -297,7 +297,6 @@ struct mipi_panel_info {
char data_lane1;
char data_lane2;
char data_lane3;
- char dlane_swap; /* data lane swap */
char rgb_swap;
char b_sel;
char g_sel;