Skip to content

Commit 2d82a0d

Browse files
yangbolu1991MaureenHelm
authored andcommitted
drivers: eth_e1000: adjust ptp clock rate based on nominal frequency
Adjusted ptp clock rate based on nominal frequency. Signed-off-by: Yangbo Lu <[email protected]>
1 parent 76b7bcc commit 2d82a0d

File tree

2 files changed

+0
-11
lines changed

2 files changed

+0
-11
lines changed

drivers/ethernet/eth_e1000.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -397,22 +397,12 @@ static int ptp_clock_e1000_rate_adjust(const struct device *dev, double ratio)
397397
int32_t mul;
398398
float val;
399399

400-
/* No change needed. */
401-
if (ratio == 1.0) {
402-
return 0;
403-
}
404-
405-
ratio *= context->clk_ratio;
406-
407400
/* Limit possible ratio. */
408401
if ((ratio > 1.0 + 1.0/(2.0 * hw_inc)) ||
409402
(ratio < 1.0 - 1.0/(2.0 * hw_inc))) {
410403
return -EINVAL;
411404
}
412405

413-
/* Save new ratio. */
414-
context->clk_ratio = ratio;
415-
416406
if (ratio < 1.0) {
417407
corr = hw_inc - 1;
418408
val = 1.0 / (hw_inc * (1.0 - ratio));

drivers/ethernet/eth_e1000_priv.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ struct e1000_dev {
102102
uint8_t rxb[CONFIG_ETH_E1000_RX_QUEUE_SIZE][NET_ETH_MTU];
103103
#if defined(CONFIG_ETH_E1000_PTP_CLOCK)
104104
const struct device *ptp_clock;
105-
double clk_ratio;
106105
#endif
107106
#if defined(CONFIG_NET_STATISTICS_ETHERNET)
108107
struct net_stats_eth stats;

0 commit comments

Comments
 (0)