@@ -423,25 +423,38 @@ static enum drm_mode_status dsi_mgr_bridge_mode_valid(struct drm_bridge *bridge,
423
423
return msm_dsi_host_check_dsc (host , mode );
424
424
}
425
425
426
+ static int dsi_mgr_bridge_attach (struct drm_bridge * bridge ,
427
+ enum drm_bridge_attach_flags flags )
428
+ {
429
+ int id = dsi_mgr_bridge_get_id (bridge );
430
+ struct msm_dsi * msm_dsi = dsi_mgr_get_dsi (id );
431
+
432
+ return drm_bridge_attach (bridge -> encoder , msm_dsi -> next_bridge ,
433
+ bridge , flags );
434
+ }
435
+
426
436
static const struct drm_bridge_funcs dsi_mgr_bridge_funcs = {
437
+ .attach = dsi_mgr_bridge_attach ,
427
438
.pre_enable = dsi_mgr_bridge_pre_enable ,
428
439
.post_disable = dsi_mgr_bridge_post_disable ,
429
440
.mode_set = dsi_mgr_bridge_mode_set ,
430
441
.mode_valid = dsi_mgr_bridge_mode_valid ,
431
442
};
432
443
433
444
/* initialize bridge */
434
- struct drm_bridge * msm_dsi_manager_bridge_init (struct msm_dsi * msm_dsi ,
435
- struct drm_encoder * encoder )
445
+ int msm_dsi_manager_connector_init (struct msm_dsi * msm_dsi ,
446
+ struct drm_encoder * encoder )
436
447
{
448
+ struct drm_device * dev = msm_dsi -> dev ;
437
449
struct drm_bridge * bridge ;
438
450
struct dsi_bridge * dsi_bridge ;
451
+ struct drm_connector * connector ;
439
452
int ret ;
440
453
441
454
dsi_bridge = devm_kzalloc (msm_dsi -> dev -> dev ,
442
455
sizeof (* dsi_bridge ), GFP_KERNEL );
443
456
if (!dsi_bridge )
444
- return ERR_PTR ( - ENOMEM ) ;
457
+ return - ENOMEM ;
445
458
446
459
dsi_bridge -> id = msm_dsi -> id ;
447
460
@@ -450,27 +463,9 @@ struct drm_bridge *msm_dsi_manager_bridge_init(struct msm_dsi *msm_dsi,
450
463
451
464
ret = devm_drm_bridge_add (msm_dsi -> dev -> dev , bridge );
452
465
if (ret )
453
- return ERR_PTR (ret );
454
-
455
- ret = drm_bridge_attach (encoder , bridge , NULL , 0 );
456
- if (ret )
457
- return ERR_PTR (ret );
458
-
459
- return bridge ;
460
- }
461
-
462
- int msm_dsi_manager_ext_bridge_init (u8 id , struct drm_bridge * int_bridge )
463
- {
464
- struct msm_dsi * msm_dsi = dsi_mgr_get_dsi (id );
465
- struct drm_device * dev = msm_dsi -> dev ;
466
- struct drm_encoder * encoder ;
467
- struct drm_connector * connector ;
468
- int ret ;
469
-
470
- encoder = int_bridge -> encoder ;
466
+ return ret ;
471
467
472
- ret = drm_bridge_attach (encoder , msm_dsi -> next_bridge , int_bridge ,
473
- DRM_BRIDGE_ATTACH_NO_CONNECTOR );
468
+ ret = drm_bridge_attach (encoder , bridge , NULL , DRM_BRIDGE_ATTACH_NO_CONNECTOR );
474
469
if (ret )
475
470
return ret ;
476
471
0 commit comments