linux/drivers/ptp/ptp_fc3.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * PTP hardware clock driver for the FemtoClock3 family of timing and
 * synchronization devices.
 *
 * Copyright (C) 2023 Integrated Device Technology, Inc., a Renesas Company.
 */
#include <linux/firmware.h>
#include <linux/platform_device.h>
#include <linux/module.h>
#include <linux/ptp_clock_kernel.h>
#include <linux/delay.h>
#include <linux/jiffies.h>
#include <linux/kernel.h>
#include <linux/timekeeping.h>
#include <linux/string.h>
#include <linux/of.h>
#include <linux/bitfield.h>
#include <linux/mfd/rsmu.h>
#include <linux/mfd/idtRC38xxx_reg.h>
#include <asm/unaligned.h>

#include "ptp_private.h"
#include "ptp_fc3.h"

MODULE_DESCRIPTION();
MODULE_AUTHOR();
MODULE_VERSION();
MODULE_LICENSE();

/*
 * The name of the firmware file to be loaded
 * over-rides any automatic selection
 */
static char *firmware;
module_param(firmware, charp, 0);

static s64 ns2counters(struct idtfc3 *idtfc3, s64 nsec, u32 *sub_ns)
{}

static s64 tdc_meas2offset(struct idtfc3 *idtfc3, u64 meas_read)
{}

static s64 tdc_offset2phase(struct idtfc3 *idtfc3, s64 offset_ns)
{}

static int idtfc3_set_lpf_mode(struct idtfc3 *idtfc3, u8 mode)
{}

static int idtfc3_enable_lpf(struct idtfc3 *idtfc3, bool enable)
{}

static int idtfc3_get_time_ref_freq(struct idtfc3 *idtfc3)
{}

static int idtfc3_get_tdc_offset_sign(struct idtfc3 *idtfc3)
{}

static int idtfc3_lpf_bw(struct idtfc3 *idtfc3, u8 shift, u8 mult)
{}

static int idtfc3_enable_tdc(struct idtfc3 *idtfc3, bool enable, u8 meas_mode)
{}

static bool get_tdc_meas(struct idtfc3 *idtfc3, s64 *offset_ns)
{}

static int check_tdc_fifo_overrun(struct idtfc3 *idtfc3)
{}

static int get_tdc_meas_continuous(struct idtfc3 *idtfc3)
{}

static int idtfc3_read_subcounter(struct idtfc3 *idtfc3)
{}

static int idtfc3_tod_update_is_done(struct idtfc3 *idtfc3)
{}

static int idtfc3_write_subcounter(struct idtfc3 *idtfc3, u32 counter)
{}

static int idtfc3_timecounter_update(struct idtfc3 *idtfc3, u32 counter, s64 ns)
{}

static int idtfc3_timecounter_read(struct idtfc3 *idtfc3)
{}

static int _idtfc3_gettime(struct idtfc3 *idtfc3, struct timespec64 *ts)
{}

static int idtfc3_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts)
{}

static int _idtfc3_settime(struct idtfc3 *idtfc3, const struct timespec64 *ts)
{}

static int idtfc3_settime(struct ptp_clock_info *ptp, const struct timespec64 *ts)
{}

static int _idtfc3_adjtime(struct idtfc3 *idtfc3, s64 delta)
{}

static int idtfc3_adjtime(struct ptp_clock_info *ptp, s64 delta)
{}

static int _idtfc3_adjphase(struct idtfc3 *idtfc3, s32 delta)
{}

static int idtfc3_adjphase(struct ptp_clock_info *ptp, s32 delta)
{}

static int _idtfc3_adjfine(struct idtfc3 *idtfc3, long scaled_ppm)
{}

static int idtfc3_adjfine(struct ptp_clock_info *ptp, long scaled_ppm)
{}

static int idtfc3_enable(struct ptp_clock_info *ptp,
			 struct ptp_clock_request *rq, int on)
{}

static long idtfc3_aux_work(struct ptp_clock_info *ptp)
{}

static const struct ptp_clock_info idtfc3_caps =;

static int idtfc3_hw_calibrate(struct idtfc3 *idtfc3)
{}

static int idtfc3_init_timecounter(struct idtfc3 *idtfc3)
{}

static int idtfc3_get_tdc_apll_freq(struct idtfc3 *idtfc3)
{}

static int idtfc3_get_fod(struct idtfc3 *idtfc3)
{}

static int idtfc3_get_sync_count(struct idtfc3 *idtfc3)
{}

static int idtfc3_setup_hw_param(struct idtfc3 *idtfc3)
{}

static int idtfc3_configure_hw(struct idtfc3 *idtfc3)
{}

static int idtfc3_set_overhead(struct idtfc3 *idtfc3)
{}

static int idtfc3_enable_ptp(struct idtfc3 *idtfc3)
{}

static int idtfc3_load_firmware(struct idtfc3 *idtfc3)
{}

static int idtfc3_read_device_id(struct idtfc3 *idtfc3, u16 *device_id)
{}

static int idtfc3_check_device_compatibility(struct idtfc3 *idtfc3)
{}

static int idtfc3_probe(struct platform_device *pdev)
{}

static void idtfc3_remove(struct platform_device *pdev)
{}

static struct platform_driver idtfc3_driver =;

module_platform_driver();