#include <linux/clk.h>
#include <linux/interrupt.h>
#include <linux/clockchips.h>
#include <linux/clocksource.h>
#include <linux/of_address.h>
#include <linux/of_irq.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/sched_clock.h>
#include <linux/module.h>
#include <linux/of_platform.h>
#define TTC_CLK_CNTRL_OFFSET …
#define TTC_CNT_CNTRL_OFFSET …
#define TTC_COUNT_VAL_OFFSET …
#define TTC_INTR_VAL_OFFSET …
#define TTC_ISR_OFFSET …
#define TTC_IER_OFFSET …
#define TTC_CNT_CNTRL_DISABLE_MASK …
#define TTC_CLK_CNTRL_CSRC_MASK …
#define TTC_CLK_CNTRL_PSV_MASK …
#define TTC_CLK_CNTRL_PSV_SHIFT …
#define PRESCALE_EXPONENT …
#define PRESCALE …
#define CLK_CNTRL_PRESCALE …
#define CLK_CNTRL_PRESCALE_EN …
#define CNT_CNTRL_RESET …
#define MAX_F_ERR …
struct ttc_timer { … };
#define to_ttc_timer(x) …
struct ttc_timer_clocksource { … };
#define to_ttc_timer_clksrc(x) …
struct ttc_timer_clockevent { … };
#define to_ttc_timer_clkevent(x) …
static void __iomem *ttc_sched_clock_val_reg;
static void ttc_set_interval(struct ttc_timer *timer,
unsigned long cycles)
{ … }
static irqreturn_t ttc_clock_event_interrupt(int irq, void *dev_id)
{ … }
static u64 __ttc_clocksource_read(struct clocksource *cs)
{ … }
static u64 notrace ttc_sched_clock_read(void)
{ … }
static int ttc_set_next_event(unsigned long cycles,
struct clock_event_device *evt)
{ … }
static int ttc_shutdown(struct clock_event_device *evt)
{ … }
static int ttc_set_periodic(struct clock_event_device *evt)
{ … }
static int ttc_resume(struct clock_event_device *evt)
{ … }
static int ttc_rate_change_clocksource_cb(struct notifier_block *nb,
unsigned long event, void *data)
{ … }
static int __init ttc_setup_clocksource(struct clk *clk, void __iomem *base,
u32 timer_width)
{ … }
static int ttc_rate_change_clockevent_cb(struct notifier_block *nb,
unsigned long event, void *data)
{ … }
static int __init ttc_setup_clockevent(struct clk *clk,
void __iomem *base, u32 irq)
{ … }
static int __init ttc_timer_probe(struct platform_device *pdev)
{ … }
static const struct of_device_id ttc_timer_of_match[] = …;
MODULE_DEVICE_TABLE(of, ttc_timer_of_match);
static struct platform_driver ttc_timer_driver = …;
builtin_platform_driver_probe(…);