drm/rockchip: dsi: add support swap two channel data of MIPI

Change-Id: Ib9dd986da26bff9fb744e592522c332e721e03ac
Signed-off-by: Guochun Huang <hero.huang@rock-chips.com>
This commit is contained in:
Guochun Huang
2020-11-28 10:23:51 +08:00
parent e33cbb1fb8
commit ba83205b99
2 changed files with 10 additions and 1 deletions

View File

@@ -11,6 +11,7 @@ Required properties:
"rockchip,rk3288-mipi-dsi", "snps,dw-mipi-dsi".
"rockchip,rk3368-mipi-dsi", "snps,dw-mipi-dsi".
"rockchip,rk3399-mipi-dsi", "snps,dw-mipi-dsi".
"rockchip,rk3568-mipi-dsi", "snps,dw-mipi-dsi".
"rockchip,rv1126-mipi-dsi", "snps,dw-mipi-dsi".
- reg: Represent the physical address range of the controller.
- interrupts: Represent the controller's interrupt to the CPU(s).
@@ -33,6 +34,7 @@ Optional properties:
attribute, provides phandle to MIPI PHY node
- rockchip,lane-rate: optional override of the desired bandwidth.
- rockchip,dual-channel: for dual-channel mode, phandle to the slave channel.
- rockchip,data-swap: for dual-channel mode, swap two channel data of MIPI.
[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
[2] Documentation/devicetree/bindings/media/video-interfaces.txt

View File

@@ -272,6 +272,7 @@ struct dw_mipi_dsi {
/* dual-channel */
struct dw_mipi_dsi *master;
struct dw_mipi_dsi *slave;
bool data_swap;
unsigned int lane_mbps; /* per lane */
u32 channel;
@@ -1365,10 +1366,14 @@ dw_mipi_dsi_encoder_atomic_check(struct drm_encoder *encoder,
if (dsi->slave) {
s->output_flags |= ROCKCHIP_OUTPUT_DUAL_CHANNEL_LEFT_RIGHT_MODE;
if (dsi->data_swap)
s->output_flags |= ROCKCHIP_OUTPUT_DATA_SWAP;
s->output_if |= VOP_OUTPUT_IF_MIPI1;
}
if (dsi->id)
/* dual link dsi for rk3399 */
if (dsi->id && !dsi->dphy.phy)
s->output_flags |= ROCKCHIP_OUTPUT_DATA_SWAP;
return 0;
@@ -1455,6 +1460,8 @@ static int dw_mipi_dsi_dual_channel_probe(struct dw_mipi_dsi *dsi)
np = of_parse_phandle(dsi->dev->of_node, "rockchip,dual-channel", 0);
if (np) {
dsi->data_swap = of_property_read_bool(dsi->dev->of_node,
"rockchip,data-swap");
secondary = of_find_device_by_node(np);
dsi->slave = platform_get_drvdata(secondary);
of_node_put(np);