@@ -110,14 +110,13 @@ static struct dsi_pll_14nm *pll_14nm_list[DSI_MAX];
110
110
static bool pll_14nm_poll_for_ready (struct dsi_pll_14nm * pll_14nm ,
111
111
u32 nb_tries , u32 timeout_us )
112
112
{
113
- bool pll_locked = false;
113
+ bool pll_locked = false, pll_ready = false ;
114
114
void __iomem * base = pll_14nm -> phy -> pll_base ;
115
115
u32 tries , val ;
116
116
117
117
tries = nb_tries ;
118
118
while (tries -- ) {
119
- val = dsi_phy_read (base +
120
- REG_DSI_14nm_PHY_PLL_RESET_SM_READY_STATUS );
119
+ val = dsi_phy_read (base + REG_DSI_14nm_PHY_PLL_RESET_SM_READY_STATUS );
121
120
pll_locked = !!(val & BIT (5 ));
122
121
123
122
if (pll_locked )
@@ -126,23 +125,24 @@ static bool pll_14nm_poll_for_ready(struct dsi_pll_14nm *pll_14nm,
126
125
udelay (timeout_us );
127
126
}
128
127
129
- if (!pll_locked ) {
130
- tries = nb_tries ;
131
- while (tries -- ) {
132
- val = dsi_phy_read (base +
133
- REG_DSI_14nm_PHY_PLL_RESET_SM_READY_STATUS );
134
- pll_locked = !!(val & BIT (0 ));
128
+ if (!pll_locked )
129
+ goto out ;
135
130
136
- if (pll_locked )
137
- break ;
131
+ tries = nb_tries ;
132
+ while (tries -- ) {
133
+ val = dsi_phy_read (base + REG_DSI_14nm_PHY_PLL_RESET_SM_READY_STATUS );
134
+ pll_ready = !!(val & BIT (0 ));
138
135
139
- udelay (timeout_us );
140
- }
136
+ if (pll_ready )
137
+ break ;
138
+
139
+ udelay (timeout_us );
141
140
}
142
141
143
- DBG ("DSI PLL is %slocked" , pll_locked ? "" : "*not* " );
142
+ out :
143
+ DBG ("DSI PLL is %slocked, %sready" , pll_locked ? "" : "*not* " , pll_ready ? "" : "*not* " );
144
144
145
- return pll_locked ;
145
+ return pll_locked && pll_ready ;
146
146
}
147
147
148
148
static void dsi_pll_14nm_config_init (struct dsi_pll_config * pconf )
0 commit comments