1 /* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 */ 2 /* Copyright (c) 2019 Mellanox Technologies. All rights reserved */ 3 4 #ifndef _MLXSW_SPECTRUM_PTP_H 5 #define _MLXSW_SPECTRUM_PTP_H 6 7 #include <linux/device.h> 8 9 #include "spectrum.h" 10 11 struct mlxsw_sp_ptp_clock; 12 13 #if IS_REACHABLE(CONFIG_PTP_1588_CLOCK) 14 15 struct mlxsw_sp_ptp_clock * 16 mlxsw_sp1_ptp_clock_init(struct mlxsw_sp *mlxsw_sp, struct device *dev); 17 18 void mlxsw_sp1_ptp_clock_fini(struct mlxsw_sp_ptp_clock *clock); 19 20 #else 21 22 static inline struct mlxsw_sp_ptp_clock * 23 mlxsw_sp1_ptp_clock_init(struct mlxsw_sp *mlxsw_sp, struct device *dev) 24 { 25 return NULL; 26 } 27 28 static inline void mlxsw_sp1_ptp_clock_fini(struct mlxsw_sp_ptp_clock *clock) 29 { 30 } 31 32 #endif 33 34 static inline struct mlxsw_sp_ptp_clock * 35 mlxsw_sp2_ptp_clock_init(struct mlxsw_sp *mlxsw_sp, struct device *dev) 36 { 37 return NULL; 38 } 39 40 static inline void mlxsw_sp2_ptp_clock_fini(struct mlxsw_sp_ptp_clock *clock) 41 { 42 } 43 44 #endif 45