| .. | .. |
|---|
| 14 | 14 | #include <linux/phy/phy.h> |
|---|
| 15 | 15 | #include <linux/reset.h> |
|---|
| 16 | 16 | |
|---|
| 17 | | -#include <drm/drmP.h> |
|---|
| 18 | 17 | #include <drm/drm_of.h> |
|---|
| 19 | 18 | #include <drm/drm_atomic.h> |
|---|
| 20 | | -#include <drm/drm_crtc_helper.h> |
|---|
| 19 | +#include <drm/drm_probe_helper.h> |
|---|
| 21 | 20 | #include <drm/drm_atomic_helper.h> |
|---|
| 22 | 21 | #include <drm/drm_panel.h> |
|---|
| 23 | 22 | |
|---|
| .. | .. |
|---|
| 85 | 84 | { |
|---|
| 86 | 85 | struct rk628_rgb *rgb = connector_to_rgb(connector); |
|---|
| 87 | 86 | |
|---|
| 88 | | - return drm_panel_get_modes(rgb->panel); |
|---|
| 87 | + return drm_panel_get_modes(rgb->panel, connector); |
|---|
| 89 | 88 | } |
|---|
| 90 | 89 | |
|---|
| 91 | 90 | static const struct drm_connector_helper_funcs |
|---|
| .. | .. |
|---|
| 96 | 95 | |
|---|
| 97 | 96 | static void rk628_rgb_connector_destroy(struct drm_connector *connector) |
|---|
| 98 | 97 | { |
|---|
| 99 | | - struct rk628_rgb *rgb = connector_to_rgb(connector); |
|---|
| 100 | | - |
|---|
| 101 | | - drm_panel_detach(rgb->panel); |
|---|
| 102 | 98 | drm_connector_cleanup(connector); |
|---|
| 103 | 99 | } |
|---|
| 104 | 100 | |
|---|
| .. | .. |
|---|
| 229 | 225 | reset_control_assert(rgb->rstc); |
|---|
| 230 | 226 | } |
|---|
| 231 | 227 | |
|---|
| 232 | | -static int rk628_rgb_bridge_attach(struct drm_bridge *bridge) |
|---|
| 228 | +static int rk628_rgb_bridge_attach(struct drm_bridge *bridge, |
|---|
| 229 | + enum drm_bridge_attach_flags flags) |
|---|
| 233 | 230 | { |
|---|
| 234 | 231 | struct rk628_rgb *rgb = bridge_to_rgb(bridge); |
|---|
| 235 | 232 | struct drm_connector *connector = &rgb->connector; |
|---|
| .. | .. |
|---|
| 248 | 245 | return -EPROBE_DEFER; |
|---|
| 249 | 246 | } |
|---|
| 250 | 247 | |
|---|
| 251 | | - rgb->bridge->encoder = bridge->encoder; |
|---|
| 252 | | - ret = drm_bridge_attach(bridge->encoder, rgb->bridge, bridge); |
|---|
| 248 | + ret = drm_bridge_attach(bridge->encoder, rgb->bridge, bridge, |
|---|
| 249 | + flags); |
|---|
| 253 | 250 | if (ret) { |
|---|
| 254 | 251 | dev_err(dev, "failed to attach bridge\n"); |
|---|
| 255 | 252 | return ret; |
|---|
| 256 | 253 | } |
|---|
| 257 | | - |
|---|
| 258 | | - bridge->next = rgb->bridge; |
|---|
| 259 | 254 | } else { |
|---|
| 260 | 255 | if (rgb->bridge) { |
|---|
| 261 | | - rgb->bridge->encoder = bridge->encoder; |
|---|
| 262 | | - ret = drm_bridge_attach(bridge->encoder, rgb->bridge, bridge); |
|---|
| 256 | + ret = drm_bridge_attach(bridge->encoder, rgb->bridge, |
|---|
| 257 | + bridge, flags); |
|---|
| 263 | 258 | if (ret) { |
|---|
| 264 | 259 | dev_err(dev, "failed to attach bridge\n"); |
|---|
| 265 | 260 | return ret; |
|---|
| 266 | 261 | } |
|---|
| 267 | | - |
|---|
| 268 | | - bridge->next = rgb->bridge; |
|---|
| 269 | 262 | } |
|---|
| 263 | + |
|---|
| 264 | + if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) |
|---|
| 265 | + return 0; |
|---|
| 270 | 266 | |
|---|
| 271 | 267 | if (rgb->panel) { |
|---|
| 272 | 268 | ret = drm_connector_init(drm, connector, |
|---|
| .. | .. |
|---|
| 282 | 278 | &rk628_rgb_connector_helper_funcs); |
|---|
| 283 | 279 | drm_connector_attach_encoder(connector, |
|---|
| 284 | 280 | bridge->encoder); |
|---|
| 285 | | - ret = drm_panel_attach(rgb->panel, connector); |
|---|
| 286 | | - if (ret) { |
|---|
| 287 | | - dev_err(dev, "Failed to attach panel\n"); |
|---|
| 288 | | - return ret; |
|---|
| 289 | | - } |
|---|
| 290 | 281 | } |
|---|
| 291 | 282 | } |
|---|
| 292 | 283 | |
|---|
| .. | .. |
|---|
| 294 | 285 | } |
|---|
| 295 | 286 | |
|---|
| 296 | 287 | static void rk628_rgb_bridge_mode_set(struct drm_bridge *bridge, |
|---|
| 297 | | - struct drm_display_mode *mode, |
|---|
| 298 | | - struct drm_display_mode *adj) |
|---|
| 288 | + const struct drm_display_mode *mode, |
|---|
| 289 | + const struct drm_display_mode *adj) |
|---|
| 299 | 290 | { |
|---|
| 300 | 291 | struct rk628_rgb *rgb = bridge_to_rgb(bridge); |
|---|
| 301 | 292 | |
|---|