| .. | .. |
|---|
| 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> |
|---|
| .. | .. |
|---|
| 638 | 637 | u32 val; |
|---|
| 639 | 638 | int ret; |
|---|
| 640 | 639 | |
|---|
| 640 | + if (!vrefresh) |
|---|
| 641 | + return -EINVAL; |
|---|
| 642 | + |
|---|
| 641 | 643 | ret = regmap_read_poll_timeout(dsi->regmap, |
|---|
| 642 | 644 | dsi->reg_base + DSI_CMD_PKT_STATUS, |
|---|
| 643 | 645 | val, !(val & GEN_RD_CMD_BUSY), |
|---|
| .. | .. |
|---|
| 863 | 865 | { |
|---|
| 864 | 866 | struct rk628_dsi *dsi = connector_to_dsi(connector); |
|---|
| 865 | 867 | |
|---|
| 866 | | - return drm_panel_get_modes(dsi->panel); |
|---|
| 868 | + return drm_panel_get_modes(dsi->panel, connector); |
|---|
| 867 | 869 | } |
|---|
| 868 | 870 | |
|---|
| 869 | 871 | static struct drm_connector_helper_funcs rk628_dsi_connector_helper_funcs = { |
|---|
| .. | .. |
|---|
| 1121 | 1123 | bus_width |= COMBTXPHY_MODULEA_EN; |
|---|
| 1122 | 1124 | phy_set_bus_width(dsi->phy, bus_width); |
|---|
| 1123 | 1125 | |
|---|
| 1124 | | - ret = phy_set_mode(dsi->phy, PHY_MODE_VIDEO_MIPI); |
|---|
| 1126 | + ret = phy_set_mode(dsi->phy, PHY_MODE_MIPI_DPHY); |
|---|
| 1125 | 1127 | if (ret) { |
|---|
| 1126 | 1128 | dev_err(dsi->dev, "failed to set phy mode: %d\n", ret); |
|---|
| 1127 | 1129 | return; |
|---|
| .. | .. |
|---|
| 1150 | 1152 | } |
|---|
| 1151 | 1153 | |
|---|
| 1152 | 1154 | static void rk628_dsi_bridge_mode_set(struct drm_bridge *bridge, |
|---|
| 1153 | | - struct drm_display_mode *mode, |
|---|
| 1154 | | - struct drm_display_mode *adj) |
|---|
| 1155 | + const struct drm_display_mode *mode, |
|---|
| 1156 | + const struct drm_display_mode *adj) |
|---|
| 1155 | 1157 | { |
|---|
| 1156 | 1158 | struct rk628_dsi *dsi = bridge_to_dsi(bridge); |
|---|
| 1157 | 1159 | |
|---|
| .. | .. |
|---|
| 1162 | 1164 | } |
|---|
| 1163 | 1165 | } |
|---|
| 1164 | 1166 | |
|---|
| 1165 | | -static int rk628_dsi_bridge_attach(struct drm_bridge *bridge) |
|---|
| 1167 | +static int rk628_dsi_bridge_attach(struct drm_bridge *bridge, |
|---|
| 1168 | + enum drm_bridge_attach_flags flags) |
|---|
| 1166 | 1169 | { |
|---|
| 1167 | 1170 | struct rk628_dsi *dsi = bridge_to_dsi(bridge); |
|---|
| 1168 | 1171 | struct drm_connector *connector = &dsi->connector; |
|---|
| .. | .. |
|---|
| 1171 | 1174 | |
|---|
| 1172 | 1175 | if (!dsi->panel) |
|---|
| 1173 | 1176 | return -EPROBE_DEFER; |
|---|
| 1177 | + |
|---|
| 1178 | + if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) |
|---|
| 1179 | + return 0; |
|---|
| 1174 | 1180 | |
|---|
| 1175 | 1181 | ret = drm_connector_init(drm, connector, &rk628_dsi_connector_funcs, |
|---|
| 1176 | 1182 | DRM_MODE_CONNECTOR_DSI); |
|---|
| .. | .. |
|---|
| 1181 | 1187 | |
|---|
| 1182 | 1188 | drm_connector_helper_add(connector, &rk628_dsi_connector_helper_funcs); |
|---|
| 1183 | 1189 | 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 | 1190 | |
|---|
| 1191 | 1191 | return 0; |
|---|
| 1192 | 1192 | } |
|---|