Skip to content

Commit b125118

Browse files
Min LiNipaLocal
authored andcommitted
ptp: clockmatrix: set write phase timer to 0 when not in PCW mode
In order for phase pull-in to work, write phase timer shall be 0 when not in write phase mode. Signed-off-by: Min Li <min.li.xe@renesas.com> Signed-off-by: NipaLocal <nipa@local>
1 parent 0911849 commit b125118

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

drivers/ptp/ptp_clockmatrix.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1396,6 +1396,20 @@ static int idtcm_set_pll_mode(struct idtcm_channel *channel,
13961396
struct idtcm *idtcm = channel->idtcm;
13971397
int err;
13981398
u8 dpll_mode;
1399+
u8 timeout = 0;
1400+
1401+
/* Setup WF/WP timer for phase pull-in to work correctly */
1402+
err = idtcm_write(idtcm, channel->dpll_n, DPLL_WF_TIMER,
1403+
&timeout, sizeof(timeout));
1404+
if (err)
1405+
return err;
1406+
1407+
if (mode == PLL_MODE_WRITE_PHASE)
1408+
timeout = 160;
1409+
err = idtcm_write(idtcm, channel->dpll_n, DPLL_WP_TIMER,
1410+
&timeout, sizeof(timeout));
1411+
if (err)
1412+
return err;
13991413

14001414
err = idtcm_read(idtcm, channel->dpll_n,
14011415
IDTCM_FW_REG(idtcm->fw_ver, V520, DPLL_MODE),

0 commit comments

Comments
 (0)