#include <linux/clk.h>
#include <linux/clockchips.h>
#include <linux/clocksource.h>
#include <linux/err.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/of_address.h>
#include <linux/of_irq.h>
#include <linux/sched_clock.h>
#include <linux/slab.h>
#include <linux/fsl/ftm.h>
#define FTM_SC_CLK(c) …
struct ftm_clock_device { … };
static struct ftm_clock_device *priv;
static inline u32 ftm_readl(void __iomem *addr)
{ … }
static inline void ftm_writel(u32 val, void __iomem *addr)
{ … }
static inline void ftm_counter_enable(void __iomem *base)
{ … }
static inline void ftm_counter_disable(void __iomem *base)
{ … }
static inline void ftm_irq_acknowledge(void __iomem *base)
{ … }
static inline void ftm_irq_enable(void __iomem *base)
{ … }
static inline void ftm_irq_disable(void __iomem *base)
{ … }
static inline void ftm_reset_counter(void __iomem *base)
{ … }
static u64 notrace ftm_read_sched_clock(void)
{ … }
static int ftm_set_next_event(unsigned long delta,
struct clock_event_device *unused)
{ … }
static int ftm_set_oneshot(struct clock_event_device *evt)
{ … }
static int ftm_set_periodic(struct clock_event_device *evt)
{ … }
static irqreturn_t ftm_evt_interrupt(int irq, void *dev_id)
{ … }
static struct clock_event_device ftm_clockevent = …;
static int __init ftm_clockevent_init(unsigned long freq, int irq)
{ … }
static int __init ftm_clocksource_init(unsigned long freq)
{ … }
static int __init __ftm_clk_init(struct device_node *np, char *cnt_name,
char *ftm_name)
{ … }
static unsigned long __init ftm_clk_init(struct device_node *np)
{ … }
static int __init ftm_calc_closest_round_cyc(unsigned long freq)
{ … }
static int __init ftm_timer_init(struct device_node *np)
{ … }
TIMER_OF_DECLARE(flextimer, "fsl,ftm-timer", ftm_timer_init);