提交 67939314 编写于 作者: D Dave Stevenson 提交者: Zheng Zengkai

drm/vc4: Add support for DSI0

raspberrypi inclusion
category: feature
bugzilla: 50432

--------------------------------

DSI0 was partially supported, but didn't register with the main
driver, and the code was inconsistent as to whether it checked
port == 0 or port == 1.

Add compatible string and other support to make it consistent.
Signed-off-by: NDave Stevenson <dave.stevenson@raspberrypi.com>
Signed-off-by: NFang Yafen <yafen@iscas.ac.cn>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 141a6423
...@@ -81,6 +81,7 @@ struct vc4_dev { ...@@ -81,6 +81,7 @@ struct vc4_dev {
struct vc4_hvs *hvs; struct vc4_hvs *hvs;
struct vc4_v3d *v3d; struct vc4_v3d *v3d;
struct vc4_dpi *dpi; struct vc4_dpi *dpi;
struct vc4_dsi *dsi0;
struct vc4_dsi *dsi1; struct vc4_dsi *dsi1;
struct vc4_vec *vec; struct vc4_vec *vec;
struct vc4_txp *txp; struct vc4_txp *txp;
......
...@@ -1306,6 +1306,7 @@ static const struct drm_encoder_helper_funcs vc4_dsi_encoder_helper_funcs = { ...@@ -1306,6 +1306,7 @@ static const struct drm_encoder_helper_funcs vc4_dsi_encoder_helper_funcs = {
}; };
static const struct of_device_id vc4_dsi_dt_match[] = { static const struct of_device_id vc4_dsi_dt_match[] = {
{ .compatible = "brcm,bcm2835-dsi0", (void *)(uintptr_t)0 },
{ .compatible = "brcm,bcm2835-dsi1", (void *)(uintptr_t)1 }, { .compatible = "brcm,bcm2835-dsi1", (void *)(uintptr_t)1 },
{} {}
}; };
...@@ -1429,10 +1430,10 @@ vc4_dsi_init_phy_clocks(struct vc4_dsi *dsi) ...@@ -1429,10 +1430,10 @@ vc4_dsi_init_phy_clocks(struct vc4_dsi *dsi)
memset(&init, 0, sizeof(init)); memset(&init, 0, sizeof(init));
init.parent_names = &parent_name; init.parent_names = &parent_name;
init.num_parents = 1; init.num_parents = 1;
if (dsi->port == 1) if (dsi->port == 0)
init.name = phy_clocks[i].dsi1_name;
else
init.name = phy_clocks[i].dsi0_name; init.name = phy_clocks[i].dsi0_name;
else
init.name = phy_clocks[i].dsi1_name;
init.ops = &clk_fixed_factor_ops; init.ops = &clk_fixed_factor_ops;
ret = devm_clk_hw_register(dev, &fix->hw); ret = devm_clk_hw_register(dev, &fix->hw);
...@@ -1604,7 +1605,9 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data) ...@@ -1604,7 +1605,9 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data)
if (ret) if (ret)
return ret; return ret;
if (dsi->port == 1) if (dsi->port == 0)
vc4->dsi0 = dsi;
else
vc4->dsi1 = dsi; vc4->dsi1 = dsi;
drm_simple_encoder_init(drm, dsi->encoder, DRM_MODE_ENCODER_DSI); drm_simple_encoder_init(drm, dsi->encoder, DRM_MODE_ENCODER_DSI);
...@@ -1649,7 +1652,9 @@ static void vc4_dsi_unbind(struct device *dev, struct device *master, ...@@ -1649,7 +1652,9 @@ static void vc4_dsi_unbind(struct device *dev, struct device *master,
list_splice_init(&dsi->bridge_chain, &dsi->encoder->bridge_chain); list_splice_init(&dsi->bridge_chain, &dsi->encoder->bridge_chain);
drm_encoder_cleanup(dsi->encoder); drm_encoder_cleanup(dsi->encoder);
if (dsi->port == 1) if (dsi->port == 0)
vc4->dsi0 = NULL;
else
vc4->dsi1 = NULL; vc4->dsi1 = NULL;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册