@@ -72,11 +72,12 @@ static int dsi_mgr_parse_dual_dsi(struct device_node *np, int id)
72
72
return 0 ;
73
73
}
74
74
75
- static int dsi_mgr_host_register (int id )
75
+ static int dsi_mgr_setup_components (int id )
76
76
{
77
77
struct msm_dsi * msm_dsi = dsi_mgr_get_dsi (id );
78
78
struct msm_dsi * other_dsi = dsi_mgr_get_other_dsi (id );
79
79
struct msm_dsi * clk_master_dsi = dsi_mgr_get_dsi (DSI_CLOCK_MASTER );
80
+ struct msm_dsi * clk_slave_dsi = dsi_mgr_get_dsi (DSI_CLOCK_SLAVE );
80
81
struct msm_dsi_pll * src_pll ;
81
82
int ret ;
82
83
@@ -85,30 +86,35 @@ static int dsi_mgr_host_register(int id)
85
86
if (ret )
86
87
return ret ;
87
88
89
+ msm_dsi_phy_set_usecase (msm_dsi -> phy , MSM_DSI_PHY_STANDALONE );
88
90
src_pll = msm_dsi_phy_get_pll (msm_dsi -> phy );
89
91
ret = msm_dsi_host_set_src_pll (msm_dsi -> host , src_pll );
90
92
} else if (!other_dsi ) {
91
93
ret = 0 ;
92
94
} else {
93
- struct msm_dsi * mdsi = IS_MASTER_DSI_LINK (id ) ?
94
- msm_dsi : other_dsi ;
95
- struct msm_dsi * sdsi = IS_MASTER_DSI_LINK (id ) ?
96
- other_dsi : msm_dsi ;
95
+ struct msm_dsi * master_link_dsi = IS_MASTER_DSI_LINK (id ) ?
96
+ msm_dsi : other_dsi ;
97
+ struct msm_dsi * slave_link_dsi = IS_MASTER_DSI_LINK (id ) ?
98
+ other_dsi : msm_dsi ;
97
99
/* Register slave host first, so that slave DSI device
98
100
* has a chance to probe, and do not block the master
99
101
* DSI device's probe.
100
102
* Also, do not check defer for the slave host,
101
103
* because only master DSI device adds the panel to global
102
104
* panel list. The panel's device is the master DSI device.
103
105
*/
104
- ret = msm_dsi_host_register (sdsi -> host , false);
106
+ ret = msm_dsi_host_register (slave_link_dsi -> host , false);
105
107
if (ret )
106
108
return ret ;
107
- ret = msm_dsi_host_register (mdsi -> host , true);
109
+ ret = msm_dsi_host_register (master_link_dsi -> host , true);
108
110
if (ret )
109
111
return ret ;
110
112
111
113
/* PLL0 is to drive both 2 DSI link clocks in Dual DSI mode. */
114
+ msm_dsi_phy_set_usecase (clk_master_dsi -> phy ,
115
+ MSM_DSI_PHY_MASTER );
116
+ msm_dsi_phy_set_usecase (clk_slave_dsi -> phy ,
117
+ MSM_DSI_PHY_SLAVE );
112
118
src_pll = msm_dsi_phy_get_pll (clk_master_dsi -> phy );
113
119
ret = msm_dsi_host_set_src_pll (msm_dsi -> host , src_pll );
114
120
if (ret )
@@ -665,28 +671,12 @@ int msm_dsi_manager_phy_enable(int id,
665
671
struct msm_dsi * msm_dsi = dsi_mgr_get_dsi (id );
666
672
struct msm_dsi_phy * phy = msm_dsi -> phy ;
667
673
int src_pll_id = IS_DUAL_DSI () ? DSI_CLOCK_MASTER : id ;
668
- struct msm_dsi_pll * pll = msm_dsi_phy_get_pll (msm_dsi -> phy );
669
674
int ret ;
670
675
671
676
ret = msm_dsi_phy_enable (phy , src_pll_id , bit_rate , esc_rate );
672
677
if (ret )
673
678
return ret ;
674
679
675
- /*
676
- * Reset DSI PHY silently changes its PLL registers to reset status,
677
- * which will confuse clock driver and result in wrong output rate of
678
- * link clocks. Restore PLL status if its PLL is being used as clock
679
- * source.
680
- */
681
- if (!IS_DUAL_DSI () || (id == DSI_CLOCK_MASTER )) {
682
- ret = msm_dsi_pll_restore_state (pll );
683
- if (ret ) {
684
- pr_err ("%s: failed to restore pll state\n" , __func__ );
685
- msm_dsi_phy_disable (phy );
686
- return ret ;
687
- }
688
- }
689
-
690
680
msm_dsi -> phy_enabled = true;
691
681
msm_dsi_phy_get_shared_timings (phy , shared_timings );
692
682
@@ -699,11 +689,6 @@ void msm_dsi_manager_phy_disable(int id)
699
689
struct msm_dsi * mdsi = dsi_mgr_get_dsi (DSI_CLOCK_MASTER );
700
690
struct msm_dsi * sdsi = dsi_mgr_get_dsi (DSI_CLOCK_SLAVE );
701
691
struct msm_dsi_phy * phy = msm_dsi -> phy ;
702
- struct msm_dsi_pll * pll = msm_dsi_phy_get_pll (msm_dsi -> phy );
703
-
704
- /* Save PLL status if it is a clock source */
705
- if (!IS_DUAL_DSI () || (id == DSI_CLOCK_MASTER ))
706
- msm_dsi_pll_save_state (pll );
707
692
708
693
/* disable DSI phy
709
694
* In dual-dsi configuration, the phy should be disabled for the
@@ -834,7 +819,7 @@ int msm_dsi_manager_register(struct msm_dsi *msm_dsi)
834
819
goto fail ;
835
820
}
836
821
837
- ret = dsi_mgr_host_register (id );
822
+ ret = dsi_mgr_setup_components (id );
838
823
if (ret ) {
839
824
pr_err ("%s: failed to register mipi dsi host for DSI %d\n" ,
840
825
__func__ , id );
0 commit comments