Message ID | 1613104725-22056-3-git-send-email-vincent.cheng.xh@renesas.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | ptp: ptp_clockmatrix: Fix output 1 PPS alignment. | expand |
Context | Check | Description |
---|---|---|
netdev/cover_letter | success | Link |
netdev/fixes_present | success | Link |
netdev/patch_count | success | Link |
netdev/tree_selection | success | Clearly marked for net-next |
netdev/subject_prefix | success | Link |
netdev/cc_maintainers | success | CCed 2 of 2 maintainers |
netdev/source_inline | success | Was 0 now: 0 |
netdev/verify_signedoff | success | Link |
netdev/module_param | success | Was 0 now: 0 |
netdev/build_32bit | success | Errors and warnings before: 1 this patch: 1 |
netdev/kdoc | success | Errors and warnings before: 2 this patch: 2 |
netdev/verify_fixes | success | Link |
netdev/checkpatch | success | total: 0 errors, 0 warnings, 0 checks, 26 lines checked |
netdev/build_allmodconfig_warn | success | Errors and warnings before: 1 this patch: 1 |
netdev/header_inline | success | Link |
netdev/stable | success | Stable not CCed |
On Thu, Feb 11, 2021 at 11:38:45PM -0500, vincent.cheng.xh@renesas.com wrote: > From: Vincent Cheng <vincent.cheng.xh@renesas.com> > > When enabling output using PTP_CLK_REQ_PEROUT, need to align the output > clock to the internal 1 PPS clock. > > Signed-off-by: Vincent Cheng <vincent.cheng.xh@renesas.com> Acked-by: Richard Cochran <richardcochran@gmail.com>
diff --git a/drivers/ptp/ptp_clockmatrix.c b/drivers/ptp/ptp_clockmatrix.c index 1918de5..ebe540e 100644 --- a/drivers/ptp/ptp_clockmatrix.c +++ b/drivers/ptp/ptp_clockmatrix.c @@ -1401,13 +1401,23 @@ static int idtcm_perout_enable(struct idtcm_channel *channel, bool enable, struct ptp_perout_request *perout) { + struct idtcm *idtcm = channel->idtcm; unsigned int flags = perout->flags; + struct timespec64 ts = {0, 0}; + int err; if (flags == PEROUT_ENABLE_OUTPUT_MASK) - return idtcm_output_mask_enable(channel, enable); + err = idtcm_output_mask_enable(channel, enable); + else + err = idtcm_output_enable(channel, enable, perout->index); + + if (err) { + dev_err(&idtcm->client->dev, "Unable to set output enable"); + return err; + } - /* Enable/disable individual output instead */ - return idtcm_output_enable(channel, enable, perout->index); + /* Align output to internal 1 PPS */ + return _idtcm_settime(channel, &ts, SCSR_TOD_WR_TYPE_SEL_DELTA_PLUS); } static int idtcm_get_pll_mode(struct idtcm_channel *channel,