forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
....@@ -1,19 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*******************************************************************************
23 PTP 1588 clock using the STMMAC.
34
45 Copyright (C) 2013 Vayavya Labs Pvt Ltd
56
6
- This program is free software; you can redistribute it and/or modify it
7
- under the terms and conditions of the GNU General Public License,
8
- version 2, as published by the Free Software Foundation.
9
-
10
- This program is distributed in the hope it will be useful, but WITHOUT
11
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13
- more details.
14
-
15
- The full GNU General Public License is included in this distribution in
16
- the file called "COPYING".
177
188 Author: Rayagond Kokatanur <rayagond@vayavyalabs.com>
199 *******************************************************************************/
....@@ -150,6 +140,10 @@
150140
151141 switch (rq->type) {
152142 case PTP_CLK_REQ_PEROUT:
143
+ /* Reject requests with unsupported flags */
144
+ if (rq->perout.flags)
145
+ return -EOPNOTSUPP;
146
+
153147 cfg = &priv->pps[rq->perout.index];
154148
155149 cfg->start.tv_sec = rq->perout.start.sec;
....@@ -204,6 +198,9 @@
204198 priv->pps[i].available = true;
205199 }
206200
201
+ if (priv->plat->ptp_max_adj)
202
+ stmmac_ptp_clock_ops.max_adj = priv->plat->ptp_max_adj;
203
+
207204 stmmac_ptp_clock_ops.n_per_out = priv->dma_cap.pps_out_num;
208205
209206 spin_lock_init(&priv->ptp_lock);