Article View: linux.kernel.netdev
Article #25533[PATCH net-next v17 11/13] dpll: sit9531x: add support to adjust output phase
From: Ali Rouhi
Date: Tue, 01 Dec 2026 23:52
Date: Tue, 01 Dec 2026 23:52
1528 lines
73679 bytes
73679 bytes
From: Oleg Zadorozhnyi <Oleg.Zadorozhnyi@devoxsoftware.com>
Shift an output in time against the other outputs of its PLL. A delay is
a coarse count of VCO cycles plus a 3-bit fine field in 30 ps steps, so
the grid depends on the PLL's rate; the driver programs the nearest
point and the getter reports what the registers hold.
The range advertised to the core, +/-1 ms at 1 ps granularity, bounds a
request, not the delay the registers hold. An advance is held as the
complementary positive delay within the output period, and a stored
delay is reported in the form nearer to zero. A delay alone takes a
small-change update and is applied by the PLL's phase flush, or by a PLL
restart where the configuration has the flush off; both restart the
divider phase of the PLL's outputs. A rate change encodes the delay
again for the new period, in the divider's programming window.
The poll and removal apply a delay waiting for its re-time or update and
finish a flush left partly done. A waiting delay, or Fref * DIVN outside
the PLL's VCO band, has no value and the core leaves the attribute out;
a delay whose flush is pending is reported.
Suggested-by: Ivan Vecera <ivecera@redhat.com>
Signed-off-by: Oleg Zadorozhnyi <Oleg.Zadorozhnyi@devoxsoftware.com>
Co-developed-by: Ali Rouhi <arouhi@sitime.com>
Signed-off-by: Ali Rouhi <arouhi@sitime.com>
---
drivers/dpll/sit9531x/core.c | 862 ++++++++++++++++++++++++++++++++---
drivers/dpll/sit9531x/core.h | 35 ++
drivers/dpll/sit9531x/dpll.c | 130 +++++-
drivers/dpll/sit9531x/prop.c | 16 +
drivers/dpll/sit9531x/regs.h | 29 ++
5 files changed, 1009 insertions(+), 63 deletions(-)
diff --git a/drivers/dpll/sit9531x/core.c b/drivers/dpll/sit9531x/core.c
index 3316e3761e16..96d317c9bf37 100644
--- a/drivers/dpll/sit9531x/core.c
+++ b/drivers/dpll/sit9531x/core.c
@@ -246,6 +246,23 @@ static int sit9531x_write_pll_close(struct sit9531x_dev *sitdev, u8 pll_idx,
offset), val);
}
+static int sit9531x_update_pll_close(struct sit9531x_dev *sitdev, u8 pll_idx,
+ u8 offset, u8 mask, u8 val)
+{
+ u8 attempt;
+ int rc;
+
+ for (attempt = 0; attempt < SIT9531X_CLOSE_TRIES; attempt++) {
+ if (attempt)
+ usleep_range(1000, 2000);
+ rc = sit9531x_update_pll_u8(sitdev, pll_idx, offset, mask, val);
+ if (!rc)
+ break;
+ }
+
+ return rc;
+}
+
static void sit9531x_input_get_regs(const struct sit9531x_dev *sitdev,
u8 index,
unsigned int *force_reg,
@@ -1683,6 +1700,72 @@ static int sit9531x_pll_small_update(struct sit9531x_dev *sitdev, u8 pll_idx)
SIT9531X_SMALL_UPDATE_CMD);
}
+static int sit9531x_pll_small_update_close(struct sit9531x_dev *sitdev,
+ u8 pll_idx)
+{
+ return sit9531x_write_pll_close(sitdev, pll_idx,
+ SIT9531X_PLL_REG_SMALL_UPDATE,
+ SIT9531X_SMALL_UPDATE_CMD);
+}
+
+/*
+ * Undo a phase flush: restore the trigger select and the flush enable of @plls
+ * from @armed.
+ */
+static int sit9531x_phase_flush_undo(struct sit9531x_dev *sitdev,
+ bool ctrl_back, u8 ctrl, u8 plls, u8 armed)
+{
+ const u8 en = SIT9531X_PLL_PHFL_ON_DEMAND_EN;
+ int rc = 0, ret;
+ u8 i;
+
+ if (ctrl_back) {
+ rc = sit9531x_write_close(sitdev, SIT9531X_REG_GPIO_FUNC_CTRL1,
+ ctrl);
+ sitdev->flush_ctrl_pending = !!rc;
+ sitdev->flush_ctrl = ctrl;
+ /* Re-arm after the select is back; the trigger may stay set */
+ if (rc) {
+ sitdev->flush_arm_pending |= plls;
+ sitdev->flush_armed &= ~plls;
+ sitdev->flush_armed |= armed & plls;
+ return rc;
+ }
+ }
+
+ for (i = 0; i < SIT9531X_NUM_PLLS; i++) {
+ if (!(plls & BIT(i)))
+ continue;
+ ret = sit9531x_update_pll_close(sitdev, i,
+ SIT9531X_PLL_REG_PHFL_CTRL, en,
+ (armed & BIT(i)) ? en : 0);
+ if (!ret)
+ ret = sit9531x_pll_small_update_close(sitdev, i);
+ if (ret) {
+ sitdev->flush_arm_pending |= BIT(i);
+ sitdev->flush_armed &= ~BIT(i);
+ sitdev->flush_armed |= armed & BIT(i);
+ if (!rc)
+ rc = ret;
+ } else {
+ sitdev->flush_arm_pending &= ~BIT(i);
+ }
+ }
+
+ return rc;
+}
+
+static int sit9531x_phase_flush_undo_retry(struct sit9531x_dev *sitdev)
+{
+ if (!sitdev->flush_ctrl_pending && !sitdev->flush_arm_pending)
+ return 0;
+
+ return sit9531x_phase_flush_undo(sitdev, sitdev->flush_ctrl_pending,
+ sitdev->flush_ctrl,
+ sitdev->flush_arm_pending,
+ sitdev->flush_armed);
+}
+
/*
* Realign the PLL's output dividers with the on-demand phase flush (PHFL), or
* restart the PLL when its profile has PHFL off (PLL page 0x47 bit 7 clear), as
@@ -1691,24 +1774,36 @@ static int sit9531x_pll_small_update(struct sit9531x_dev *sitdev, u8 pll_idx)
*/
static int sit9531x_output_phase_flush(struct sit9531x_dev *sitdev, u8 pll_idx)
{
- u8 ctrl, orig, phfl, armed_mask = 0, parked = 0, i;
+ u8 ctrl, orig = 0, phfl, armed_mask = 0, parked = 0, touched, i;
+ bool ctrl_back = false, armed_here = false, fired = false;
int rc, ret;
+ /*
+ * Retry a pending undo first so the reads below see the profile's
+ * settings.
+ */
+ rc = sit9531x_phase_flush_undo_retry(sitdev);
+ if (rc)
+ goto out;
+
rc = sit9531x_read_pll_u8(sitdev, pll_idx, SIT9531X_PLL_REG_CONFIG47,
&phfl);
if (rc)
- return rc;
- if (!(phfl & SIT9531X_PLL_CONFIG47_PHFL_EN))
- return sit9531x_write_pll_u8(sitdev, pll_idx,
- SIT9531X_PLL_REG_DIRECTIVES,
- SIT9531X_PLL_DIRECTIVE_RESTART);
+ goto out;
+ if (!(phfl & SIT9531X_PLL_CONFIG47_PHFL_EN)) {
+ rc = sit9531x_write_pll_u8(sitdev, pll_idx,
+ SIT9531X_PLL_REG_DIRECTIVES,
+ SIT9531X_PLL_DIRECTIVE_RESTART);
+ fired = !rc;
+ goto out;
+ }
/* Only the target PLL keeps on-demand flush enabled for the pulse. */
for (i = 0; i < SIT9531X_NUM_PLLS; i++) {
rc = sit9531x_read_pll_u8(sitdev, i, SIT9531X_PLL_REG_PHFL_CTRL,
&phfl);
if (rc)
- return rc;
+ goto out;
if (phfl & SIT9531X_PLL_PHFL_ON_DEMAND_EN)
armed_mask |= BIT(i);
}
@@ -1721,18 +1816,19 @@ static int sit9531x_output_phase_flush(struct sit9531x_dev *sitdev, u8 pll_idx)
SIT9531X_PLL_REG_PHFL_CTRL,
SIT9531X_PLL_PHFL_ON_DEMAND_EN, 0);
if (rc)
- goto unpark;
+ goto undo;
rc = sit9531x_pll_small_update(sitdev, i);
if (rc)
- goto unpark;
+ goto undo;
}
+ armed_here = true;
rc = sit9531x_update_pll_u8(sitdev, pll_idx,
SIT9531X_PLL_REG_PHFL_CTRL,
SIT9531X_PLL_PHFL_ON_DEMAND_EN,
SIT9531X_PLL_PHFL_ON_DEMAND_EN);
if (rc)
- goto disarm;
+ goto undo;
/*
* Write the update register whole; a read-modify-write skips the write
@@ -1740,21 +1836,19 @@ static int sit9531x_output_phase_flush(struct sit9531x_dev *sitdev, u8 pll_idx)
*/
rc = sit9531x_pll_small_update(sitdev, pll_idx);
if (rc)
- goto disarm;
+ goto undo;
- /*
- * Select the in-register phase trigger; the register also holds the OEb
- * bits.
- */
+ /* Select the in-register phase trigger, preserving the OEb bits. */
rc = sit9531x_read_u8(sitdev, SIT9531X_REG_GPIO_FUNC_CTRL1, &ctrl);
if (rc)
- goto disarm;
+ goto undo;
orig = ctrl & ~SIT9531X_DIVO_PHASE_TRIG;
ctrl = orig | SIT9531X_DIVO_PHASE_SEL_REG;
+ ctrl_back = true;
rc = sit9531x_write_u8(sitdev, SIT9531X_REG_GPIO_FUNC_CTRL1, ctrl);
if (rc)
- goto restore;
+ goto undo;
/*
* No delay between set and clear; one I2C transfer is longer than the
@@ -1763,47 +1857,26 @@ static int sit9531x_output_phase_flush(struct sit9531x_dev *sitdev, u8 pll_idx)
rc = sit9531x_write_u8(sitdev, SIT9531X_REG_GPIO_FUNC_CTRL1,
ctrl | SIT9531X_DIVO_PHASE_TRIG);
if (rc)
- goto restore;
+ goto undo;
/*
* Clear the trigger with the register trigger still selected, as
- * Dely_program_output.py does; the select goes back after it.
+ * Dely_program_output.py does; the select goes back in the undo.
*/
rc = sit9531x_write_close(sitdev, SIT9531X_REG_GPIO_FUNC_CTRL1, ctrl);
-
-restore:
- ret = sit9531x_write_u8(sitdev, SIT9531X_REG_GPIO_FUNC_CTRL1, orig);
+ fired = !rc;
+
+undo:
+ touched = parked;
+ if (armed_here && !(armed_mask & BIT(pll_idx)))
+ touched |= BIT(pll_idx);
+ ret = sit9531x_phase_flush_undo(sitdev, ctrl_back, orig, touched,
+ armed_mask);
if (ret && !rc)
rc = ret;
-disarm:
- /*
- * Restore the profile's flush enable; an armed flush re-flushes every
- * output divider of this PLL on the next trigger.
- */
- if (!(armed_mask & BIT(pll_idx))) {
- ret = sit9531x_update_pll_u8(sitdev, pll_idx,
- SIT9531X_PLL_REG_PHFL_CTRL,
- SIT9531X_PLL_PHFL_ON_DEMAND_EN, 0);
- if (!ret)
- ret = sit9531x_pll_small_update(sitdev, pll_idx);
- if (ret && !rc)
- rc = ret;
- }
-
-unpark:
- for (i = 0; i < SIT9531X_NUM_PLLS; i++) {
- if (!(parked & BIT(i)))
- continue;
- ret = sit9531x_update_pll_u8(sitdev, i,
- SIT9531X_PLL_REG_PHFL_CTRL,
- SIT9531X_PLL_PHFL_ON_DEMAND_EN,
- SIT9531X_PLL_PHFL_ON_DEMAND_EN);
- if (!ret)
- ret = sit9531x_pll_small_update(sitdev, i);
- if (ret && !rc)
- rc = ret;
- }
+out:
+ sitdev->chan[pll_idx].flush_pending = !fired;
return rc;
}
@@ -1877,7 +1950,7 @@ static int sit9531x_output_divo_write(struct sit9531x_dev *sitdev, u8 out_idx,
int rc, j, rb_rc;
u8 written = 0;
- *back = false;
+ *back = true;
slot = info->clkout_map[out_idx];
@@ -1904,6 +1977,7 @@ static int sit9531x_output_divo_write(struct sit9531x_dev *sitdev, u8 out_idx,
msb_old = old_bytes[4];
divo_bytes[4] |= msb_old & 0xFC;
+ *back = false;
for (j = 0; j < 5; j++) {
rc = sit9531x_write_u8(sitdev,
SIT9531X_REG(page, base_reg - j),
@@ -1962,12 +2036,361 @@ static int sit9531x_output_divo_read(struct sit9531x_dev *sitdev, u8 out_idx,
return *divo ? 0 : -ENODATA;
}
+/*
+ * Phase adjust is a 34-bit coarse delay in VCO cycles plus a 3-bit fine delay
+ * in 30 ps steps, in bytes PROG6..PROG2. PRG_RST_DELAY is unsigned, so an
+ * advance is written as T_out - |phase|.
+ */
+
+/* Register of byte @i (PROG6 first) of an output's PRG_RST_DELAY block. */
+static unsigned int sit9531x_output_prg_reg(struct sit9531x_dev *sitdev,
+ u8 out_idx, u8 i)
+{
+ u8 slot = sitdev->info->clkout_map[out_idx];
+ u8 page = (slot > SIT9531X_PAGE_OUTSYS0_SLOT_MAX) ?
+ SIT9531X_PAGE_OUTSYS1 : SIT9531X_PAGE_OUTSYS0;
+ u8 base = SIT9531X_OUT_PRG_DELAY_BASE +
+ SIT9531X_OUT_PRG_SLOT_STRIDE * (slot % 6);
+
+ return SIT9531X_REG(page, base + i);
+}
+
+static int sit9531x_output_phase_bytes_read(struct sit9531x_dev *sitdev,
+ u8 out_idx, u8 *bytes)
+{
+ unsigned int reg;
+ int rc;
+ u8 i;
+
+ for (i = 0; i < SIT9531X_OUT_PRG_BYTES; i++) {
+ reg = sit9531x_output_prg_reg(sitdev, out_idx, i);
+ rc = sit9531x_read_u8(sitdev, reg, &bytes[i]);
+ if (rc)
+ return rc;
+ }
+
+ return 0;
+}
+
+/*
+ * The register value includes the divider's settling cycles; a value below them
+ * means no delay.
+ */
+static void sit9531x_output_phase_bytes_decode(const u8 *bytes, u64 *coarse,
+ u8 *fine)
+{
+ u64 prg_coarse;
+
+ *fine = (bytes[0] & SIT9531X_OUT_PRG_FINE_MASK) >>
+ SIT9531X_OUT_PRG_FINE_SHIFT;
+ prg_coarse = (u64)(bytes[0] & SIT9531X_OUT_PRG_COARSE_HI_MASK) << 32;
+ prg_coarse |= (u64)bytes[1] << 24;
+ prg_coarse |= (u64)bytes[2] << 16;
+ prg_coarse |= (u64)bytes[3] << 8;
+ prg_coarse |= bytes[4];
+ *coarse = (prg_coarse > SIT9531X_OUT_PRG_DIVO_CYCLES) ?
+ prg_coarse - SIT9531X_OUT_PRG_DIVO_CYCLES : 0;
+}
+
+/*
+ * @coarse excludes the divider's two settling cycles; the register value
+ * includes them.
+ */
+static void sit9531x_output_phase_bytes_build(const u8 *old_bytes, u64 coarse,
+ u8 fine, u8 *new_bytes)
+{
+ u64 prg_coarse = coarse + SIT9531X_OUT_PRG_DIVO_CYCLES;
+
+ /* PROG6 RMW: preserve OPSTG_VCASC_BUMP in [7:5] */
+ new_bytes[0] = old_bytes[0] & SIT9531X_OUT_PRG_OPSTG_MASK;
+ new_bytes[0] |= (fine << SIT9531X_OUT_PRG_FINE_SHIFT) &
+ SIT9531X_OUT_PRG_FINE_MASK;
+ new_bytes[0] |= (u8)((prg_coarse >> 32) &
+ SIT9531X_OUT_PRG_COARSE_HI_MASK);
+ new_bytes[1] = (u8)((prg_coarse >> 24) & 0xFF);
+ new_bytes[2] = (u8)((prg_coarse >> 16) & 0xFF);
+ new_bytes[3] = (u8)((prg_coarse >> 8) & 0xFF);
+ new_bytes[4] = (u8)(prg_coarse & 0xFF);
+}
+
+/*
+ * Caller must hold the debug window open; @back reports whether every byte
+ * holds its old value.
+ */
+static int sit9531x_output_phase_bytes_write(struct sit9531x_dev *sitdev,
+ u8 out_idx, const u8 *new_bytes,
+ const u8 *old_bytes, bool *back)
+{
+ int rc, ret, rb_rc = 0;
+ unsigned int reg;
+ u8 i;
+
+ *back = false;
+
+ for (i = 0; i < SIT9531X_OUT_PRG_BYTES; i++) {
+ reg = sit9531x_output_prg_reg(sitdev, out_idx, i);
+ rc = sit9531x_write_u8(sitdev, reg, new_bytes[i]);
+ if (rc)
+ goto rollback;
+ }
+
+ return 0;
+
+rollback:
+ for (i = 0; i < SIT9531X_OUT_PRG_BYTES; i++) {
+ reg = sit9531x_output_prg_reg(sitdev, out_idx, i);
+ ret = sit9531x_write_u8(sitdev, reg, old_bytes[i]);
+ if (ret && !rb_rc)
+ rb_rc = ret;
+ }
+ *back = !rb_rc;
+ if (rb_rc) {
+ dev_err(sitdev->dev,
+ "out%u: phase-adjust rollback failed (%d), the delay registers are part old and part new\n",
+ out_idx, rb_rc);
+ if (!rc)
+ rc = rb_rc;
+ }
+
+ return rc;
+}
+
+/*
+ * Return the error of @cycles VCO cycles plus the nearest fine steps (in @fine)
+ * against @abs_ps.
+ */
+static u64 sit9531x_output_phase_quant_err(u64 abs_ps, u64 fvco, u64 cycles,
+ u8 *fine)
+{
+ u64 cycles_ps, steps = 0;
+
+ cycles_ps = mul_u64_u64_div_u64(cycles, 1000000000000ULL, fvco);
+ if (abs_ps > cycles_ps)
+ steps = div64_u64(abs_ps - cycles_ps +
+ SIT9531X_OUT_PRG_FINE_STEP_PS / 2,
+ SIT9531X_OUT_PRG_FINE_STEP_PS);
+ *fine = min_t(u64, steps, SIT9531X_OUT_PRG_FINE_MAX);
+
+ return abs_diff(abs_ps, cycles_ps +
+ (u64)*fine * SIT9531X_OUT_PRG_FINE_STEP_PS);
+}
+
+/*
+ * Fold @phase_ps into one output period and split it into VCO cycles and fine
+ * steps; @phase_adj gets the realized delay as the readback reports it. Pure
+ * arithmetic, so call it before entering the programming state.
+ */
+static int sit9531x_output_phase_encode(u64 fvco, u64 divo, s32 phase_ps,
+ u64 *coarse_out, u8 *fine_out,
+ s32 *phase_adj)
+{
+ u64 abs_ps, cycles, frac_ps, coarse = 0, coarse_ps, t_out_ps;
+ s64 phase_norm_ps = 0;
+ u8 fine = 0;
+
+ t_out_ps = mul_u64_u64_div_u64(divo, 1000000000000ULL, fvco);
+ if (!t_out_ps)
+ return -EINVAL;
+
+ if (!phase_ps) {
+ *coarse_out = 0;
+ *fine_out = 0;
+ *phase_adj = 0;
+ return 0;
+ }
+
+ /*
+ * The period is DIVO VCO cycles but often fractional in ps (7812.5 ps
+ * at 128 MHz from 5.12 GHz), so fold whole cycles modulo DIVO and carry
+ * the sub-cycle part. The DPLL core limits the request to +/-1 ms.
+ */
+ abs_ps = abs(phase_ps);
+ cycles = mul_u64_u64_div_u64(abs_ps, fvco, 1000000000000ULL);
+ frac_ps = abs_ps - mul_u64_u64_div_u64(cycles, 1000000000000ULL, fvco);
+ div64_u64_rem(cycles, divo, &cycles);
+ abs_ps = mul_u64_u64_div_u64(cycles, 1000000000000ULL, fvco) + frac_ps;
+ /*
+ * Truncation can leave a request within 1 ps of a whole period, which
+ * is the same edge as no delay.
+ */
+ if (abs_ps >= t_out_ps)
+ abs_ps = 0;
+ phase_norm_ps = phase_ps < 0 ? -(s64)abs_ps : (s64)abs_ps;
+ abs_ps = (phase_ps < 0 && abs_ps) ? t_out_ps - abs_ps : abs_ps;
+
+ if (abs_ps) {
+ u64 floor_cycles, err, alt_err, realized;
+ u8 alt_fine;
+
+ /* mul_u64_u64_div_u64(): abs_ps * fvco would overflow. */
+ floor_cycles = mul_u64_u64_div_u64(abs_ps, fvco,
+ 1000000000000ULL);
+
+ /*
+ * The fine field spans 210 ps, more than one VCO cycle in every
+ * band, so take the nearest of floor, floor + 1, and floor - 1
+ * with a larger fine code; the floor on a tie.
+ */
+ coarse = floor_cycles;
+ err = sit9531x_output_phase_quant_err(abs_ps, fvco, coarse,
+ &fine);
+ alt_err = sit9531x_output_phase_quant_err(abs_ps, fvco,
+ floor_cycles + 1,
+ &alt_fine);
+ if (alt_err < err) {
+ coarse = floor_cycles + 1;
+ fine = alt_fine;
+ err = alt_err;
+ }
+ if (floor_cycles) {
+ u64 fewer = floor_cycles - 1;
+
+ alt_err = sit9531x_output_phase_quant_err(abs_ps, fvco,
+ fewer,
+ &alt_fine);
+ if (alt_err < err) {
+ coarse = fewer;
+ fine = alt_fine;
+ }
+ }
+
+ /*
+ * Program a delay that quantizes to a whole period or more as
+ * none, and round one past the advertised range toward the
+ * request's side.
+ */
+ coarse_ps = mul_u64_u64_div_u64(coarse, 1000000000000ULL, fvco);
+ realized = coarse_ps +
+ (u64)fine * SIT9531X_OUT_PRG_FINE_STEP_PS;
+ if (realized >= t_out_ps) {
+ coarse = 0;
+ fine = 0;
+ } else if (phase_norm_ps < 0 ?
+ t_out_ps - realized > SIT9531X_OUT_PHASE_ADJ_MAX_PS :
+ realized > SIT9531X_OUT_PHASE_ADJ_MAX_PS) {
+ u64 rem;
+
+ coarse = floor_cycles;
+ coarse_ps = mul_u64_u64_div_u64(coarse,
+ 1000000000000ULL, fvco);
+ rem = abs_ps - coarse_ps;
+ if (phase_norm_ps < 0)
+ rem += SIT9531X_OUT_PRG_FINE_STEP_PS - 1;
+ fine = div_u64(rem, SIT9531X_OUT_PRG_FINE_STEP_PS);
+ }
+
+ if (coarse + SIT9531X_OUT_PRG_DIVO_CYCLES >=
+ (1ULL << SIT9531X_OUT_PRG_COARSE_BITS))
+ return -ERANGE;
+ }
+
+ coarse_ps = mul_u64_u64_div_u64(coarse, 1000000000000ULL, fvco);
+ abs_ps = coarse_ps + (u64)fine * SIT9531X_OUT_PRG_FINE_STEP_PS;
+ /*
+ * Report the form nearer to zero, as the readback does; it is within
+ * the range, so it fits the s32 the ABI carries.
+ */
+ if (abs_ps > t_out_ps - abs_ps)
+ *phase_adj = -(s32)(t_out_ps - abs_ps);
+ else
+ *phase_adj = (s32)abs_ps;
+
+ *coarse_out = coarse;
+ *fine_out = fine;
+
+ return 0;
+}
+
+/**
+ * sit9531x_output_phase_read - read an output's programmed delay back
+ * @sitdev: device pointer
+ * @out_idx: logical output index
+ * @phase_ps: result in picoseconds
+ * @beyond: set when @phase_ps is outside the advertised range
+ *
+ * An advance is stored as the period minus the advance; the stored delay reads
+ * back in the form nearer to zero, as an advance when it is more than half the
+ * period. Caller must hold sitdev->multiop_lock.
+ *
+ * Return: 0 on success, -ENODATA for an output no PLL drives or whose Fvco
+ * is unknown, <0 on other errors
+ */
+int sit9531x_output_phase_read(struct sit9531x_dev *sitdev, u8 out_idx,
+ s64 *phase_ps, bool *beyond)
+{
+ const struct sit9531x_chip_info *info = sitdev->info;
+ u8 bytes[SIT9531X_OUT_PRG_BYTES], fine;
+ u64 coarse = 0, fvco, ps, divo;
+ int rc;
+
+ lockdep_assert_held(&sitdev->multiop_lock);
+
+ if (out_idx >= info->num_outputs)
+ return -EINVAL;
+
+ *beyond = false;
+
+ if (!sitdev->out[out_idx].routed)
+ return -ENODATA;
+
+ rc = sit9531x_get_fvco(sitdev, sitdev->out[out_idx].pll_idx, &fvco);
+ if (rc)
+ return rc;
+
+ rc = sit9531x_output_phase_bytes_read(sitdev, out_idx, bytes);
+ if (rc)
+ return rc;
+ sit9531x_output_phase_bytes_decode(bytes, &coarse, &fine);
+
+ /*
+ * Take the period from the divider; the cached rate is unset at probe
+ * and whole hertz at best.
+ */
+ rc = sit9531x_output_divo_read(sitdev, out_idx, &divo);
+ if (rc && rc != -ENODATA)
+ return rc;
+
+ /*
+ * Fold the cycle count, not the picoseconds; the fine steps can carry
+ * the sum a fraction of a cycle past the period.
+ */
+ if (!rc)
+ div64_u64_rem(coarse, divo, &coarse);
+
+ ps = mul_u64_u64_div_u64(coarse, 1000000000000ULL, fvco);
+ ps += (u64)fine * SIT9531X_OUT_PRG_FINE_STEP_PS;
+
+ if (!rc) {
+ u64 t_out_ps = mul_u64_u64_div_u64(divo, 1000000000000ULL,
+ fvco);
+
+ if (ps >= t_out_ps)
+ ps -= t_out_ps;
+ if (ps > t_out_ps - ps &&
+ t_out_ps - ps <= SIT9531X_OUT_PHASE_ADJ_MAX_PS) {
+ *phase_ps = -(s64)(t_out_ps - ps);
+ return 0;
+ }
+ }
+ *beyond = ps > SIT9531X_OUT_PHASE_ADJ_MAX_PS;
+ *phase_ps = ps;
+
+ return 0;
+}
+
int sit9531x_output_freq_set(struct sit9531x_dev *sitdev, u8 out_idx,
u8 pll_idx, u64 frequency)
{
- u64 fvco, divo;
+ u8 old_bytes[SIT9531X_OUT_PRG_BYTES], new_bytes[SIT9531X_OUT_PRG_BYTES];
+ bool divo_back = false, divo_in, back, landed, encoded = false;
+ bool retime = false, bytes_in = false, bytes_back = false;
+ struct sit9531x_chan *chan = &sitdev->chan[pll_idx];
+ struct sit9531x_out *out = &sitdev->out[out_idx];
+ u64 fvco, divo, coarse, old_divo = 0;
+ s32 phase_adj = 0, held = 0;
+ bool beyond;
int rc, ret;
- bool back;
+ u8 fine;
lockdep_assert_held(&sitdev->multiop_lock);
@@ -1976,28 +2399,120 @@ int sit9531x_output_freq_set(struct sit9531x_dev *sitdev, u8 out_idx,
if (rc)
return rc;
+ /* The rate resolved, so a record of no delay value is out of date */
+ if ((out->phase_stale || out->phase_none) && !out->retime_pending) {
+ s64 phase_ps;
+
+ rc = sit9531x_output_phase_read(sitdev, out_idx, &phase_ps,
+ &beyond);
+ if (rc)
+ return rc;
+ out->phase_adj = phase_ps;
+ out->phase_armed = !beyond && phase_ps;
+ out->phase_stale = false;
+ out->phase_none = false;
+ }
+
+ /*
+ * The reset delay counts VCO cycles: encode the pending delay, or
+ * out->phase_adj in its form nearer to zero (an advance for a delay
+ * above half the old period), again for the new period. Write it in the
+ * divider's programming window; a second flush restarts the dividers.
+ */
+ rc = sit9531x_output_phase_bytes_read(sitdev, out_idx, old_bytes);
+ if (rc)
+ return rc;
+ sit9531x_output_phase_bytes_decode(old_bytes, &coarse, &fine);
+ beyond = !out->retime_pending && !out->phase_armed && out->phase_adj;
+ if (out->retime_pending || out->phase_armed ||
+ ((coarse || fine) && !beyond)) {
+ held = out->retime_pending ? out->retime_ps : out->phase_adj;
+
+ rc = sit9531x_output_phase_encode(fvco, divo, held, &coarse,
+ &fine, &phase_adj);
+ if (rc)
+ return rc;
+ encoded = true;
+ sit9531x_output_phase_bytes_build(old_bytes, coarse, fine,
+ new_bytes);
+ retime = memcmp(old_bytes, new_bytes, sizeof(new_bytes)) != 0;
+ }
+
+ if (retime) {
+ rc = sit9531x_output_divo_read(sitdev, out_idx, &old_divo);
+ if (rc && rc != -ENODATA)
+ return rc;
+ }
+
rc = sit9531x_prg_enter(sitdev);
if (rc)
return rc;
rc = sit9531x_output_divo_write(sitdev, out_idx, divo, &back);
- /* NVM update and loop lock */
- ret = sit9531x_prg_commit(sitdev);
+ landed = !back;
+ divo_in = !rc;
+ if (!rc && retime) {
+ rc = sit9531x_output_phase_bytes_write(sitdev, out_idx,
+ new_bytes, old_bytes,
+ &bytes_back);
+ if (rc) {
+ divo_back = bytes_back &&
+ !sit9531x_output_divo_write(sitdev, out_idx,
+ old_divo, &back);
+ landed = !divo_back;
+ } else {
+ bytes_in = true;
+ }
+ }
+ /* Leave PRG_CMD; the bank update only for a divider that changed */
+ ret = landed ? sit9531x_prg_commit(sitdev) :
+ sit9531x_prg_relock(sitdev);
if (ret && !rc)
rc = ret;
- if (rc)
+ if (rc) {
+ if (bytes_in || (encoded && !retime && divo_in)) {
+ out->phase_adj = phase_adj;
+ out->phase_armed = phase_adj != 0;
+ out->phase_stale = false;
+ out->retime_pending = false;
+ } else if (retime && landed) {
+ out->retime_ps = held;
+ out->retime_pending = true;
+ out->phase_stale = true;
+ } else if (encoded && landed) {
+ out->phase_stale = true;
+ } else if (beyond && landed) {
+ out->phase_stale = true;
+ }
+ if (landed)
+ chan->flush_pending = true;
return rc;
+ }
- /* Flush the output phase so the new DIVO starts aligned */
rc = sit9531x_output_phase_flush(sitdev, pll_idx);
- if (rc) {
+ if (chan->flush_pending)
dev_warn(sitdev->dev,
- "out%u: rate changed but the divider phase was not realigned (%d)\n",
+ "out%u: rate changed but the divider phase was not realigned (%d), the poll retries it\n",
out_idx, rc);
- rc = 0;
+ else if (rc)
+ dev_warn(sitdev->dev,
+ "out%u: rate changed, the flush left something to put back (%d)\n",
+ out_idx, rc);
+ if (encoded) {
+ out->phase_adj = phase_adj;
+ out->phase_armed = phase_adj != 0;
+ out->phase_stale = false;
}
- sitdev->out[out_idx].freq = div64_u64(fvco, divo);
+ /*
+ * A delay beyond the range was not re-timed and now decodes against the
+ * new divider.
+ */
+ if (beyond)
+ out->phase_stale = true;
+
+ out->freq = div64_u64(fvco, divo);
+ out->retime_pending = false;
return 0;
}
@@ -2041,6 +2556,137 @@ int sit9531x_output_freq_get(struct sit9531x_dev *sitdev, u8 out_idx,
return 0;
}
+int sit9531x_output_phase_adjust_set(struct sit9531x_dev *sitdev,
+ u8 out_idx, s32 phase_ps)
+{
+ u8 old_bytes[SIT9531X_OUT_PRG_BYTES], new_bytes[SIT9531X_OUT_PRG_BYTES];
+ const struct sit9531x_chip_info *info = sitdev->info;
+ u64 fvco, divo, coarse, old_coarse;
+ bool bytes_back, bytes_in, same;
+ u8 pll_idx, fine, old_fine;
+ struct sit9531x_chan *chan;
+ struct sit9531x_out *out;
+ s32 phase_adj;
+ int rc;
+
+ lockdep_assert_held(&sitdev->multiop_lock);
+
+ if (out_idx >= info->num_outputs)
+ return -EINVAL;
+
+ /* An unrouted output has only a placeholder in pll_idx. */
+ if (!sitdev->out[out_idx].routed)
+ return -ENODEV;
+
+ out = &sitdev->out[out_idx];
+ pll_idx = out->pll_idx;
+ if (pll_idx >= SIT9531X_NUM_PLLS)
+ return -EINVAL;
+ chan = &sitdev->chan[pll_idx];
+
+ rc = sit9531x_get_fvco(sitdev, pll_idx, &fvco);
+ if (rc)
+ return rc == -ENODATA ? -ENODEV : rc;
+
+ /* Take the period from the divider; the cached rate is whole hertz. */
+ rc = sit9531x_output_divo_read(sitdev, out_idx, &divo);
+ if (rc)
+ return rc == -ENODATA ? -ENODEV : rc;
+
+ rc = sit9531x_output_phase_encode(fvco, divo, phase_ps, &coarse, &fine,
+ &phase_adj);
+ if (rc)
+ return rc;
+
+ rc = sit9531x_output_phase_bytes_read(sitdev, out_idx, old_bytes);
+ if (rc)
+ return rc;
+ sit9531x_output_phase_bytes_build(old_bytes, coarse, fine, new_bytes);
+
+ /*
+ * Skip the write if the quantized delay is unchanged; a rewrite
+ * restarts the divider phase of every output on the PLL. Every coarse
+ * value up to the settling cycles decodes as no delay.
+ */
+ sit9531x_output_phase_bytes_decode(old_bytes, &old_coarse, &old_fine);
+ same = old_coarse == coarse && old_fine == fine && !out->phase_stale;
+ if (same && !chan->flush_pending) {
+ rc = 0;
+ goto cache;
+ }
+
+ if (!same) {
+ /*
+ * Order of Dely_program_output.py: the bytes on page 3 or 4
+ * under the Page 3 debug key, the small-change update on page 3
+ * for either page, then the flush with no wait. Only a divider
+ * rewrite needs the programming state.
+ */
+ rc = sit9531x_outsys_debug_open(sitdev);
+ if (rc)
+ return rc;
+
+ rc = sit9531x_output_phase_bytes_write(sitdev, out_idx,
+ new_bytes, old_bytes,
+ &bytes_back);
+ bytes_in = !rc;
+ if (!rc)
+ rc = sit9531x_write_u8(sitdev, SIT9531X_REG_PRG_DIR_GEN,
+ SIT9531X_SMALL_UPDATE_CMD);
+ sit9531x_outsys_debug_close(sitdev);
+ if (rc) {
+ if (bytes_in) {
+ out->phase_stale = true;
+ out->retime_ps = phase_ps;
+ out->retime_pending = true;
+ } else if (!bytes_back) {
+ out->phase_stale = true;
+ chan->flush_pending = true;
+ }
+ return rc;
+ }
+ }
+
+ /*
+ * A flush pulse into open loops can be lost when they re-lock, and a
+ * bank update after it changes the dividers again.
+ */
+ if (sitdev->bank_pending || sitdev->loops_open) {
+ rc = sit9531x_prg_retry(sitdev);
+ if (rc) {
+ chan->flush_pending = true;
+ goto cache;
+ }
+ }
+
+ /*
+ * Restart the divider phase so the delay applies against a known edge.
+ */
+ rc = sit9531x_output_phase_flush(sitdev, pll_idx);
+
+cache:
+ /* Cache what the registers hold */
+ out->phase_adj = phase_adj;
+ out->phase_stale = false;
+ out->phase_none = false;
+ out->retime_pending = false;
+
+ /*
+ * A delay that quantized to zero needs no re-time: the quantum is the
+ * VCO cycle, not the output period.
+ */
+ out->phase_armed = phase_adj != 0;
+
+ if (chan->flush_pending)
+ return rc;
+ if (rc)
+ dev_warn(sitdev->dev,
+ "out%u: delay applied, the flush left something to put back (%d)\n",
+ out_idx, rc);
+
+ return 0;
+}
+
/* The latches INTRB reports, each with its sticky bits */
static const struct {
unsigned int reg;
@@ -2597,6 +3243,9 @@ static int sit9531x_dev_state_fetch(struct sit9531x_dev *sitdev)
}
for (i = 0; i < sitdev->info->num_outputs; i++) {
+ bool beyond;
+ s64 phase_ps;
+
mutex_lock(&sitdev->multiop_lock);
rc = sit9531x_out_state_fetch(sitdev, i);
mutex_unlock(&sitdev->multiop_lock);
@@ -2605,6 +3254,24 @@ static int sit9531x_dev_state_fetch(struct sit9531x_dev *sitdev)
"Failed to fetch output %u state: %d\n", i, rc);
return rc;
}
+
+ /*
+ * The profile can set a delay; read it so a request of 0 ps can
+ * clear it.
+ */
+ mutex_lock(&sitdev->multiop_lock);
+ rc = sit9531x_output_phase_read(sitdev, i, &phase_ps, &beyond);
+ mutex_unlock(&sitdev->multiop_lock);
+ sitdev->out[i].phase_none = rc == -ENODATA;
+ if (!rc) {
+ sitdev->out[i].phase_adj = phase_ps;
+ sitdev->out[i].phase_armed = !beyond && phase_ps;
+ } else if (rc != -ENODATA) {
+ dev_err(sitdev->dev,
+ "Failed to read output %u delay: %d\n",
+ i, rc);
+ return rc;
+ }
}
mutex_lock(&sitdev->multiop_lock);
@@ -2743,6 +3410,25 @@ static void sit9531x_ho_release_retry(struct sit9531x_dev *sitdev, u8 pll_idx)
'A' + pll_idx);
}
+/*
+ * Apply a delay that waits for its re-time after a rate change or for its
+ * small-change update. Caller must hold sitdev->multiop_lock.
+ */
+static void sit9531x_retime_retry(struct sit9531x_dev *sitdev, u8 out_idx)
+{
+ struct sit9531x_out *out = &sitdev->out[out_idx];
+
+ if (!out->retime_pending)
+ return;
+
+ if (!sit9531x_output_phase_adjust_set(sitdev, out_idx, out->retime_ps))
+ dev_info(sitdev->dev, "out%u: pending delay applied\n",
+ out_idx);
+ /* The delay getter reports a value again */
+ if (!out->retime_pending)
+ out->ntf_pending = true;
+}
+
/*
* Write back the priority table after a failed write. Caller must hold
* sitdev->multiop_lock.
@@ -2874,6 +3560,18 @@ static void sit9531x_reselect(struct sit9531x_dev *sitdev, u8 pll_idx)
'A' + pll_idx);
}
+/* Run a pending output-divider flush. Caller must hold sitdev->multiop_lock. */
+static void sit9531x_flush_retry(struct sit9531x_dev *sitdev, u8 pll_idx)
+{
+ if (!sitdev->chan[pll_idx].flush_pending)
+ return;
+
+ sit9531x_output_phase_flush(sitdev, pll_idx);
+ if (!sitdev->chan[pll_idx].flush_pending)
+ dev_info(sitdev->dev, "PLL%c: output dividers realigned\n",
+ 'A' + pll_idx);
+}
+
/*
* Retry pending writes, then read each PLL's state; return true if any state
* read succeeds.
@@ -2893,12 +3591,21 @@ sit9531x_dev_chan_states_update(struct sit9531x_dev *sitdev)
} else if (sitdev->outsys_key_pending) {
sit9531x_outsys_debug_close(sitdev);
}
+ sit9531x_phase_flush_undo_retry(sitdev);
+ for (i = 0; i < sitdev->info->num_outputs; i++)
+ sit9531x_retime_retry(sitdev, i);
sit9531x_input_off_retry(sitdev);
for (i = 0; i < SIT9531X_NUM_PLLS; i++) {
sit9531x_table_back_retry(sitdev, i);
sit9531x_ho_release_retry(sitdev, i);
sit9531x_debug_back_retry(sitdev, i);
+ /*
+ * A flush pulse sent into open loops may be lost when they
+ * re-lock; a bank update after it changes the dividers again.
+ */
+ if (!sitdev->loops_open && !sitdev->bank_pending)
+ sit9531x_flush_retry(sitdev, i);
rc = sit9531x_chan_state_fetch(sitdev, i);
if (rc) {
sitdev->chan[i].stale = true;
@@ -3239,6 +3946,10 @@ static void sit9531x_dev_stop(struct sit9531x_dev *sitdev)
i);
mutex_unlock(&sitdev->multiop_lock);
+ /*
+ * Lock the loops first: a re-time ends in a flush, and a flush pulse
+ * into open loops can be lost. The undo runs after every flush.
+ */
mutex_lock(&sitdev->multiop_lock);
if (sitdev->bank_pending || sitdev->loops_open) {
sit9531x_prg_retry(sitdev);
@@ -3248,8 +3959,35 @@ static void sit9531x_dev_stop(struct sit9531x_dev *sitdev)
if (sitdev->loops_open)
dev_warn(sitdev->dev,
"output loops left unlocked at removal\n");
- } else if (sitdev->outsys_key_pending) {
+ }
+ for (i = 0; i < sitdev->info->num_outputs; i++) {
+ sit9531x_retime_retry(sitdev, i);
+ if (sitdev->out[i].retime_pending)
+ dev_warn(sitdev->dev,
+ "out%u: pending delay not applied at removal\n",
+ i);
+ }
+ /* Last: a re-time opens the debug key again */
+ if (sitdev->outsys_key_pending)
sit9531x_outsys_debug_close(sitdev);
+ for (i = 0; i < SIT9531X_NUM_PLLS; i++) {
+ if (!sitdev->loops_open && !sitdev->bank_pending)
+ sit9531x_flush_retry(sitdev, i);
+ if (sitdev->chan[i].flush_pending)
+ dev_warn(sitdev->dev,
+ "PLL%c: output dividers left unaligned\n",
+ 'A' + i);
+ }
+ sit9531x_phase_flush_undo_retry(sitdev);
+ if (sitdev->flush_ctrl_pending)
+ dev_warn(sitdev->dev,
+ "phase flush trigger source select not put back\n");
+ for (i = 0; i < SIT9531X_NUM_PLLS; i++) {
+ if (!(sitdev->flush_arm_pending & BIT(i)))
+ continue;
+ dev_warn(sitdev->dev, "PLL%c: on-demand phase flush left %s\n",
+ 'A' + i,
+ (sitdev->flush_armed & BIT(i)) ? "parked" : "armed");
}
mutex_unlock(&sitdev->multiop_lock);
}
diff --git a/drivers/dpll/sit9531x/core.h b/drivers/dpll/sit9531x/core.h
index 3c2a312f392c..562c63ee117d 100644
--- a/drivers/dpll/sit9531x/core.h
+++ b/drivers/dpll/sit9531x/core.h
@@ -27,6 +27,8 @@
#define SIT9531X_MAX_INPUTS 8
#define SIT9531X_NUM_INPUT_PAIRS (SIT9531X_MAX_INPUTS / 2)
#define SIT9531X_MAX_OUTPUTS 12
+/* Output phase-adjust range advertised to the core, +/-1 ms in ps */
+#define SIT9531X_OUT_PHASE_ADJ_MAX_PS 1000000000
/*
* Output rates of the datasheet, Table 6: continuous up to 800 MHz, above it
* 61.44 MHz times 15, 20, 24, 30, 32, 40 or 48.
@@ -128,6 +130,17 @@ struct sit9531x_ref {
* @routed: mapped to @pll_idx by the loaded configuration; an output
* unrouted at probe has no pin
* @pll_idx: PLL driving this output (0-3)
+ * @phase_stale: programmed delay may differ from @phase_adj
+ * @phase_none: the last delay read found no valid Fvco on the PLL, so the
+ * output has no delay value and the getter leaves the attribute out; a
+ * delay or rate request that finds an Fvco clears it
+ * @phase_armed: non-zero in-range delay programmed; a rate change re-times it
+ * @phase_adj: realized delay in whole VCO cycles plus 30 ps steps, in the
+ * form nearer to zero; an out-of-range profile delay is held as the
+ * positive decode
+ * @retime_pending: delay not yet applied, after a rate change or with its
+ * small-change update still to be issued; the poll applies @retime_ps
+ * @retime_ps: delay to apply while @retime_pending
*/
struct sit9531x_out {
u64 freq;
@@ -140,6 +153,12 @@ struct sit9531x_out {
u8 hiz_state;
bool routed;
u8 pll_idx;
+ s64 phase_adj;
+ bool phase_armed;
+ bool phase_stale;
+ bool phase_none;
+ bool retime_pending;
+ s32 retime_ps;
};
/*
@@ -181,6 +200,8 @@ struct sit9531x_out {
* @stall_shift: doublings of the stall count, one per re-select it arms, up
* to SIT9531X_RESELECT_STALL_SHIFT_MAX; cleared when a poll sees the PLL
* track, when @live_top changes, at probe and on resume
+ * @flush_pending: output divider realignment flush not yet triggered after
+ * a rate or delay commit
* @table_pending: priority table partly written or not latched; the PLL
* stays in forced holdover
* @table_back: table reported and to be rewritten while @table_pending
@@ -219,6 +240,7 @@ struct sit9531x_chan {
bool tracked;
u16 stall_polls;
u8 stall_shift;
+ bool flush_pending;
bool table_pending;
u8 table_back[SIT9531X_PRIO_MAX_SLOTS];
bool key_pending;
@@ -262,6 +284,10 @@ struct sit9531x_chan {
* @loops_open: output loops not yet re-locked
* @bank_pending: output divider bank update still to be issued
* @outsys_key_pending: output-system debug key not closed
+ * @flush_ctrl_pending: @flush_ctrl still to be written back
+ * @flush_ctrl: trigger register value to restore
+ * @flush_arm_pending: bit per PLL whose flush enable is still to be restored
+ * @flush_armed: of those, the PLLs the profile arms
*/
struct sit9531x_dev {
struct device *dev;
@@ -296,6 +322,10 @@ struct sit9531x_dev {
bool loops_open;
bool bank_pending;
bool outsys_key_pending;
+ bool flush_ctrl_pending;
+ u8 flush_ctrl;
+ u8 flush_arm_pending;
+ u8 flush_armed;
};
int sit9531x_read_u8(struct sit9531x_dev *sitdev, unsigned int reg,
@@ -333,6 +363,11 @@ int sit9531x_output_freq_set(struct sit9531x_dev *sitdev, u8 out_idx,
int sit9531x_output_freq_get(struct sit9531x_dev *sitdev, u8 out_idx,
u64 *frequency);
+int sit9531x_output_phase_read(struct sit9531x_dev *sitdev, u8 out_idx,
+ s64 *phase_ps, bool *beyond);
+int sit9531x_output_phase_adjust_set(struct sit9531x_dev *sitdev,
+ u8 out_idx, s32 phase_ps);
+
static inline u8 sit9531x_pll_page(u8 pll_idx)
{
return SIT9531X_PAGE_PLLA + pll_idx;
diff --git a/drivers/dpll/sit9531x/dpll.c b/drivers/dpll/sit9531x/dpll.c
index b0403c0bc132..502b25f22be4 100644
--- a/drivers/dpll/sit9531x/dpll.c
+++ b/drivers/dpll/sit9531x/dpll.c
@@ -647,6 +647,7 @@ sit9531x_dpll_output_pin_frequency_set(const struct dpll_pin *pin,
struct sit9531x_dpll *sitdpll = dpll_priv;
struct sit9531x_dev *sitdev = sitdpll->dev;
bool moved = false;
+ s64 phase_was;
u8 actual_pll;
u64 was, hz;
int rc;
@@ -663,9 +664,12 @@ sit9531x_dpll_output_pin_frequency_set(const struct dpll_pin *pin,
return -EINVAL;
}
was = sitdev->out[dpin->id].freq;
+ phase_was = sitdev->out[dpin->id].phase_adj;
rc = sit9531x_output_freq_set(sitdev, dpin->id, actual_pll,
frequency);
if (rc) {
+ moved = sitdev->out[dpin->id].phase_stale ||
+ sitdev->out[dpin->id].phase_adj != phase_was;
if (sit9531x_output_freq_get(sitdev, dpin->id, &hz))
moved = true;
else
@@ -790,12 +794,119 @@ sit9531x_dpll_output_pin_state_on_dpll_set(const struct dpll_pin *pin,
return rc;
}
+/*
+ * Report the delay as programmed after quantization, including one whose flush
+ * is pending. An output whose PLL has no valid Fvco has no delay value.
+ */
+static int
+sit9531x_dpll_output_pin_phase_adjust_get(const struct dpll_pin *pin,
+ void *pin_priv,
+ const struct dpll_device *dpll,
+ void *dpll_priv, s32 *phase_adjust,
+ struct netlink_ext_ack *extack)
+{
+ struct sit9531x_dpll_pin *dpin = pin_priv;
+ struct sit9531x_dpll *sitdpll = dpll_priv;
+ struct sit9531x_dev *sitdev = sitdpll->dev;
+ s64 phase_adj;
+ bool none;
+ int rc;
+
+ mutex_lock(&sitdev->multiop_lock);
+ /*
+ * A pending re-time has no delay to report: its bytes are for the old
+ * rate or wait for their small-change update. With no value the core
+ * passes every request on, the old delay included.
+ */
+ if (sitdev->out[dpin->id].retime_pending) {
+ mutex_unlock(&sitdev->multiop_lock);
+ return -ENODATA;
+ }
+ if (sitdev->out[dpin->id].phase_stale) {
+ bool beyond;
+ s64 phase_ps;
+
+ rc = sit9531x_output_phase_read(sitdev, dpin->id, &phase_ps,
+ &beyond);
+ /* -ENODATA: no delay value; another error fails the pin dump */
+ if (rc && rc != -ENODATA) {
+ mutex_unlock(&sitdev->multiop_lock);
+ dev_warn_ratelimited(sitdev->dev,
+ "out%u: delay not read back: %d\n",
+ dpin->id, rc);
+ return -ENODATA;
+ }
+ sitdev->out[dpin->id].phase_none = rc == -ENODATA;
+ if (!rc) {
+ sitdev->out[dpin->id].phase_adj = phase_ps;
+ sitdev->out[dpin->id].phase_armed = !beyond && phase_ps;
+ }
+ sitdev->out[dpin->id].phase_stale = false;
+ }
+ none = sit9531x_out_state_get(sitdev, dpin->id)->phase_none;
+ phase_adj = sit9531x_out_state_get(sitdev, dpin->id)->phase_adj;
+ mutex_unlock(&sitdev->multiop_lock);
+
+ /*
+ * A delay found on the part is reported as found, also beyond the
+ * advertised range, which bounds a request; one beyond the s32
+ * attribute is left out.
+ */
+ if (none || phase_adj > S32_MAX)
+ return -ENODATA;
+ *phase_adjust = phase_adj;
+
+ return 0;
+}
+
+/* Program the per-output PRG_RST_DELAY registers */
+static int
+sit9531x_dpll_output_pin_phase_adjust_set(const struct dpll_pin *pin,
+ void *pin_priv,
+ const struct dpll_device *dpll,
+ void *dpll_priv, s32 phase_adjust,
+ struct netlink_ext_ack *extack)
+{
+ struct sit9531x_dpll_pin *dpin = pin_priv;
+ struct sit9531x_dpll *sitdpll = dpll_priv;
+ struct sit9531x_dev *sitdev = sitdpll->dev;
+ const struct sit9531x_out *out;
+ bool moved;
+ s64 was;
+ int rc;
+
+ out = sit9531x_out_state_get(sitdev, dpin->id);
+
+ mutex_lock(&sitdev->multiop_lock);
+ was = out->phase_adj;
+ rc = sit9531x_output_phase_adjust_set(sitdev, dpin->id, phase_adjust);
+ moved = out->phase_adj != was || out->phase_stale;
+ mutex_unlock(&sitdev->multiop_lock);
+
+ if (rc) {
+ struct dpll_pin *dpll_pin;
+
+ NL_SET_ERR_MSG(extack, "Phase adjust failed");
+ /* The core notifies only a request that succeeded */
+ dpll_pin = READ_ONCE(dpin->dpll_pin);
+ if (moved && dpll_pin && __dpll_pin_change_ntf(dpll_pin)) {
+ mutex_lock(&sitdev->multiop_lock);
+ sitdev->out[dpin->id].ntf_pending = true;
+ mutex_unlock(&sitdev->multiop_lock);
+ }
+ }
+
+ return rc;
+}
+
static const struct dpll_pin_ops sit9531x_dpll_output_pin_ops = {
.direction_get = sit9531x_dpll_output_pin_direction_get,
.frequency_get = sit9531x_dpll_output_pin_frequency_get,
.frequency_set = sit9531x_dpll_output_pin_frequency_set,
.state_on_dpll_get = sit9531x_dpll_output_pin_state_on_dpll_get,
.state_on_dpll_set = sit9531x_dpll_output_pin_state_on_dpll_set,
+ .phase_adjust_get = sit9531x_dpll_output_pin_phase_adjust_get,
+ .phase_adjust_set = sit9531x_dpll_output_pin_phase_adjust_set,
};
const struct dpll_pin_ops *
@@ -884,7 +995,7 @@ void sit9531x_dpll_pin_baseline(struct sit9531x_dpll_pin *pin)
/*
* Re-read an output with a pending change notification; return true once the
- * read succeeds. Caller must hold sitdev->multiop_lock.
+ * read succeeds or finds no delay. Caller must hold sitdev->multiop_lock.
*/
static bool
sit9531x_dpll_output_ntf_pending(struct sit9531x_dev *sitdev,
@@ -901,6 +1012,23 @@ sit9531x_dpll_output_ntf_pending(struct sit9531x_dev *sitdev,
return false;
if (out->state_stale && sit9531x_output_state_refresh(sitdev, pin->id))
return false;
+ if (out->phase_stale && !out->retime_pending) {
+ bool beyond;
+ s64 phase_ps;
+ int rc;
+
+ /* -ENODATA: the getter leaves the delay out of the message */
+ rc = sit9531x_output_phase_read(sitdev, pin->id, &phase_ps,
+ &beyond);
+ if (rc && rc != -ENODATA)
+ return false;
+ out->phase_none = rc == -ENODATA;
+ if (!rc) {
+ out->phase_adj = phase_ps;
+ out->phase_armed = !beyond && phase_ps;
+ }
+ out->phase_stale = false;
+ }
out->ntf_pending = false;
diff --git a/drivers/dpll/sit9531x/prop.c b/drivers/dpll/sit9531x/prop.c
index 15294d07b703..4f4d52dd284d 100644
--- a/drivers/dpll/sit9531x/prop.c
+++ b/drivers/dpll/sit9531x/prop.c
@@ -188,6 +188,22 @@ sit9531x_pin_props_get(struct sit9531x_dev *sitdev,
props->dpll_props.capabilities =
DPLL_PIN_CAPABILITIES_STATE_CAN_CHANGE;
curr_freq = 0;
+
+ /*
+ * The part takes a delay anywhere within the output period;
+ * +/-1 ms is a round figure within the s32 ps attribute.
+ */
+ props->dpll_props.phase_range.min =
+ -SIT9531X_OUT_PHASE_ADJ_MAX_PS;
+ props->dpll_props.phase_range.max =
+ SIT9531X_OUT_PHASE_ADJ_MAX_PS;
+ /*
+ * The delay grid is whole VCO cycles of the output's PLL plus
+ * 30 ps steps, so it depends on the PLL; a request in 1 ps
+ * units is programmed as the nearest grid point within the
+ * range, which is reported.
+ */
+ props->dpll_props.phase_gran = 1;
}
sit9531x_prop_pin_package_label_set(sitdev, props, dir, index);
diff --git a/drivers/dpll/sit9531x/regs.h b/drivers/dpll/sit9531x/regs.h
index 04723097d2b2..bd034abdf875 100644
--- a/drivers/dpll/sit9531x/regs.h
+++ b/drivers/dpll/sit9531x/regs.h
@@ -151,6 +151,35 @@
#define SIT9531X_DEBUG_UNLOCK_VAL 0xC3
#define SIT9531X_DEBUG_LOCK_VAL 0x00
+/*
+ * Per-output phase delay: 34-bit coarse in VCO cycles plus a 3-bit fine
+ * field in 30 ps steps, in a five-byte block PROG6..PROG2:
+ *
+ * base + 0 PROG6 [7:5] OPSTG_VCASC_BUMP (preserve)
+ * [4:2] PRG_RST_FINE_DELAY[2:0]
+ * [1:0] PRG_RST_DELAY[33:32]
+ * base + 1..4 PROG5..PROG2 PRG_RST_DELAY[31:0], MSB first
+ *
+ * Block base is 0x15 + 16 * (slot % 6), slot from clkout_map[]; slots 0-5
+ * on page 3, 6-11 on page 4.
+ */
+#define SIT9531X_OUT_PRG_DELAY_BASE 0x15
+#define SIT9531X_OUT_PRG_SLOT_STRIDE 0x10
+#define SIT9531X_OUT_PRG_BYTES 5
+#define SIT9531X_OUT_PRG_OPSTG_MASK 0xE0
+#define SIT9531X_OUT_PRG_FINE_SHIFT 2
+#define SIT9531X_OUT_PRG_FINE_MASK 0x1C /* bits [4:2] */
+#define SIT9531X_OUT_PRG_COARSE_HI_MASK 0x03 /* bits [1:0] */
+/*
+ * The divider takes two VCO cycles to act on a programmed delay; the encoded
+ * value includes them, as in the reference flow.
+ */
+#define SIT9531X_OUT_PRG_DIVO_CYCLES 2
+
+#define SIT9531X_OUT_PRG_FINE_STEP_PS 30
+#define SIT9531X_OUT_PRG_FINE_MAX 7 /* 3-bit field */
+#define SIT9531X_OUT_PRG_COARSE_BITS 34
+
/*
* Register-triggered phase flush: DIVO_PHASE_SEL_REG selects the register
* trigger; pulsing DIVO_PHASE_TRIG high then low flushes. Preserve the OEb
--
2.39.2 (Apple Git-143)
Technical Details
Message-ID:
<20261201235202.97645-12-arouhi@sitime.com>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375435-linux-kernel-netdev=dewy.ruReferences:
<20261201235202.97645-1-arouhi@sitime.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375435-linux-kernel-netdev=dewy.ru
From: arouhi@sitime.com (Ali Rouhi)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net-next v17 11/13] dpll: sit9531x: add support to adjust
output phase
Date: Tue, 1 Dec 2026 23:52:08 +0000
Organization: Usenet Network
Message-ID: <20261201235202.97645-12-arouhi@sitime.com>
References: <20261201235202.97645-1-arouhi@sitime.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network;
logging-data="1846363"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:uxAGxKNEXh2XtnDko0Jq8JqSWXk= sha256:OdYU2zMkqZ2Wuv7Ox9yWSYAygKwli/OLDlNhW+3zLG4=
sha1:ozdxbzQDpmMgNlQOH6vo/6dmkgU= sha256:P1IbhCcsP/9EgLyLBxEiB0XMcb6ZebaOoh/RNxhXG9g=
Content-Language: en-US
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-MS-Has-Attach
X-MS-TNEF-Correlator
X-Received: from localhost (localhost [127.0.0.1])
by mail.dewy.ru (Postfix) with ESMTP id A5E4B1174F3; Wed, 2 Dec 2026 02:57:24 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -1.95
X-Spam-Status: No, score=-1.95 tagged_above=-9999 required=6.31
tests=[DCC_CHECK=1.1, DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1,
DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1,
RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
header.d=sitime.com header.b=V4fjhmDC; dkim=pass (2048-bit key)
header.d=sitime.onmicrosoft.com header.b=l7bZMk5r
X-Received: from mail.dewy.ru ([127.0.0.1])
by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id 4fT9Ck8Re521;
Wed, 2 Dec 2026 02:57:19 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-375435-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=sitime.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
by mail.dewy.ru (Postfix) with ESMTPS id 34F1E1174F0; Wed, 2 Dec 2026 02:57:06 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by sea.lore.kernel.org (Postfix) with ESMTP id 06F6E3317C; Tue, 1 Dec 2026 23:55:01 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=3; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
t=1796169183;
b=iUH+X1qPu0NRg40gj0TO5zywmRlcCubddKT5su0ChkTT6IQlK47kR6/VgIN7vW2XELPP
LX/EAwV56i9Ch2++9L2aqByU6qN5ZiJ8DKvmnWQndkNiAhXh1JDFaLnfM4geEYPGc8mWI
PftbJ4ipeo/6HXIfTDLv/P6TdUSjWACc7AWZ+uUWG9/hVnzYKSJjOoYegKC0+dfwUuqN0
LJujcd5usDQH4DMvzqxs9wU+AQrvGtASY2egPsXgMiFKsAMZbWJmSP3Q0aHT6ucM+UanR
NYYSX1oFr5QtFJ5yjR/LmYVt7vIRshNzDMrRAQSiOo8vwMyA8wzIhwi3lw0m6b4SEBw==
X-ARC-Message-Signature: i=3; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1796169183;
h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:X-Virus-Scanned:
Received:DKIM-Signature:Received:Received:From:To:CC:Subject:
Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:
Accept-Language:Content-Language:X-MS-Has-Attach:X-MS-TNEF-Correlator:
x-ms-publictraffictype:x-ms-traffictypediagnostic:
x-ms-office365-filtering-correlation-id:x-ms-exchange-senderadcheck:
x-ms-exchange-antispam-relay:x-microsoft-antispam:
x-microsoft-antispam-message-info:x-forefront-antispam-report:
x-ms-exchange-antispam-messagedata-chunkcount:
x-ms-exchange-antispam-messagedata-0:Content-Type:
Content-Transfer-Encoding:X-Mailing-List:List-Id:List-Post:List-Help:
List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version:
X-Exchange-RoutingPolicyChecked:X-OriginatorOrg:
X-MS-Exchange-CrossTenant-AuthAs:X-MS-Exchange-CrossTenant-AuthSource:
X-MS-Exchange-CrossTenant-Network-Message-Id:
X-MS-Exchange-CrossTenant-originalarrivaltime:
X-MS-Exchange-CrossTenant-fromentityheader:
X-MS-Exchange-CrossTenant-id:X-MS-Exchange-CrossTenant-mailboxtype:
X-MS-Exchange-CrossTenant-userprincipalname:
X-MS-Exchange-Transport-CrossTenantHeadersStamped:X-MDID:X-PPE-STACK:
X-MDID-O:X-PPE-TRUSTED;
bh=tL+Dy1B/2dbLae50tR6A6qqnqhvZyzn/txWtaRMxXTE=;
b=p2ax1LS3E0zI0xf8yeaAwlKvMcoLRUrTeMd2IB56NHlDsjft8ikWc7xvKkmFhpJIpta9
AS1c0HTD35QSB3IJmiItiBau2FFH7zRPst1M6ShtSr3aSRRbcu9/ID5swcLReBDl+tIj+
v47u6AA403/p5sBB3kq/wEk1iEollGK3sRLbD4hBsfGzbYg8vGz4AWhO0uXH8EBoYNEvH
TS2+0lV99HUigOQiJ7l/AXUz16mbKxw6bFIkqkeFQsKO9FKtPu2JXIsQUxYVufzUF9Cmg
v5ZIEuXN6Z+QFLwBwjiqpMbF1Tir8fsrxlkx3dLJyz59Bzc0KkvCjvg2Squj6L8rqSw==
X-ARC-Authentication-Results: i=3; smtp.subspace.kernel.org;
dkim=pass header.d=sitime.com header.i=@sitime.com header.a=rsa-sha256 header.s=mail header.b=V4fjhmDC;
dkim=pass header.d=Sitime.onmicrosoft.com header.i=@Sitime.onmicrosoft.com header.a=rsa-sha256 header.s=selector1-Sitime-onmicrosoft-com header.b=l7bZMk5r;
dmarc=pass header.from=sitime.com;
spf=pass smtp.mailfrom=sitime.com;
arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 831EE60A3826;
Tue, 1 Dec 2026 23:53:03 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=sitime.com header.i=@sitime.com header.a=rsa-sha256 header.s=mail header.b=V4fjhmDC;
dkim=pass (2048-bit key) header.d=Sitime.onmicrosoft.com header.i=@Sitime.onmicrosoft.com header.a=rsa-sha256 header.s=selector1-Sitime-onmicrosoft-com header.b=l7bZMk5r
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=148.163.129.48
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
t=1796169172;
b=lICAZ3h5A0XvSqPXh105I4WwuYwjgXk/qZEeGvYOvJXI12RlA45qCNG44BM/a/M3H5rz
3PWuqMBqoqyk1sRhrLM74Zdv65lQbx73S19yxVTvBblOTu3AQVll3eRkk8w1hgb/+hWs2
c4bm6+nn6N2oXrDx8hMWd4GCzyOA3SnGkuspL4kBMnYqs2KveJ+ur/QQ7pCrEtZEf3BLi
uO6iwJfw2Ydzj47uGa/y7/QhMTBmtfHA4L9Fy6viWUxlVv55D7PisE4D1x4jMi3qFRK5q
yYJpShSwWPZ7t0/ytcBuThoFr01nstggOAzxTZfSHG46rLA1KSqJ7azJ60k1UcTUWbw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1796169172;
h=DMARC-Filter:DKIM-Signature:X-Virus-Scanned:Received:DKIM-Signature:
Received:Received:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:
Message-ID:References:In-Reply-To:Accept-Language:Content-Language:
X-MS-Has-Attach:X-MS-TNEF-Correlator:x-ms-publictraffictype:
x-ms-traffictypediagnostic:x-ms-office365-filtering-correlation-id:
x-ms-exchange-senderadcheck:x-ms-exchange-antispam-relay:
x-microsoft-antispam:x-microsoft-antispam-message-info:
x-forefront-antispam-report:
x-ms-exchange-antispam-messagedata-chunkcount:
x-ms-exchange-antispam-messagedata-0:Content-Type:
Content-Transfer-Encoding:MIME-Version:
X-Exchange-RoutingPolicyChecked:X-OriginatorOrg:
X-MS-Exchange-CrossTenant-AuthAs:X-MS-Exchange-CrossTenant-AuthSource:
X-MS-Exchange-CrossTenant-Network-Message-Id:
X-MS-Exchange-CrossTenant-originalarrivaltime:
X-MS-Exchange-CrossTenant-fromentityheader:
X-MS-Exchange-CrossTenant-id:X-MS-Exchange-CrossTenant-mailboxtype:
X-MS-Exchange-CrossTenant-userprincipalname:
X-MS-Exchange-Transport-CrossTenantHeadersStamped:X-MDID:X-PPE-STACK:
X-MDID-O:X-PPE-TRUSTED;
bh=tL+Dy1B/2dbLae50tR6A6qqnqhvZyzn/txWtaRMxXTE=;
b=PND9dprGZWfMx9mW08Jlt2KkmFCJ5zPVC/ACX+FJrYGUHs9b/57sqyrPDHLOaIp5KRhJ
eWXGCvIp6d0FNG6CQaOxiykNdpT7oABjEOS2bufvkgPRBF3u05y16paFUCxpGl1mU1e6t
wgZlXvsBLi9WQ3vTju3Cnea440YUSslUiVJV6DnScQnspWuEIiasaf6yAzx9PDrHjxEMP
k9BaPZolaM2xI0y+JsuCcR9jtFyL1O3rZplRbq4GVD/5aMhhjRgoHJHwPK2N6evTGYpMR
W1QQ67smwxWgiA+bAe0tHf5i7qMITO5iJUJGnce15IweAfKBJG81y67aIEXTGJGR7ig==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dmarc=pass header.from=sitime.com;
spf=pass smtp.mailfrom=sitime.com;
dkim=pass header.d=sitime.com header.i=@sitime.com header.a=rsa-sha256 header.s=mail header.b=V4fjhmDC;
dkim=pass header.d=Sitime.onmicrosoft.com header.i=@Sitime.onmicrosoft.com header.a=rsa-sha256 header.s=selector1-Sitime-onmicrosoft-com header.b=l7bZMk5r;
arc=pass header.oldest-pass=0 smtp.remote-ip=148.163.129.48
X-Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [148.163.129.48])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature ECDSA (prime256v1))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6D637606A323;
Tue, 1 Dec 2026 23:52:51 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 6D637606A323
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sitime.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sitime.com
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sitime.com;
h=cc:cc:content-transfer-encoding:content-transfer-encoding:content-type:content-type:date:date:from:from:in-reply-to:in-reply-to:message-id:message-id:mime-version:mime-version:references:references:subject:subject:to:to;
s=mail; bh=tL+Dy1B/2dbLae50tR6A6qqnqhvZyzn/txWtaRMxXTE=;
b=V4fjhmDCvfRLv4v1CMoZEnQr42la/yJkWcUJtJ3GNVZBrgKZAEqZsfQB+1UBo0Fw70ZyWbtjcXievaQgJZw2bCKVHEVmeHWHRrM7ddLht8DwS/0Mg4kjSei5CHYpgKmQpd97wc0A/gKsxkW1NIDf77hYJwYhAqBMyqxzIS1UD03ZILNeVLwKtu85/HVnLvc3soaVvUrSxpF+zrxkE1MrY9DuBVLMDy8xtjDBH7JCphlYA9TZpXeuRkL4uUrmclbjDkrf8jVzbjmHwH1+6CxmHdX6+AZ4bBsw79+I70Wox5YMbOBE+W1Osw/30FRTA0EIi5UbDAODFBGAVUMrHxL6hw==
X-Virus-Scanned: Proofpoint Essentials engine
X-Received: from CY3PR05CU001.outbound.protection.outlook.com (mail-westcentralusazon11023134.outbound.protection.outlook.com [40.93.201.134])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256)
(No client certificate requested)
by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id 8BB25280079;
Tue, 1 Dec 2026 23:52:49 +0000 (UTC)
X-ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
b=ESU2czDbL0yFHhOHy4aufAuTsIxuMtLfrGPIisVzvaa/jrRDtO1zIjG5X6eEYWOlzPClQv10U0vncFkssaNKRV9SmcD1DGg9a5czTqNuRek24EwHNqgdjowF3jrMMkRyXzI0lo8hieQJgbeWQHz5K34o4EunEixOQ2+NhS8PcHtIORfuA4WripjqSzcQdNeSQGMDXdhfwTjyLXfNu/WdxopZDMN/jypb72R2Fqb8kHjWLp+xsmismoxDh8tdT5MEoK1B9iujVIaiAWLUxpysY78YptIaQ06AC4Iksgcm9n6Yd+Dxn/wLLbVEqNE1CUQGK1YeAgklpckC/QvbEgDO1w==
X-ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
s=arcselector10001;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
bh=tL+Dy1B/2dbLae50tR6A6qqnqhvZyzn/txWtaRMxXTE=;
b=ZjlhrloAvHd+38eip0lsY5rvhMmp8gBqKSQsLy39WXuwH90rQIfX3xs4FatfT14UHcjkFZZGd40+IcWNjsb1Zz5+sz+jkdFki7mcgGCdIU7de+KDMKPYWvZntu3wTkqQ8OB4N0vQUpI72SfffSM9NJ6ju5rHa+xDbcD1geGcBfF28mrUMblvsexiOoSia/4ToZY4ZRlEGNPNWByndhTzgIwRJXlKTkexT6RplwfIZdkzQdESXsG2Yt3zaWtRcVumqkSSB0jt+p8zfaV2sHBLBrqbkbc1ntjwqPoSz8L3ZpWUiUOQTcwZQOQUvCYbfRT6Nh6s6I1QWAn3FZ5gQiDmBQ==
X-ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
smtp.mailfrom=sitime.com; dmarc=pass action=none header.from=sitime.com;
dkim=pass header.d=sitime.com; arc=none
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=Sitime.onmicrosoft.com; s=selector1-Sitime-onmicrosoft-com;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
bh=tL+Dy1B/2dbLae50tR6A6qqnqhvZyzn/txWtaRMxXTE=;
b=l7bZMk5rzeyOZ8IMlz1xUfI9gldtc8ilMqmmDaG5av12UeR8iByX7AkGQNrZ9yRjWJLpjfUp3X0fDjF8ho1q8RfwTcUNVltBBhJ0YzI0iA5BbRiRh6XZbZQAc7Wst40ZcWw6zq84HtyFyIhDmRvV8GvSBAGPdEftllQkyw2V5vkkadeic76Lz1Z0WMXsE7C13+0RX4lzHhLmb4LuQw7D4coSvt6NcdEK9/DLpw3e3zTbs0XGI4V2GohcVbfnXHRVuD6YS5siGKEsc0U1LhdHP2oaYiR+GwCUoVOt6W4a8DYGSSkYeIOfcOECRIDNRx6i3fdZI+CKbSbb1GEnWO90wg==
X-Received: from LVWPR20MB994915.namprd20.prod.outlook.com
(2603:10b6:408:3bf::16) by SJ2PR20MB6330.namprd20.prod.outlook.com
(2603:10b6:a03:502::11) with Microsoft SMTP Server (version=TLS1_2,
cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.10; Tue, 1 Dec
2026 23:52:47 +0000
X-Received: from LVWPR20MB994915.namprd20.prod.outlook.com
([fe80::9551:3864:128b:8c01]) by LVWPR20MB994915.namprd20.prod.outlook.com
([fe80::9551:3864:128b:8c01%4]) with mapi id 15.21.0688.009; Tue, 1 Dec 2026
23:52:47 +0000
X-CC: "ivecera@redhat.com" <ivecera@redhat.com>, "vadim.fedorenko@linux.dev"
<vadim.fedorenko@linux.dev>, "arkadiusz.kubalewski@intel.com"
<arkadiusz.kubalewski@intel.com>, "kuba@kernel.org" <kuba@kernel.org>,
"pabeni@redhat.com" <pabeni@redhat.com>, "robh@kernel.org" <robh@kernel.org>,
"krzk+dt@kernel.org" <krzk+dt@kernel.org>, "conor+dt@kernel.org"
<conor+dt@kernel.org>, "prabhakar.mahadev-lad.rj@bp.renesas.com"
<prabhakar.mahadev-lad.rj@bp.renesas.com>, "cjubran@nvidia.com"
<cjubran@nvidia.com>, "Oleg.Zadorozhnyi@devoxsoftware.com"
<Oleg.Zadorozhnyi@devoxsoftware.com>, "netdev@vger.kernel.org"
<netdev@vger.kernel.org>, "devicetree@vger.kernel.org"
<devicetree@vger.kernel.org>, "linux-kernel@vger.kernel.org"
<linux-kernel@vger.kernel.org>
X-Thread-Topic: [PATCH net-next v17 11/13] dpll: sit9531x: add support to adjust
output phase
X-Thread-Index: AQHdge75HQW/AVadLEGzJ18q86f4Fg==
X-In-Reply-To: <20261201235202.97645-1-arouhi@sitime.com>
X-Accept-Language: en-US
X-authentication-results: mx.microsoft.com 1; dkim=none (message not signed)
header.d=none;dmarc=none action=none header.from=sitime.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: LVWPR20MB994915:EE_|SJ2PR20MB6330:EE_
x-ms-office365-filtering-correlation-id: 6f949d89-8d00-4fbc-ae12-08df5006334c
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;ARA:13230040|376014|1800799024|23010399003|366016|38070700021|10067099003|260925021311599003|56012099006|5023799004|260925021911599003|260925022911599003|261022075727099003|261026121527099003|261021123027099003|261022113327099003|261021121427099003|261026140227099003|261022105027099003|261028144727099003|261102123227099003|261009223027099003|22082099003|18002099003|6133799003|3023799007;
x-microsoft-antispam-message-info: EYV1PlZKP9TD2KrWK5iJo785P5LMg5Y8cfun/RHyCXWEQLQlYhCGzo3apKiLm23PIZgKWYSRmmVgXiRx1X6adVfb0ocIzkDrdp+fvKY63ws2Y3SdbZ+Ehjys1e4jUcvtvbCU9JQZ5Lh66XUbqU/AjcYl7ePrXlxkXoNTmrCg9ZFUAdKPoWEP+AnhEmTyj/UtfVLyqLKJEVkpR0PoKs80FUsUHMW7WXhEA8qzK7r/xuMvMXOzI19t05YDFvbomNRe0+Nq2QZpyZw+lMnu6Kr9o4NpfTtMqp48L4dCVQDRUutrc7YY46OsUjZoxp0oec3+THRU8yUd9uUCweZSlXKosZjwbmC51kdmD/nQRiKKLqTY5nltH019nr1YFeGPLtm83Ifa7ZG1TmtUtlSP1h/E1ku5QArFO/CyjlymGzWTFri64WyFCKeJVy99AHLFxxvAQSbnmnnxxIraYb/w0KectAM4tg/1Nr1v6PNhzofXq/wSiUpPHZwKLTFB4Dj1e0AkJt4aSWhUEhX4QUT0AzuiTDvHIFWlw16bVJihlxjK/2KPi4D4mvcKdQttO5BtszItCb0HGLuMsG37PFpEuxbLQDM7pI7DPQSqRBEETe7orI3Y0DIvwwmVP817xItNqIyZgyW2drgLVDSFijExydHlde7DlM+1nBFJ0JVBDRQA9XwwsHXjm0OMajmwQdltkZQn2Rt84ScwgGg8tpRtyuRlMsH9/Sj5Y1/UfilIyGrAxvo=
x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:LVWPR20MB994915.namprd20.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(1800799024)(23010399003)(366016)(38070700021)(10067099003)(260925021311599003)(56012099006)(5023799004)(260925021911599003)(260925022911599003)(261022075727099003)(261026121527099003)(261021123027099003)(261022113327099003)(261021121427099003)(261026140227099003)(261022105027099003)(261028144727099003)(261102123227099003)(261009223027099003)(22082099003)(18002099003)(6133799003)(3023799007);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: CIGr0fMw4tU0UJQjBpy2YF6R21MhTnoAysk/2+ZLt6PYTjJBK2PeIbKaFg0JPXt8xasNHuUwA87AiOjvJ8CVwRD8Tf+CwNcmO61FOTePyJkXJNKgkZYHNxn6mLqjCELTz7JyEAehKnQpmQroZ8VjVFmJ25AVSQryrV/MYkihoW6Y0UUmhn0qC0KZu9iauqpSV/A0ebhTBZQsZrPJ+Sh3fz81Ek3opW3jPpmWNmkGVglE4z28P3fjwQA+AARVxpd4a2GkoAps6JKVZ21PT2N9Lsswuv1B0XGKXP4EKYAnNQcARP4igRyi08tBOYrHVYWke8QPqVvuv8A6c/ufB5STm3OVKLjoeUFFvMqkkhjbssbVUypdowrvB2jOOnTwauKGlQgAPF4yRzgQ48F+yK2lGGiWl6U9yo3w3V2eXCeTnrvJ2OBZE6289eOr2xfJ/avhjTvt70gP633QmCP4vyx6mhLY5gW41Nsv7QODXJoK/F9wDbkaINbmCNBQQl6BGnAABxKq6u27fZ9X11v3OrLC9iFHL4iRN2BxA7tyNkrUJeU6xzsoaWVLSfwJOaLOuvZ+b/h6SJBylWZsUZotd4qVGMy6C2ppPXcHJUa/SpKl1irgWszjUt9Gr/nIpsdDsUz9eC4qmkc2frjWsPvOt1w5Zak1amLN7B4DgLUreUxq5SBhVtjWL5rEdA5xsvdVYG7KbCt5aWbSs+/irJyHMBoAcfYFkpD4poRD1mLuUqMBOd/K3WOuhV9YboRkhBFyPH3ncMqqiI1Dc6dHi9Zj9WmAn/OX7SmbXeINgRUCvYmxR6XAUJtyiFzmiqxA/aZ1NGWj63kUY1qJsjyAfWRTesZ/bHv05hOHxUSh19a8L0ITTlXiaVfldnMVmZab0UVhYGYVpcx+VYsXLwpOvj5iRosYEWu41V4g+tdMHUSmmmcdKQdon8EjUhIQyrWqpNNMFsqK05L4Z97UA9ao6oYoaiKz7NBT6Ds8b5poPM5c4CHPx6ZpKyrOtd/m8wBkh8x7QLAYMjXLQSzMI+AlsgcBkPeIEurZAfnUWXM19Ppo4/In7pKyIufb1JYP0xIFbUSrKHFgX8Vvbvx1Jvz5js5SluI7+v51a8Er2zu1phk970PutM4EeB5o+MrFwvD8pkydSLZhGFQ5n5KjCKPK5B/jwZfQf+QNV28sikwWtS3v7PFXyyupjEWwwrQD1v+Fi0sRsu3oecZ9qJiXisWzjqkdcZNs18A69goDjwviWn0XemQcOtzuU7HyiUeIhpSEtjkFSOyHZd+QXYwKdH/4eTm3C37qHxP5SHXznQg0Sx4JqI/0c8QiVPo6VZRnZsqQCvIRj22XjUJPT4Re9r3eeo8biYsv522/trIxZ/cnVmWJYM9Gj63JHWg7AXzvv/KQVmOwRPofg/UOIT/VmU/PX58J7vC8edoXqAaaT7cmqPYxNLBADwbVbzKqpN1yy3SPF1xwOZmhrC7nxTVuceSe5+EqAtt0J3Gn37Nu6Xz24S8X9v7KHuGnIiaPHB4gjG+kUNrxj57rm4l7Bzbm1tyhwzrrN8pa+NWiBJESCmv9S8SdTwJqgeUwzupH/b5wwgkGSdKvn5NrhAFXr9GmNN1wtPIcm/sOnF2BARrlXxVZoje6Ny4qW9t4yGLk1V4M8KWxOSyOHHguEt6+b2STLr3S5n+pHRuFsJR5ZRqgMa2Z5K7MOe9JfnP8+RFdhljGeeZBE5DKaA4Y
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-Exchange-RoutingPolicyChecked: fwtZZo0fXARbkXvXuvaB4Hyo7nmHcZdP9oTPmPbZwwR7rHM+PtVAbsNzBW6yPtw9AmddtSMbdzxQoN1083f0v4CEQfad8RyRIdNY1svFR8Wy58rOjd1L9qxYd2RchAeaCwZByNNnb1p8vvxJz2C/5QVbfTJ1opcbFgvwwiPVWVL3XtiEw/UvZym3wzxVrg8cZJvM4yb2eJPlGd6WwX/+fE18ADrziqGZSG8v9vAeU0zCxyIPXKHlhxX38CM2WNMWnfXJYjXp0JT9Zac1rnAQZRISyX47tJbrD/UC5qrigV8L+6BePDJ67FWUcxA/bsq5wcbgMZzpKy+z4La8sopnTg==
X-OriginatorOrg: sitime.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: LVWPR20MB994915.namprd20.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 6f949d89-8d00-4fbc-ae12-08df5006334c
X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Dec 2026 23:52:08.1908
(UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 8fb55916-cf10-4b0d-96f4-cf3952657263
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: fPnDvilBgcLlr5AS23Uilgc3Sji22MHC7qkRUdxC05NXQKkezZP4fqWzUB60rn3V1DFnW8Gw7q1ZfDRVio1Jlw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR20MB6330
X-MDID: 1796169170-i_i9d8Sz_Tdy
X-PPE-STACK: {"stack":"us1"}
X-MDID-O: us1;ut7;1796169170;i_i9d8Sz_Tdy;<arouhi@sitime.com>;ba04557de9d2da8490f5f1e6de07b967
X-PPE-TRUSTED: V=1;DIR=OUT;