| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /******************************************************************************* |
|---|
| 2 | 3 | PTP 1588 clock using the STMMAC. |
|---|
| 3 | 4 | |
|---|
| 4 | 5 | Copyright (C) 2013 Vayavya Labs Pvt Ltd |
|---|
| 5 | 6 | |
|---|
| 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". |
|---|
| 17 | 7 | |
|---|
| 18 | 8 | Author: Rayagond Kokatanur <rayagond@vayavyalabs.com> |
|---|
| 19 | 9 | *******************************************************************************/ |
|---|
| .. | .. |
|---|
| 150 | 140 | |
|---|
| 151 | 141 | switch (rq->type) { |
|---|
| 152 | 142 | case PTP_CLK_REQ_PEROUT: |
|---|
| 143 | + /* Reject requests with unsupported flags */ |
|---|
| 144 | + if (rq->perout.flags) |
|---|
| 145 | + return -EOPNOTSUPP; |
|---|
| 146 | + |
|---|
| 153 | 147 | cfg = &priv->pps[rq->perout.index]; |
|---|
| 154 | 148 | |
|---|
| 155 | 149 | cfg->start.tv_sec = rq->perout.start.sec; |
|---|
| .. | .. |
|---|
| 204 | 198 | priv->pps[i].available = true; |
|---|
| 205 | 199 | } |
|---|
| 206 | 200 | |
|---|
| 201 | + if (priv->plat->ptp_max_adj) |
|---|
| 202 | + stmmac_ptp_clock_ops.max_adj = priv->plat->ptp_max_adj; |
|---|
| 203 | + |
|---|
| 207 | 204 | stmmac_ptp_clock_ops.n_per_out = priv->dma_cap.pps_out_num; |
|---|
| 208 | 205 | |
|---|
| 209 | 206 | spin_lock_init(&priv->ptp_lock); |
|---|