linux/drivers/ptp/ptp_dte.c

// SPDX-License-Identifier: GPL-2.0-only
// Copyright 2017 Broadcom

#include <linux/err.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/platform_device.h>
#include <linux/ptp_clock_kernel.h>
#include <linux/types.h>

#define DTE_NCO_LOW_TIME_REG
#define DTE_NCO_TIME_REG
#define DTE_NCO_OVERFLOW_REG
#define DTE_NCO_INC_REG

#define DTE_NCO_SUM2_MASK
#define DTE_NCO_SUM2_SHIFT

#define DTE_NCO_SUM3_MASK
#define DTE_NCO_SUM3_SHIFT
#define DTE_NCO_SUM3_WR_SHIFT

#define DTE_NCO_TS_WRAP_MASK
#define DTE_NCO_TS_WRAP_LSHIFT

#define DTE_NCO_INC_DEFAULT
#define DTE_NUM_REGS_TO_RESTORE

/* Full wrap around is 44bits in ns (~4.887 hrs) */
#define DTE_WRAP_AROUND_NSEC_SHIFT

/* 44 bits NCO */
#define DTE_NCO_MAX_NS

/* 125MHz with 3.29 reg cfg */
#define DTE_PPB_ADJ(ppb)

/* ptp dte priv structure */
struct ptp_dte {};

static void dte_write_nco(void __iomem *regs, s64 ns)
{}

static s64 dte_read_nco(void __iomem *regs)
{}

static void dte_write_nco_delta(struct ptp_dte *ptp_dte, s64 delta)
{}

static s64 dte_read_nco_with_ovf(struct ptp_dte *ptp_dte)
{}

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

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

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

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

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

static const struct ptp_clock_info ptp_dte_caps =;

static int ptp_dte_probe(struct platform_device *pdev)
{}

static void ptp_dte_remove(struct platform_device *pdev)
{}

#ifdef CONFIG_PM_SLEEP
static int ptp_dte_suspend(struct device *dev)
{}

static int ptp_dte_resume(struct device *dev)
{}

static const struct dev_pm_ops ptp_dte_pm_ops =;

#define PTP_DTE_PM_OPS
#else
#define PTP_DTE_PM_OPS
#endif

static const struct of_device_id ptp_dte_of_match[] =;
MODULE_DEVICE_TABLE(of, ptp_dte_of_match);

static struct platform_driver ptp_dte_driver =;
module_platform_driver();

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