| .. | .. |
|---|
| 15 | 15 | #include <linux/reset.h> |
|---|
| 16 | 16 | #include <linux/phy/phy.h> |
|---|
| 17 | 17 | |
|---|
| 18 | | -#include <drm/drmP.h> |
|---|
| 19 | 18 | #include <drm/drm_atomic_helper.h> |
|---|
| 20 | | -#include <drm/drm_crtc_helper.h> |
|---|
| 19 | +#include <drm/drm_probe_helper.h> |
|---|
| 21 | 20 | #include <drm/drm_mipi_dsi.h> |
|---|
| 22 | 21 | #include <drm/drm_of.h> |
|---|
| 23 | 22 | #include <drm/drm_panel.h> |
|---|
| .. | .. |
|---|
| 863 | 862 | { |
|---|
| 864 | 863 | struct rk628_dsi *dsi = connector_to_dsi(connector); |
|---|
| 865 | 864 | |
|---|
| 866 | | - return drm_panel_get_modes(dsi->panel); |
|---|
| 865 | + return drm_panel_get_modes(dsi->panel, connector); |
|---|
| 867 | 866 | } |
|---|
| 868 | 867 | |
|---|
| 869 | 868 | static struct drm_connector_helper_funcs rk628_dsi_connector_helper_funcs = { |
|---|
| .. | .. |
|---|
| 1121 | 1120 | bus_width |= COMBTXPHY_MODULEA_EN; |
|---|
| 1122 | 1121 | phy_set_bus_width(dsi->phy, bus_width); |
|---|
| 1123 | 1122 | |
|---|
| 1124 | | - ret = phy_set_mode(dsi->phy, PHY_MODE_VIDEO_MIPI); |
|---|
| 1123 | + ret = phy_set_mode(dsi->phy, PHY_MODE_MIPI_DPHY); |
|---|
| 1125 | 1124 | if (ret) { |
|---|
| 1126 | 1125 | dev_err(dsi->dev, "failed to set phy mode: %d\n", ret); |
|---|
| 1127 | 1126 | return; |
|---|
| .. | .. |
|---|
| 1150 | 1149 | } |
|---|
| 1151 | 1150 | |
|---|
| 1152 | 1151 | 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) |
|---|
| 1155 | 1154 | { |
|---|
| 1156 | 1155 | struct rk628_dsi *dsi = bridge_to_dsi(bridge); |
|---|
| 1157 | 1156 | |
|---|
| .. | .. |
|---|
| 1162 | 1161 | } |
|---|
| 1163 | 1162 | } |
|---|
| 1164 | 1163 | |
|---|
| 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) |
|---|
| 1166 | 1166 | { |
|---|
| 1167 | 1167 | struct rk628_dsi *dsi = bridge_to_dsi(bridge); |
|---|
| 1168 | 1168 | struct drm_connector *connector = &dsi->connector; |
|---|
| .. | .. |
|---|
| 1171 | 1171 | |
|---|
| 1172 | 1172 | if (!dsi->panel) |
|---|
| 1173 | 1173 | return -EPROBE_DEFER; |
|---|
| 1174 | + |
|---|
| 1175 | + if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) |
|---|
| 1176 | + return 0; |
|---|
| 1174 | 1177 | |
|---|
| 1175 | 1178 | ret = drm_connector_init(drm, connector, &rk628_dsi_connector_funcs, |
|---|
| 1176 | 1179 | DRM_MODE_CONNECTOR_DSI); |
|---|
| .. | .. |
|---|
| 1181 | 1184 | |
|---|
| 1182 | 1185 | drm_connector_helper_add(connector, &rk628_dsi_connector_helper_funcs); |
|---|
| 1183 | 1186 | 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 | | - } |
|---|
| 1190 | 1187 | |
|---|
| 1191 | 1188 | return 0; |
|---|
| 1192 | 1189 | } |
|---|