ptp: ptp_clockmatrix: Add wait_for_sys_apll_dpll_lock.
authorVincent Cheng <vincent.cheng.xh@renesas.com>
Wed, 17 Feb 2021 05:42:12 +0000 (00:42 -0500)
committerDavid S. Miller <davem@davemloft.net>
Wed, 17 Feb 2021 21:49:25 +0000 (13:49 -0800)
commit797d3186544fcd5bfd7a03b9ef3e20c1db3802b8
treee6e42ecdfd4a9c36826d3d68b201f081be2cfce4
parent857490807368026116a16306ab89e9b71cad60ab
ptp: ptp_clockmatrix: Add wait_for_sys_apll_dpll_lock.

Part of the device initialization aligns the rising edge of the output
clock to the internal 1 PPS clock. If the system APLL and DPLL is not
locked, then the alignment will fail and there will be a fixed offset
between the internal 1 PPS clock and the output clock.

After loading the device firmware, poll the system APLL and DPLL for
locked state prior to initialization, timing out after 2 seconds.

Signed-off-by: Vincent Cheng <vincent.cheng.xh@renesas.com>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/ptp/idt8a340_reg.h
drivers/ptp/ptp_clockmatrix.c
drivers/ptp/ptp_clockmatrix.h