#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/platform_device.h>
+#include <linux/ptp_clock_kernel.h>
#include <linux/slab.h>
#include "rcar_gen4_ptp.h"
#define PTPGPTPTM10_REG 0x0054
#define PTPGPTPTM20_REG 0x0058
+struct rcar_gen4_ptp_private {
+ void __iomem *addr;
+ struct ptp_clock *clock;
+ struct ptp_clock_info info;
+ spinlock_t lock; /* For multiple registers access */
+ s64 default_addend;
+ bool initialized;
+};
+
#define ptp_to_priv(ptp) container_of(ptp, struct rcar_gen4_ptp_private, info)
static int rcar_gen4_ptp_adjfine(struct ptp_clock_info *ptp, long scaled_ppm)
#ifndef __RCAR_GEN4_PTP_H__
#define __RCAR_GEN4_PTP_H__
-#include <linux/ptp_clock_kernel.h>
-
-struct rcar_gen4_ptp_private {
- void __iomem *addr;
- struct ptp_clock *clock;
- struct ptp_clock_info info;
- spinlock_t lock; /* For multiple registers access */
- s64 default_addend;
- bool initialized;
-};
+struct rcar_gen4_ptp_private;
int rcar_gen4_ptp_register(struct rcar_gen4_ptp_private *ptp_priv, u32 rate);
int rcar_gen4_ptp_unregister(struct rcar_gen4_ptp_private *ptp_priv);