diff options
| author | Padmanabhan Komanduru <pkomandu@codeaurora.org> | 2015-05-05 22:45:30 -0700 |
|---|---|---|
| committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-23 21:13:54 -0700 |
| commit | ad8db57f799eb3a9509a20da4826bdf48103f0bd (patch) | |
| tree | 1a2a3b6fbeacf430360e39c03fbebf3ac5f354a6 /drivers/video/fbdev | |
| parent | 5d1510deccd67a2783daaf9bb40ef4b74077c52e (diff) | |
msm: mdss: add support to register secondary fb on DSI device
In the current implementation, DSI0/DSI1 device is always mapped
to frame buffer-0. For dual DSI configuration, we need to
register both the DSI devices to different frame buffers. Add driver
and dtsi support to register DSI device on primary/secondary
frame buffer at runtime based on the DSI configuration.
Change-Id: Iac872723711c5d0264088c4f3b53d1385fd9ffe0
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
Signed-off-by: Vinu Deokaran <vinud@codeaurora.org>
Signed-off-by: Sandeep Panda <spanda@codeaurora.org>
Diffstat (limited to 'drivers/video/fbdev')
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_dsi.c | 30 | ||||
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_dsi.h | 14 | ||||
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_fb.c | 16 | ||||
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_panel.h | 1 |
4 files changed, 56 insertions, 5 deletions
diff --git a/drivers/video/fbdev/msm/mdss_dsi.c b/drivers/video/fbdev/msm/mdss_dsi.c index e5f136d4afb1..341ad466db59 100644 --- a/drivers/video/fbdev/msm/mdss_dsi.c +++ b/drivers/video/fbdev/msm/mdss_dsi.c @@ -2278,6 +2278,35 @@ int mdss_dsi_register_recovery_handler(struct mdss_dsi_ctrl_pdata *ctrl, return 0; } +static struct device_node *mdss_dsi_get_fb_node_cb(struct platform_device *pdev) +{ + struct device_node *fb_node; + struct platform_device *dsi_dev; + struct mdss_dsi_ctrl_pdata *ctrl_pdata; + + if (pdev == NULL) { + pr_err("%s: Invalid input data\n", __func__); + return NULL; + } + + ctrl_pdata = platform_get_drvdata(pdev); + dsi_dev = of_find_device_by_node(pdev->dev.of_node->parent); + if (!dsi_dev) { + pr_err("Unable to find dsi master device: %s\n", + pdev->dev.of_node->full_name); + return NULL; + } + + fb_node = of_parse_phandle(dsi_dev->dev.of_node, + mdss_dsi_get_fb_name(ctrl_pdata), 0); + if (!fb_node) { + pr_err("Unable to find fb node for device: %s\n", pdev->name); + return NULL; + } + + return fb_node; +} + static int mdss_dsi_event_handler(struct mdss_panel_data *pdata, int event, void *arg) { @@ -3727,6 +3756,7 @@ int dsi_panel_device_register(struct platform_device *ctrl_pdev, } ctrl_pdata->panel_data.event_handler = mdss_dsi_event_handler; + ctrl_pdata->panel_data.get_fb_node = mdss_dsi_get_fb_node_cb; if (ctrl_pdata->status_mode == ESD_REG || ctrl_pdata->status_mode == ESD_REG_NT35596) diff --git a/drivers/video/fbdev/msm/mdss_dsi.h b/drivers/video/fbdev/msm/mdss_dsi.h index 816a741765cc..1a9c59fbcc71 100644 --- a/drivers/video/fbdev/msm/mdss_dsi.h +++ b/drivers/video/fbdev/msm/mdss_dsi.h @@ -746,6 +746,20 @@ static inline u32 mdss_dsi_get_phy_revision(struct mdss_dsi_ctrl_pdata *ctrl) return ctrl->shared_data->phy_rev; } +static inline const char *mdss_dsi_get_fb_name(struct mdss_dsi_ctrl_pdata *ctrl) +{ + struct mdss_panel_info *pinfo = &(ctrl->panel_data.panel_info); + + if (mdss_dsi_is_hw_config_dual(ctrl->shared_data)) { + if (pinfo->pdest == DISPLAY_1) + return "qcom,mdss-fb-map-prim"; + else + return "qcom,mdss-fb-map-sec"; + } else { + return "qcom,mdss-fb-map-prim"; + } +} + static inline bool mdss_dsi_sync_wait_enable(struct mdss_dsi_ctrl_pdata *ctrl) { return ctrl->cmd_sync_wait_broadcast; diff --git a/drivers/video/fbdev/msm/mdss_fb.c b/drivers/video/fbdev/msm/mdss_fb.c index ba01cffbdaa8..dcc29621529c 100644 --- a/drivers/video/fbdev/msm/mdss_fb.c +++ b/drivers/video/fbdev/msm/mdss_fb.c @@ -4475,7 +4475,7 @@ int mdss_register_panel(struct platform_device *pdev, struct mdss_panel_data *pdata) { struct platform_device *fb_pdev, *mdss_pdev; - struct device_node *node; + struct device_node *node = NULL; int rc = 0; bool master_panel = true; @@ -4489,11 +4489,17 @@ int mdss_register_panel(struct platform_device *pdev, return -EPROBE_DEFER; } - node = of_parse_phandle(pdev->dev.of_node, "qcom,mdss-fb-map", 0); + if (pdata->get_fb_node) + node = pdata->get_fb_node(pdev); + if (!node) { - pr_err("Unable to find fb node for device: %s\n", - pdev->name); - return -ENODEV; + node = of_parse_phandle(pdev->dev.of_node, + "qcom,mdss-fb-map", 0); + if (!node) { + pr_err("Unable to find fb node for device: %s\n", + pdev->name); + return -ENODEV; + } } mdss_pdev = of_find_device_by_node(node->parent); if (!mdss_pdev) { diff --git a/drivers/video/fbdev/msm/mdss_panel.h b/drivers/video/fbdev/msm/mdss_panel.h index 7d7e916f7be4..b7a17c8bd152 100644 --- a/drivers/video/fbdev/msm/mdss_panel.h +++ b/drivers/video/fbdev/msm/mdss_panel.h @@ -711,6 +711,7 @@ struct mdss_panel_data { * and teardown. */ int (*event_handler) (struct mdss_panel_data *pdata, int e, void *arg); + struct device_node *(*get_fb_node)(struct platform_device *pdev); struct list_head timings_list; struct mdss_panel_timing *current_timing; |
