forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/drivers/gpu/drm/rockchip/rk628/rk628_dsi.c
....@@ -15,9 +15,8 @@
1515 #include <linux/reset.h>
1616 #include <linux/phy/phy.h>
1717
18
-#include <drm/drmP.h>
1918 #include <drm/drm_atomic_helper.h>
20
-#include <drm/drm_crtc_helper.h>
19
+#include <drm/drm_probe_helper.h>
2120 #include <drm/drm_mipi_dsi.h>
2221 #include <drm/drm_of.h>
2322 #include <drm/drm_panel.h>
....@@ -863,7 +862,7 @@
863862 {
864863 struct rk628_dsi *dsi = connector_to_dsi(connector);
865864
866
- return drm_panel_get_modes(dsi->panel);
865
+ return drm_panel_get_modes(dsi->panel, connector);
867866 }
868867
869868 static struct drm_connector_helper_funcs rk628_dsi_connector_helper_funcs = {
....@@ -1121,7 +1120,7 @@
11211120 bus_width |= COMBTXPHY_MODULEA_EN;
11221121 phy_set_bus_width(dsi->phy, bus_width);
11231122
1124
- ret = phy_set_mode(dsi->phy, PHY_MODE_VIDEO_MIPI);
1123
+ ret = phy_set_mode(dsi->phy, PHY_MODE_MIPI_DPHY);
11251124 if (ret) {
11261125 dev_err(dsi->dev, "failed to set phy mode: %d\n", ret);
11271126 return;
....@@ -1150,8 +1149,8 @@
11501149 }
11511150
11521151 static void rk628_dsi_bridge_mode_set(struct drm_bridge *bridge,
1153
- struct drm_display_mode *mode,
1154
- struct drm_display_mode *adj)
1152
+ const struct drm_display_mode *mode,
1153
+ const struct drm_display_mode *adj)
11551154 {
11561155 struct rk628_dsi *dsi = bridge_to_dsi(bridge);
11571156
....@@ -1162,7 +1161,8 @@
11621161 }
11631162 }
11641163
1165
-static int rk628_dsi_bridge_attach(struct drm_bridge *bridge)
1164
+static int rk628_dsi_bridge_attach(struct drm_bridge *bridge,
1165
+ enum drm_bridge_attach_flags flags)
11661166 {
11671167 struct rk628_dsi *dsi = bridge_to_dsi(bridge);
11681168 struct drm_connector *connector = &dsi->connector;
....@@ -1171,6 +1171,9 @@
11711171
11721172 if (!dsi->panel)
11731173 return -EPROBE_DEFER;
1174
+
1175
+ if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)
1176
+ return 0;
11741177
11751178 ret = drm_connector_init(drm, connector, &rk628_dsi_connector_funcs,
11761179 DRM_MODE_CONNECTOR_DSI);
....@@ -1181,12 +1184,6 @@
11811184
11821185 drm_connector_helper_add(connector, &rk628_dsi_connector_helper_funcs);
11831186 drm_connector_attach_encoder(connector, bridge->encoder);
1184
-
1185
- ret = drm_panel_attach(dsi->panel, connector);
1186
- if (ret) {
1187
- dev_err(dsi->dev, "Failed to attach panel\n");
1188
- return ret;
1189
- }
11901187
11911188 return 0;
11921189 }