linux/drivers/ptp/ptp_qoriq.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * PTP 1588 clock for Freescale QorIQ 1588 timer
 *
 * Copyright (C) 2010 OMICRON electronics GmbH
 */

#define pr_fmt(fmt)

#include <linux/device.h>
#include <linux/hrtimer.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/timex.h>
#include <linux/slab.h>
#include <linux/clk.h>

#include <linux/fsl/ptp_qoriq.h>

/*
 * Register access functions
 */

/* Caller must hold ptp_qoriq->lock. */
static u64 tmr_cnt_read(struct ptp_qoriq *ptp_qoriq)
{}

/* Caller must hold ptp_qoriq->lock. */
static void tmr_cnt_write(struct ptp_qoriq *ptp_qoriq, u64 ns)
{}

static u64 tmr_offset_read(struct ptp_qoriq *ptp_qoriq)
{}

static void tmr_offset_write(struct ptp_qoriq *ptp_qoriq, u64 delta_ns)
{}

/* Caller must hold ptp_qoriq->lock. */
static void set_alarm(struct ptp_qoriq *ptp_qoriq)
{}

/* Caller must hold ptp_qoriq->lock. */
static void set_fipers(struct ptp_qoriq *ptp_qoriq)
{}

int extts_clean_up(struct ptp_qoriq *ptp_qoriq, int index, bool update_event)
{}
EXPORT_SYMBOL_GPL();

/*
 * Interrupt service routine
 */

irqreturn_t ptp_qoriq_isr(int irq, void *priv)
{}
EXPORT_SYMBOL_GPL();

/*
 * PTP clock operations
 */

int ptp_qoriq_adjfine(struct ptp_clock_info *ptp, long scaled_ppm)
{}
EXPORT_SYMBOL_GPL();

int ptp_qoriq_adjtime(struct ptp_clock_info *ptp, s64 delta)
{}
EXPORT_SYMBOL_GPL();

int ptp_qoriq_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts)
{}
EXPORT_SYMBOL_GPL();

int ptp_qoriq_settime(struct ptp_clock_info *ptp,
		      const struct timespec64 *ts)
{}
EXPORT_SYMBOL_GPL();

int ptp_qoriq_enable(struct ptp_clock_info *ptp,
		     struct ptp_clock_request *rq, int on)
{}
EXPORT_SYMBOL_GPL();

static const struct ptp_clock_info ptp_qoriq_caps =;

/**
 * ptp_qoriq_nominal_freq - calculate nominal frequency according to
 *			    reference clock frequency
 *
 * @clk_src: reference clock frequency
 *
 * The nominal frequency is the desired clock frequency.
 * It should be less than the reference clock frequency.
 * It should be a factor of 1000MHz.
 *
 * Return the nominal frequency
 */
static u32 ptp_qoriq_nominal_freq(u32 clk_src)
{}

/**
 * ptp_qoriq_auto_config - calculate a set of default configurations
 *
 * @ptp_qoriq: pointer to ptp_qoriq
 * @node: pointer to device_node
 *
 * If below dts properties are not provided, this function will be
 * called to calculate a set of default configurations for them.
 *   "fsl,tclk-period"
 *   "fsl,tmr-prsc"
 *   "fsl,tmr-add"
 *   "fsl,tmr-fiper1"
 *   "fsl,tmr-fiper2"
 *   "fsl,tmr-fiper3" (required only for DPAA2 and ENETC hardware)
 *   "fsl,max-adj"
 *
 * Return 0 if success
 */
static int ptp_qoriq_auto_config(struct ptp_qoriq *ptp_qoriq,
				 struct device_node *node)
{}

int ptp_qoriq_init(struct ptp_qoriq *ptp_qoriq, void __iomem *base,
		   const struct ptp_clock_info *caps)
{}
EXPORT_SYMBOL_GPL();

void ptp_qoriq_free(struct ptp_qoriq *ptp_qoriq)
{}
EXPORT_SYMBOL_GPL();

static int ptp_qoriq_probe(struct platform_device *dev)
{}

static void ptp_qoriq_remove(struct platform_device *dev)
{}

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

static struct platform_driver ptp_qoriq_driver =;

module_platform_driver();

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